:root{
  --bg:#0b1220; --card:#0f1b33; --text:#eaf0ff; --muted:#a8b3d6;
  --border:rgba(255,255,255,.10);
  --accent:#3b82f6; --good:#22c55e; --bad:#ef4444;
  --radius:16px; --shadow:0 10px 30px rgba(0,0,0,.35);
  --max:1080px; --tap:48px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica,Arial;
  background:radial-gradient(1200px 900px at 20% -10%, rgba(59,130,246,.25), transparent 60%),
             radial-gradient(900px 700px at 90% 10%, rgba(34,197,94,.18), transparent 55%),
             var(--bg);
  color:var(--text);
  line-height:1.45;
}
a{color:inherit}
.container{max-width:var(--max); margin:0 auto; padding:0 16px}
.site-header{position:sticky; top:0; z-index:30; backdrop-filter: blur(10px);
  background:rgba(11,18,32,.65); border-bottom:1px solid var(--border)}
.header__inner{display:flex; align-items:center; justify-content:space-between; padding:10px 0; gap:12px}
.brand{font-weight:900; letter-spacing:.2px; text-decoration:none}
.nav{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.nav__a{font-size:14px; color:var(--muted); text-decoration:none; padding:8px 10px;
  border-radius:999px; border:1px solid transparent}
.nav__a:hover{border-color:var(--border); color:var(--text)}
.nav__a.is-active{background:rgba(59,130,246,.16); color:var(--text); border-color:rgba(59,130,246,.35)}
.nav__a:focus{outline:2px solid rgba(59,130,246,.6); outline-offset:2px}
.crumb{border-bottom:1px solid var(--border); background:rgba(15,27,51,.35)}
.crumb .container{padding:10px 16px; font-size:13px; color:var(--muted)}
.crumb__a{text-decoration:none; color:var(--muted)}
.crumb__a:hover{color:var(--text)}
.crumb__sep{margin:0 8px; opacity:.55}
.crumb__current{color:var(--text)}
.hero{padding:28px 0 8px}
.hero h1{margin:0 0 10px; font-size:26px; line-height:1.1}
.hero p{margin:0; color:var(--muted); max-width:74ch}
.main{padding:10px 0 40px}
.section{margin-top:18px}
.section h2{margin:0 0 10px; font-size:18px}
.grid{display:grid; gap:14px}
.grid--cards{grid-template-columns:repeat(1,minmax(0,1fr))}
@media (min-width:760px){ .grid--cards{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (min-width:1024px){ .grid--cards{grid-template-columns:repeat(3,minmax(0,1fr))} }
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:14px;
}
.card h2, .card h3{margin:0 0 8px; font-size:16px}
.card p{margin:0; color:var(--muted); font-size:14px}
.card a{display:block; text-decoration:none}
.kv{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.badge{display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px;
  border:1px solid var(--border); color:var(--muted); font-size:12px}
.badge--a{border-color:rgba(34,197,94,.35); color:#caffdf; background:rgba(34,197,94,.12)}
.badge--b{border-color:rgba(59,130,246,.35); color:#dbeafe; background:rgba(59,130,246,.10)}
.badge--c{border-color:rgba(255,255,255,.14); color:var(--muted)}
.game-shell{
  background:linear-gradient(180deg, rgba(15,27,51,.8), rgba(12,21,43,.8));
  border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:14px;
}
.controls{display:flex; flex-direction:column; gap:10px}
@media(min-width:760px){ .controls{flex-direction:row; align-items:center; justify-content:space-between} }
.seg{display:flex; gap:8px; flex-wrap:wrap}
.seg button{
  min-height:var(--tap); padding:10px 12px; border-radius:999px;
  border:1px solid var(--border); background:rgba(255,255,255,.03);
  color:var(--muted); font-weight:700;
}
.seg button[aria-pressed="true"]{background:rgba(59,130,246,.18); border-color:rgba(59,130,246,.45); color:var(--text)}
.btn{
  min-height:var(--tap); padding:12px 14px; border-radius:12px;
  border:1px solid rgba(59,130,246,.55);
  background:linear-gradient(180deg, rgba(59,130,246,.95), rgba(59,130,246,.75));
  color:white; font-weight:900;
}
.btn--ghost{border:1px solid var(--border); background:rgba(255,255,255,.03); color:var(--text); font-weight:800}
.btn:focus, .seg button:focus{outline:2px solid rgba(59,130,246,.6); outline-offset:2px}
.stats{display:flex; gap:10px; flex-wrap:wrap}
.stat{padding:8px 10px; border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,.02)}
.stat .k{font-size:11px; color:var(--muted)}
.stat .v{font-size:15px; font-weight:900}
.canvas{
  width:100%; min-height:320px; height:min(52vh, 520px);
  border-radius:14px; border:1px solid rgba(255,255,255,.08);
  background:radial-gradient(1000px 500px at 30% 0%, rgba(59,130,246,.15), transparent 55%),
             rgba(255,255,255,.02);
  position:relative; overflow:hidden; touch-action:manipulation;
}
.note{color:var(--muted); font-size:13px}
.details{border:1px solid var(--border); border-radius:14px; background:rgba(255,255,255,.02); padding:10px 12px}
details{border-top:1px solid var(--border); padding-top:10px; margin-top:10px}
details:first-child{border-top:none; padding-top:0; margin-top:0}
summary{cursor:pointer; font-weight:900}
summary::-webkit-details-marker{display:none}
.faq-a{color:var(--muted); margin:8px 0 0}
.links{display:flex; gap:10px; flex-wrap:wrap}
.links a{color:#dbeafe; text-decoration:none; border:1px solid rgba(59,130,246,.35); padding:8px 10px;
  border-radius:999px; background:rgba(59,130,246,.10)}
.links a:hover{border-color:rgba(59,130,246,.7)}
.site-footer{border-top:1px solid var(--border); padding:18px 0; background:rgba(0,0,0,.12)}
.footer__inner{display:flex; flex-direction:column; gap:10px}
.footer__links{display:flex; gap:14px; flex-wrap:wrap}
.footer__links a{color:var(--muted); text-decoration:none}
.footer__links a:hover{color:var(--text)}
.footer__small{color:var(--muted); font-size:12px}
.cookie{position:fixed; left:0; right:0; bottom:0; padding:12px; display:none; z-index:50}
.cookie.is-open{display:block}
.cookie__card{max-width:var(--max); margin:0 auto; background:rgba(15,27,51,.92); border:1px solid var(--border);
  border-radius:18px; padding:12px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:10px}
@media(min-width:760px){ .cookie__card{flex-direction:row; align-items:center; justify-content:space-between} }
.cookie__text{color:var(--muted); font-size:13px; max-width:80ch}
.cookie__actions{display:flex; gap:10px}
/* widgets */
.aim-target{
  position:absolute; border-radius:999px; border:2px solid rgba(255,255,255,.28);
  background:radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(59,130,246,.10));
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.aim-target:active{transform:scale(.98)}
.prec-circle{
  position:absolute; border-radius:999px; border:2px solid rgba(59,130,246,.6);
  background:rgba(59,130,246,.10); pointer-events:none;
}
.tilegrid{display:grid; gap:10px; height:100%}
.tile{border-radius:14px; border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.02);
  display:flex; align-items:center; justify-content:center; font-weight:900; font-size:18px; min-height:var(--tap)}
.tile:active{transform:scale(.99)}
.dpad{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; height:100%}
.dpad .btn{width:100%}
.simon{display:grid; grid-template-columns:repeat(2,1fr); gap:12px; height:100%}
.simon button{min-height:120px; border-radius:18px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04)}
.simon button.is-flash{outline:3px solid rgba(34,197,94,.55); background:rgba(34,197,94,.12)}

/* Safe-area support (iOS notch) */
body{ padding-bottom: env(safe-area-inset-bottom); }
.cookie{ padding-bottom: env(safe-area-inset-bottom); }
.site-footer{ padding-bottom: env(safe-area-inset-bottom); }
