:root {
  color-scheme: dark;
  --bg: #09111f;
  --panel: #0f1b2e;
  --panel-strong: #16263f;
  --ink: #f7fbff;
  --muted: #aab7c8;
  --line: rgba(255, 255, 255, 0.14);
  --green: #49df9a;
  --gold: #ffd166;
  --blue: #55c7ff;
  --pink: #ff6f9f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  display: grid;
  justify-items: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(73, 223, 154, 0.18), transparent 30%),
    radial-gradient(circle at 84% 14%, rgba(255, 111, 159, 0.14), transparent 30%),
    linear-gradient(180deg, #09111f 0%, #050914 100%);
}
button { font: inherit; cursor: pointer; }

.game-shell {
  width: min(100vw, 390px);
  min-height: 100svh;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 1rem;
}

.hero-panel,
.status-panel,
.notice-panel,
.board-card,
.rules-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}
.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}
.kicker {
  margin: 0 0 0.32rem;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 11vw, 2.85rem); line-height: 0.95; }
h2 { font-size: 1rem; }
.round-pill {
  min-width: 5.5rem;
  border-radius: 18px;
  padding: 0.72rem 0.8rem;
  text-align: center;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #fff1b8);
}
.round-pill span {
  display: block;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.round-pill strong { display: block; margin-top: 0.18rem; font-size: 1.05rem; }
.status-panel,
.rules-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.75rem;
}
.status-panel div,
.rules-panel div {
  border-radius: 15px;
  padding: 0.72rem 0.45rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
}
.status-panel span,
.rules-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-panel strong,
.rules-panel strong {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.98rem;
}
.notice-panel {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem;
  color: var(--muted);
  background: rgba(85, 199, 255, 0.08);
}
.notice-panel strong { color: var(--ink); }
.notice-panel p { font-size: 0.86rem; line-height: 1.35; }
.board-card { padding: 0.85rem; }
.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}
.board-heading button {
  min-height: 2.35rem;
  border: 0;
  border-radius: 13px;
  padding: 0 0.95rem;
  color: #09111f;
  background: var(--gold);
  font-weight: 950;
}
.simon-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  width: min(100%, 300px);
  margin: 0 auto;
  padding: 0.45rem;
}
.pad {
  min-height: 126px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 30px;
  box-shadow: inset 0 -12px 0 rgba(0,0,0,0.18), 0 14px 32px rgba(0,0,0,0.24);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}
.pad-green { background: linear-gradient(145deg, #72f4b4, #22b873); border-top-left-radius: 54px; }
.pad-gold { background: linear-gradient(145deg, #ffe58b, #f2ac25); border-top-right-radius: 54px; }
.pad-blue { background: linear-gradient(145deg, #7cddff, #1b91d0); border-bottom-left-radius: 54px; }
.pad-pink { background: linear-gradient(145deg, #ff98ba, #e4437c); border-bottom-right-radius: 54px; }
.pad.is-lit {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.35) saturate(1.12);
  box-shadow: inset 0 -7px 0 rgba(0,0,0,0.1), 0 0 28px rgba(255,255,255,0.25);
}
.pad.is-disabled { cursor: not-allowed; filter: saturate(0.82) brightness(0.88); }
.center-mark {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 8px solid var(--panel);
  border-radius: 50%;
  color: #09111f;
  background: #f7fbff;
  font-weight: 950;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 28px rgba(0,0,0,0.34);
}
.pad:focus-visible,
.board-heading button:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.55);
  outline-offset: 3px;
}

@media (max-height: 760px) {
  .game-shell { gap: 0.55rem; padding: 0.72rem; }
  .notice-panel { display: none; }
  h1 { font-size: 2rem; }
  .hero-panel { padding: 0.8rem; }
  .status-panel, .rules-panel, .board-card { padding: 0.6rem; }
  .pad { min-height: 104px; }
}