:root{
  --bg:#fff8ec; --card:#ffffff; --line:#f0e3cc;
  --ink:#1f2340; --ink-soft:#5a5f80;
  --red:#e63946; --yellow:#ffb703; --blue:#219ebc; --green:#2a9d8f;
  --accent:var(--red);
  --radius:22px;
  --maxw:1080px;
  --shadow:0 6px 0 rgba(31,35,64,.10);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#14162b; --card:#1e2140; --line:#2c3058;
    --ink:#f4f1ea; --ink-soft:#aab0d6;
    --shadow:0 6px 0 rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"]{
  --bg:#14162b; --card:#1e2140; --line:#2c3058;
  --ink:#f4f1ea; --ink-soft:#aab0d6;
  --shadow:0 6px 0 rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Fredoka",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size:18px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit}
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 16px}
@media (min-width:640px){ .wrap{padding:0 24px} }

/* ---------- nav ---------- */
.top{
  max-width:var(--maxw); margin:0 auto; padding:18px 16px;
  display:flex; align-items:center; justify-content:space-between;
}
@media (min-width:640px){ .top{padding:22px 24px} }
.logo{font-weight:700; font-size:26px; text-decoration:none; letter-spacing:-.01em}
.logo span{color:var(--accent)}
.lang{display:flex; gap:4px; background:var(--card); border:2px solid var(--line); border-radius:100px; padding:3px}
.lang button{
  font:inherit; font-size:15px; font-weight:600; border:0; cursor:pointer;
  padding:5px 12px; border-radius:100px; background:transparent; color:var(--ink-soft);
}
.lang button[aria-pressed="true"]{background:var(--ink); color:var(--bg)}

/* ---------- hero ---------- */
.hero{
  max-width:var(--maxw); margin:0 auto; padding:28px 16px 40px;
  display:grid; gap:24px; align-items:center;
}
@media (min-width:760px){ .hero{grid-template-columns:1.4fr 1fr; padding:48px 24px 64px} }
.eyebrow{
  display:inline-block; font-size:15px; font-weight:600;
  background:var(--yellow); color:#1f2340;
  padding:5px 14px; border-radius:100px; margin-bottom:14px;
}
.hero h1{font-size:clamp(40px,8vw,68px); line-height:1.02; margin:0 0 14px; font-weight:700; letter-spacing:-.02em}
.hero p{font-size:20px; color:var(--ink-soft); margin:0; max-width:32ch}

.hero-art{position:relative; height:200px; max-width:320px; width:100%; justify-self:center}
.brick{
  position:absolute; height:56px; border-radius:10px; box-shadow:var(--shadow);
  background-image:radial-gradient(circle at center, rgba(255,255,255,.35) 0 9px, transparent 10px);
  background-size:40px 56px; background-position:0 -14px;
}
.b1{width:200px; left:0; bottom:0; background-color:var(--red)}
.b2{width:160px; left:60px; bottom:58px; background-color:var(--blue)}
.b3{width:120px; left:20px; bottom:116px; background-color:var(--yellow)}
.pad{position:absolute; right:0; top:10px; font-size:84px; transform:rotate(12deg); animation:bob 3s ease-in-out infinite}
@keyframes bob{50%{transform:rotate(4deg) translateY(-10px)}}
@media (prefers-reduced-motion:reduce){ .pad{animation:none} }

/* ---------- grid ---------- */
main h2{font-size:32px; margin:0 0 18px}
.grid{display:grid; gap:20px; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); padding-bottom:48px}
.card{
  display:flex; flex-direction:column; text-decoration:none;
  background:var(--card); border:2px solid var(--line); border-radius:var(--radius);
  overflow:hidden; box-shadow:var(--shadow);
  transition:transform .15s ease, box-shadow .15s ease;
}
.card:hover,.card:focus-visible{transform:translateY(-4px) rotate(-.5deg); box-shadow:0 10px 0 rgba(31,35,64,.12)}
.cover{aspect-ratio:16/10; display:grid; place-items:center; background:var(--c,#8ecae6); overflow:hidden}
.cover img{width:100%; height:100%; object-fit:cover; display:block}
.cover-emoji{font-size:84px; filter:drop-shadow(0 4px 0 rgba(0,0,0,.15))}
.card-body{padding:16px 18px 18px; display:flex; flex-direction:column; gap:6px; flex:1}
.card h3{margin:0; font-size:24px; line-height:1.15}
.card p{margin:0; color:var(--ink-soft); font-size:16px; flex:1}
.badge{align-self:flex-start; font-size:13px; font-weight:600; padding:2px 10px; border-radius:100px; color:#fff}
.badge--html{background:var(--green)}
.badge--scratch{background:#f7a31b; color:#1f2340}
.play{
  align-self:flex-start; margin-top:8px; font-weight:600;
  background:var(--accent); color:#fff; padding:8px 18px; border-radius:100px;
}
.empty{color:var(--ink-soft); font-size:20px}

/* ---------- player ---------- */
.player{padding-bottom:48px}
.back{display:inline-block; text-decoration:none; color:var(--ink-soft); font-weight:500; margin:4px 0 12px}
.back:hover{color:var(--ink)}
.player-head{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px}
.player-head h1{margin:0; font-size:clamp(30px,6vw,44px); line-height:1.1}
.btn{
  font:inherit; font-weight:600; font-size:16px; cursor:pointer;
  border:2px solid var(--line); background:var(--card); color:var(--ink);
  padding:8px 16px; border-radius:100px;
}
.btn:hover{border-color:var(--ink-soft)}
.stage{
  background:#000; border-radius:var(--radius); overflow:hidden;
  box-shadow:var(--shadow); border:2px solid var(--line);
}
.stage iframe{display:block; width:100%; aspect-ratio:4/3; border:0; max-height:80vh}
.stage iframe.is-scratch{aspect-ratio:485/402}
.stage{container-type:inline-size}
.stage iframe.has-aspect{aspect-ratio:auto; height:calc(100cqw * var(--ar)); max-height:none}
/* telefon dikey: oyunun altındaki dokunmatik düğmelere yer aç */
@media (pointer:coarse) and (orientation:portrait){
  .stage iframe.has-aspect{height:calc(100cqw * var(--ar) + 220px)}
}
.stage .empty{color:#fff; padding:40px; margin:0; text-align:center}
.info{margin-top:16px; color:var(--ink-soft)}
.info p{margin:0 0 6px}
.info strong{color:var(--ink)}

/* ---------- footer ---------- */
.foot{padding:24px 16px 40px; color:var(--ink-soft); font-size:15px; text-align:center}
