:root {
  color-scheme: dark;
  --page: #050912;
  --page-deep: #02050a;
  --surface: #0b1420;
  --surface-raised: #101d2b;
  --ink: #f4efe3;
  --muted: #a8b8c4;
  --dim: #718593;
  --line: rgb(115 224 235 / 22%);
  --line-strong: rgb(115 224 235 / 48%);
  --cyan: #73e0eb;
  --cyan-bright: #b2f7fb;
  --cyan-deep: #123842;
  --warning: #ffd49a;
  --warning-soft: #2c2115;
  --focus: #fff2a8;
  --shadow: 0 28px 80px rgb(0 0 0 / 38%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-deep);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgb(115 224 235 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(115 224 235 / 3%) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, #173245 0, var(--page) 46rem);
  background-size: 3.5rem 3.5rem, 3.5rem 3.5rem, auto;
}

button,
input,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin-block-start: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h1 {
  margin-block-end: 0;
  font-size: clamp(2.15rem, 10vw, 4rem);
}

h2 {
  font-size: 1.45rem;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.35rem;
  background: var(--focus);
  color: #071018;
  font-weight: 800;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgb(4 9 17 / 88%);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-lockup,
.wordmark {
  display: inline-flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 0.8rem;
}

.brand-logo-slot {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
}

.wordmark {
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-title {
  color: #e6fcff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px rgb(115 224 235 / 28%);
  white-space: nowrap;
}

.wordmark-tag,
.game-mode,
.eyebrow,
.hud-kicker {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wordmark-tag {
  color: var(--cyan-bright);
}

.game-mode {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.game-mode span {
  color: var(--cyan);
  font-size: 0.58rem;
}

.info-button,
.footer-info-button,
.info-close-button {
  min-height: 2.75rem;
  border: 1px solid var(--line-strong);
  background: rgb(5 12 20 / 70%);
  color: var(--cyan-bright);
  cursor: pointer;
}

.info-button {
  width: 2.75rem;
  flex: 0 0 auto;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
}

.info-button:hover,
.footer-info-button:hover,
.info-close-button:hover {
  border-color: var(--cyan);
  background: var(--cyan-deep);
}

main {
  flex: 1;
  padding-block: clamp(2rem, 7vw, 5.5rem);
}

.state-card,
.game-card,
.stats-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: linear-gradient(145deg, rgb(16 29 43 / 96%), rgb(8 16 27 / 98%));
  box-shadow: var(--shadow);
}

.state-card::before,
.game-card::before,
.stats-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 1.5rem;
  width: 4rem;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgb(115 224 235 / 55%);
}

.state-card {
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 6vw, 3.5rem);
}

.state-card > :last-child,
.result-panel > :last-child {
  margin-block-end: 0;
}

.state-card p:not(.eyebrow),
.result-panel p:not(.eyebrow) {
  color: var(--muted);
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.loading-state h1 {
  margin-block-end: 0.25rem;
  font-size: 1.2rem;
}

.loading-state p {
  margin: 0;
}

.loading-mark {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 2px solid var(--cyan-deep);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.game-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.game-layout > .game-column,
.game-layout > .state-card {
  order: 1;
}

.game-layout > .ad-slot {
  order: 2;
}

.game-layout > .stats-card {
  order: 3;
}

.game-card,
.stats-card {
  padding: clamp(1.25rem, 5vw, 2.6rem);
}

.game-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-block-end: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.game-identity {
  min-width: 0;
}

.hud-kicker {
  margin-block-end: 1rem;
  color: var(--cyan);
  font-size: 0.62rem;
}

.eyebrow {
  margin-block-end: 0.45rem;
}

.game-identity h1 {
  color: #e6fcff;
  text-shadow: 0 0 24px rgb(115 224 235 / 28%);
  white-space: nowrap;
}

.score-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 0.55rem;
  background: rgb(4 12 20 / 78%);
  box-shadow: inset 0 0 24px rgb(115 224 235 / 4%);
}

.score-card > div {
  min-width: 0;
  padding: 0.8rem 0.7rem;
}

.score-card > div + div {
  border-left: 1px solid var(--line);
}

.score-card dt {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgb(115 224 235 / 24%);
}

.score-card dd {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1rem, 5vw, 1.3rem);
  font-weight: 800;
  line-height: 1.15;
}

#stage-label {
  white-space: nowrap;
}

.score-unit {
  color: var(--cyan);
  font-size: 0.72rem;
}

.clue-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.75rem 0;
  padding: 0;
  list-style: none;
}

.clue {
  min-height: 4.5rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  border-radius: 0.45rem;
  background: linear-gradient(100deg, rgb(18 56 66 / 25%), rgb(11 20 32 / 65%) 60%);
  color: var(--ink);
  font-size: clamp(1rem, 3vw, 1.12rem);
  font-weight: 650;
}

