:root {
  --bg: #090b10;
  --panel: #121722;
  --panel-strong: #171e2b;
  --text: #f7f8fb;
  --muted: #9aa5b5;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #73f2a7;
  --accent-strong: #43dc83;
  --danger: #ff767d;
  --radius-lg: 26px;
  --radius-md: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -15%, rgba(115, 242, 167, 0.12), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}


.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.brand {
  text-align: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.brand h1 span {
  color: var(--accent);
}

.byline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.byline a {
  color: var(--text);
  font-weight: 700;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
}

.screen {
  display: none;
}

.screen--active {
  display: block;
}

.hero-card,
.game-card,
.results-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 30, 43, 0.98), rgba(15, 20, 29, 0.98));
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

.hero-card,
.results-card {
  padding: 30px 22px;
  text-align: center;
}

.hero-question {
  margin: 0;
  font-size: clamp(1.7rem, 7vw, 2.25rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.hero-question strong {
  color: var(--accent);
}

.hero-subtext {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 1rem;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 54px;
  border-radius: 15px;
  border: 0;
  font-weight: 900;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: transform 110ms ease, filter 110ms ease, background-color 110ms ease;
}

.primary-button {
  background: var(--accent);
  color: #06130b;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.primary-button:active,
.secondary-button:active,
.cell:active {
  transform: scale(0.98);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.cell:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(115, 242, 167, 0.55);
  outline-offset: 3px;
}

.best-line {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.best-line strong {
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 12px;
}

.stat-card {
  min-width: 0;
  padding: 12px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.stat-value {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.55rem, 7vw, 2rem);
  line-height: 1;
}

.stat-card--time .stat-value {
  color: var(--accent);
}

.game-card {
  padding: 15px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: clamp(2.45rem, 16vw, 4.25rem);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 90ms ease, border-color 90ms ease, background-color 90ms ease;
}

.cell:hover {
  background: rgba(255, 255, 255, 0.075);
}

.cell--correct {
  border-color: rgba(115, 242, 167, 0.8);
  background: rgba(115, 242, 167, 0.16);
  color: var(--accent);
}

.cell--wrong {
  border-color: rgba(255, 118, 125, 0.8);
  background: rgba(255, 118, 125, 0.12);
  animation: nudge 120ms ease;
}

.cell:disabled {
  cursor: default;
}

.board-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 3px 1px;
}

.misses,
.prompt {
  margin: 0;
  font-size: 0.9rem;
}

.misses {
  color: var(--muted);
}

.misses strong {
  color: var(--text);
}

.prompt {
  color: var(--accent);
  font-weight: 800;
}

.results-card h2 {
  margin: 0;
  font-size: clamp(1.75rem, 7vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.results-card h2 span {
  color: var(--accent);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 24px 0;
}

.result-grid > div {
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.result-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 1.65rem;
}

.result-actions {
  display: grid;
  gap: 10px;
}

.share-status {
  min-height: 1.25em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.results-queulydoor {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  transition: transform 110ms ease, background-color 110ms ease, border-color 110ms ease;
}

.results-queulydoor:hover {
  border-color: rgba(115, 242, 167, 0.28);
  background: rgba(255, 255, 255, 0.055);
}

.results-queulydoor:active {
  transform: scale(0.99);
}

.results-queulydoor-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.results-queulydoor strong {
  font-size: 0.95rem;
  line-height: 1.3;
}

.results-queulydoor-cta {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}


.game-info {
  margin-top: 24px;
  padding: 22px 4px 4px;
  color: var(--muted);
}

.game-info[hidden] {
  display: none;
}

.game-info h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.game-info p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.game-info ol {
  margin: 12px 0;
  padding-left: 1.3rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.game-info li + li {
  margin-top: 5px;
}

.game-info strong {
  color: var(--text);
}

.game-info-note {
  font-size: 0.84rem !important;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
}

@media (min-width: 600px) {
  .app-shell {
    padding-left: 24px;
    padding-right: 24px;
    justify-content: center;
  }

  .brand {
    margin-bottom: 22px;
  }

}

@media (max-height: 700px) {
  .app-shell {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .brand h1 {
    font-size: 1.9rem;
  }

  .byline {
    margin-top: 6px;
  }

  .stats {
    margin-bottom: 9px;
  }

  .game-card {
    padding: 12px;
  }

  .board {
    gap: 8px;
  }

  .board-meta {
    padding-top: 10px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
