:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #eefaff;
  --muted: #9bc0d1;
  --glass: rgba(5, 19, 34, .78);
  --line: rgba(179, 229, 246, .18);
  --cyan: #6de6ff;
  --lime: #c7ff76;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #071a2f; }
body { color: var(--ink); }
button { font: inherit; }
.game-shell { position: relative; width: 100%; height: 100%; min-height: 430px; isolation: isolate; }
#game { width: 100%; height: 100%; display: block; cursor: crosshair; outline: none; touch-action: none; }
.topbar {
  position: absolute; z-index: 3; inset: max(14px, env(safe-area-inset-top)) 18px auto;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 18px #001; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: #082238; background: linear-gradient(145deg, var(--cyan), var(--lime)); clip-path: polygon(50% 0, 100% 38%, 83% 100%, 17% 100%, 0 38%); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .04em; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.stats { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--glass); backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgba(0, 0, 0, .2); }
.stats span { min-width: 82px; padding: 9px 12px; border-left: 1px solid var(--line); }
.stats span:first-child { border-left: 0; }
.stats small, .stats strong { display: block; }
.stats small { color: var(--muted); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.stats strong { margin-top: 2px; font-size: 15px; }
#hearts { color: #ff708d; letter-spacing: .06em; }
.controls { position: absolute; z-index: 4; right: 18px; bottom: 34px; display: flex; gap: 8px; }
.controls button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--glass); cursor: pointer; backdrop-filter: blur(14px); }
.controls button:hover, .controls button:focus-visible { border-color: var(--cyan); color: var(--cyan); outline: none; }
.panel {
  position: absolute; z-index: 5; left: 50%; top: 52%; width: min(520px, calc(100% - 36px));
  transform: translate(-50%, -50%); padding: 30px; text-align: center;
  border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(8, 31, 52, .95), rgba(4, 15, 29, .91));
  box-shadow: 0 28px 80px rgba(0, 8, 20, .48); backdrop-filter: blur(20px);
}
.panel.hidden { display: none; }
.eyebrow { margin: 0 0 9px; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.panel h1 { margin: 0; font-size: clamp(31px, 6vw, 52px); line-height: .98; letter-spacing: -.045em; }
.panel > p:not(.eyebrow) { max-width: 440px; margin: 17px auto; color: #b9d3df; line-height: 1.55; }
.key-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; margin: 20px 0; color: var(--muted); font-size: 12px; }
kbd { display: inline-grid; min-width: 24px; height: 24px; margin-right: 3px; place-items: center; border: 1px solid #477188; border-bottom-width: 3px; border-radius: 6px; color: white; background: #17364a; font-family: inherit; }
.primary { min-width: 172px; border: 0; border-radius: 999px; padding: 13px 24px; color: #062033; background: linear-gradient(100deg, var(--cyan), var(--lime)); font-weight: 850; cursor: pointer; box-shadow: 0 12px 30px rgba(109, 230, 255, .2); }
.primary:hover, .primary:focus-visible { transform: translateY(-1px); outline: 3px solid rgba(109, 230, 255, .25); }
.panel > small { display: block; margin-top: 12px; color: #6f98aa; }
.toast { position: absolute; z-index: 4; left: 50%; top: 112px; transform: translate(-50%, -10px); padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); color: var(--lime); font-size: 12px; opacity: 0; transition: .2s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { position: absolute; z-index: 3; left: 18px; bottom: 18px; color: rgba(202, 231, 240, .58); font-size: 10px; letter-spacing: .04em; pointer-events: none; }
@media (max-width: 680px) {
  .topbar { inset-inline: 12px; }
  .brand small { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .stats span { min-width: 58px; padding: 7px 8px; }
  .stats span:nth-child(3) { display: none; }
  .stats strong { font-size: 12px; }
  .panel { padding: 25px 20px; }
  .controls { right: 12px; bottom: 18px; }
  footer { left: 12px; max-width: 58%; bottom: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