.clue__label {
  display: block;
  margin-block-end: 0.45rem;
  color: var(--cyan-bright);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-shadow: 0 0 10px rgb(115 224 235 / 24%);
  text-transform: uppercase;
}

.clue p {
  margin: 0;
}

.game-actions {
  display: grid;
  gap: 0.75rem;
}

.button,
.answer-option,
.intro-skip {
  min-height: 3rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-weight: 750;
}

.button {
  width: 100%;
  padding: 0.78rem 1rem;
  border: 1px solid transparent;
}

.button-primary {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #061219;
}

.button-primary:hover {
  border-color: var(--cyan-bright);
  background: var(--cyan-bright);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgb(7 17 27 / 78%);
  color: var(--ink);
}

.button-secondary:hover,
.answer-option:hover {
  border-color: var(--cyan);
  background: var(--cyan-deep);
}

.button:disabled,
.answer-option:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button:focus-visible,
.answer-option:focus-visible,
.wordmark:focus-visible,
.intro-skip:focus-visible,
.info-button:focus-visible,
.footer-info-button:focus-visible,
.info-close-button:focus-visible,
.info-dialog-body a:focus-visible,
#manual-share-text:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.answer-panel {
  margin: 1.75rem 0 0;
  padding: 1.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.answer-panel legend {
  float: left;
  width: 100%;
  margin-block-end: 0.15rem;
  padding: 0;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
}

.answer-note {
  clear: both;
  margin-block-end: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.answer-options {
  display: grid;
  gap: 0.7rem;
}

.answer-option {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgb(168 184 196 / 28%);
  background: rgb(16 29 43 / 82%);
  color: var(--ink);
  text-align: left;
}

.result-panel {
  margin-block-start: 1.75rem;
  padding: 1.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.55rem;
  background: linear-gradient(135deg, rgb(18 56 66 / 62%), rgb(8 20 31 / 86%));
  box-shadow: inset 0 0 28px rgb(115 224 235 / 5%);
}

.result-panel h2 {
  margin-block-end: 0.45rem;
  color: var(--cyan-bright);
}

.result-panel:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.share-actions {
  margin-block-start: 1.25rem;
}

.share-buttons {
  display: grid;
  gap: 0.7rem;
}

.share-feedback {
  min-height: 1.5em;
  margin: 0.65rem 0 0;
  color: var(--cyan-bright) !important;
  font-size: 0.86rem;
}

.manual-share-panel {
  margin-block-start: 1rem;
}

.manual-share-panel label {
  display: block;
  margin-block-end: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

#manual-share-text {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  padding: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  background: var(--page-deep);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.stats-card h2 {
  margin-block-end: 1.35rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 0.8rem;
  margin: 0;
}

.stats-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stats-grid dd {
  order: 1;
  margin: 0;
  color: var(--cyan-bright);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.stats-grid dt {
  order: 2;
  margin-block-start: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.distribution {
  margin-block-start: 1.9rem;
  padding-block-start: 1.5rem;
  border-top: 1px solid var(--line);
}

.distribution h3 {
  margin-block-end: 1rem;
  font-size: 1rem;
}

.distribution-list {
  display: grid;
  gap: 0.7rem;
}

.distribution-row {
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1fr) min-content;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
}

.distribution-label,
.distribution-value {
  color: var(--muted);
  font-weight: 750;
}

.distribution-track {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(168 184 196 / 16%);
}

.distribution-bar {
  display: block;
  width: var(--distribution-width, 0%);
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
  box-shadow: 0 0 10px rgb(115 224 235 / 40%);
}

.storage-warning {
  max-width: 72rem;
  margin: 1rem auto 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgb(255 212 154 / 35%);
  border-radius: 0.45rem;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.9rem;
}

.storage-warning strong,
.storage-warning span {
  display: block;
}

.ad-slot {
  min-height: 5.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(168 184 196 / 15%);
  border-radius: 0.4rem;
  background: rgb(5 11 18 / 45%);
  color: var(--dim);
}

.ad-slot span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-footer {
  padding-block: 1.75rem;
  border-top: 1px solid rgb(115 224 235 / 10%);
  color: var(--dim);
  font-size: 0.8rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1.25rem;
  flex-wrap: wrap;
}

.footer-info-button {
  padding: 0.55rem 0.8rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
}

.info-dialog {
  width: min(calc(100% - 1.5rem), 46rem);
  max-width: none;
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 0.8rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 32px 90px rgb(0 0 0 / 65%);
}

.info-dialog::backdrop {
  background: rgb(2 5 10 / 82%);
  backdrop-filter: blur(5px);
}

.info-dialog-panel {
  display: flex;
  max-height: calc(100dvh - 1.5rem);
  flex-direction: column;
}

.info-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}

.info-dialog-header .eyebrow {
  margin-block-end: 0.35rem;
}

.info-dialog-header h2 {
  margin: 0;
  color: var(--cyan-bright);
}

.info-close-button {
  flex: 0 0 auto;
  padding: 0.55rem 0.8rem;
  border-radius: 0.35rem;
  font-weight: 750;
}

.info-dialog-body {
  padding: clamp(1.25rem, 5vw, 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.info-dialog-body section + section {
  margin-block-start: 2rem;
  padding-block-start: 2rem;
  border-top: 1px solid var(--line);
}

.info-dialog-body h3 {
  margin-block-end: 1.1rem;
  color: var(--cyan);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.info-faq-list {
  display: grid;
  gap: 1.25rem;
}

.info-faq-list h4 {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-size: 0.98rem;
}

.info-dialog-body p {
  margin-block-end: 0;
  color: var(--muted);
}

.info-dialog-body a {
  color: var(--cyan-bright);
  text-underline-offset: 0.18em;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.social-links a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  background: rgb(5 12 20 / 70%);
  font-weight: 750;
  text-decoration: none;
}

.social-links a:hover {
  border-color: var(--cyan);
  background: var(--cyan-deep);
}

.info-legal p + p {
  margin-block-start: 1rem;
}

.info-legal strong {
  color: var(--ink);
}

.angela-intro {
  position: fixed;
  z-index: 80;
  inset: 0;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #091929;
  opacity: 0;
}

.angela-intro::before {
  content: "";
  position: absolute;
  inset: -2rem;
  background:
    linear-gradient(rgb(4 12 24 / 42%), rgb(4 12 24 / 62%)),
    url("../assets/angela-final.png") center / cover no-repeat;
  filter: blur(24px) saturate(0.85);
  opacity: 0.78;
  transform: scale(1.08);
}

.angela-intro.is-active {
  display: grid;
  opacity: 1;
  animation: intro-arrive 500ms ease-out both;
}

.angela-intro.is-active .angela-intro-visual {
  animation: intro-visual-arrive 650ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.angela-intro.is-leaving {
  display: grid;
  opacity: 1;
  pointer-events: none;
  animation: intro-leave var(--intro-exit-duration, 900ms) ease-in-out both;
}

.angela-intro-visual {
  position: relative;
  z-index: 1;
  width: min(100vw, 42rem, calc(90dvh * 0.86));
  aspect-ratio: 633 / 736;
}

.angela-intro-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 1.5rem 2.5rem rgb(0 0 0 / 45%));
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-composite: intersect;
}

.angela-intro-hud {
  position: absolute;
  z-index: 1;
  top: 41.5%;
  right: 25%;
  left: 25%;
  display: grid;
  align-content: center;
  min-height: 5.5%;
  color: var(--cyan-bright);
  text-align: center;
}

.angela-intro-title {
  margin-block-end: clamp(0.1rem, 0.6vw, 0.35rem);
  color: #07556b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.68rem, 1.8vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgb(255 255 255 / 70%);
  text-transform: uppercase;
  white-space: nowrap;
}

.angela-intro-readout {
  display: flex;
  justify-content: center;
  gap: clamp(0.45rem, 2vw, 0.9rem);
  margin: 0;
  padding: 0.16rem 0.45rem;
  border: 1px solid rgb(178 247 251 / 30%);
  border-radius: 999px;
  background: rgb(4 10 23 / 56%);
  box-shadow: 0 0 14px rgb(115 224 235 / 18%);
}

.angela-intro-readout > div {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.angela-intro-readout dt {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.625rem, 1.35vw, 0.66rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.angela-intro-readout dd {
  margin: 0;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.75rem, 2vw, 0.88rem);
  font-weight: 800;
  line-height: 1;
}

.intro-skip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line-strong);
  background: rgb(5 12 20 / 88%);
  color: var(--ink);
  z-index: 2;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes intro-arrive {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes intro-visual-arrive {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-leave {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@media (max-width: 35.99rem) {
  .game-mode {
    display: none;
  }
}

@media (min-width: 36rem) {
  .page-shell {
    width: min(100% - 3rem, 72rem);
  }

  .game-actions,
  .answer-options,
  .share-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 48rem) {
  .game-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .score-card {
    min-width: 20rem;
  }
}

@media (min-width: 56rem) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: 1.5rem;
  }

  .game-layout > .game-column,
  .game-layout > .state-card {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .game-layout > .stats-card {
    grid-column: 2;
    grid-row: 1;
  }

  .game-layout > .ad-slot {
    grid-column: 2;
    grid-row: 2;
  }
}

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