:root {
  --navy-950: #08131e;
  --navy-900: #102637;
  --navy-800: #173f4b;
  --spruce-700: #0d7b71;
  --spruce-600: #149487;
  --sage-200: #d9efe7;
  --sage-100: #edf8f4;
  --sun-400: #f4b444;
  --sun-300: #f8cc74;
  --sand-100: #fff7ea;
  --paper: rgba(255, 251, 245, 0.88);
  --paper-strong: rgba(255, 255, 255, 0.96);
  --ink: #18303e;
  --ink-soft: #58717a;
  --line: rgba(14, 40, 54, 0.1);
  --line-strong: rgba(14, 40, 54, 0.16);
  --success: #0f8c73;
  --danger: #d64045;
  --shadow-soft: 0 18px 34px rgba(8, 19, 30, 0.12);
  --shadow-strong: 0 28px 68px rgba(8, 19, 30, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

[hidden] {
  display: none !important;
}

body {
  position: relative;
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--ink);
  font-family: "Aptos", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(248, 204, 116, 0.34), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(20, 148, 135, 0.22), transparent 30%),
    radial-gradient(circle at 80% 82%, rgba(255, 255, 255, 0.18), transparent 26%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.035) 0 2px,
      transparent 2px 22px
    ),
    linear-gradient(140deg, #061019, #0a2431 34%, #104c52 68%, #c89530 140%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.5;
}

body::before {
  width: 300px;
  height: 300px;
  top: 8%;
  right: -80px;
  background: radial-gradient(circle, rgba(248, 204, 116, 0.22), transparent 70%);
}

body::after {
  width: 340px;
  height: 340px;
  left: -110px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(20, 148, 135, 0.22), transparent 72%);
}

h1,
h2,
.mode-title,
.question-title,
.finish-title,
.status-value,
.overview-value {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  letter-spacing: -0.02em;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(248, 204, 116, 0.72);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1140px, 100%);
  padding: clamp(20px, 4vw, 36px);
  border-radius: 34px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #0d7b71, #f4b444, #173f4b);
}

.app-shell::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 26px;
  border: 1px solid rgba(14, 40, 54, 0.06);
  pointer-events: none;
}

.app-shell[data-mode="memory"]::before {
  background: linear-gradient(90deg, #f4b444, #ffdb93, #173f4b);
}

.app-shell[data-mode="hunt"]::before {
  background: linear-gradient(90deg, #0d7b71, #bfe9dd, #f4b444);
}

.screen {
  position: relative;
  animation: rise-in 420ms ease;
}

.screen-start {
  display: grid;
  gap: 28px;
}

.hero {
  margin-bottom: 24px;
}

.hero-start {
  margin-bottom: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 22px;
  align-items: start;
}

.hero-panel,
.side-panel,
.memory-intro,
.scanner-card,
.question-card,
.finish-card {
  position: relative;
  padding: clamp(20px, 3vw, 28px);
  border-radius: 28px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-panel::before,
.side-panel::before,
.memory-intro::before,
.scanner-card::before,
.question-card::before,
.finish-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 22%);
  pointer-events: none;
}

.hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hero-head-stack {
  display: grid;
  gap: 10px;
}

.hero-copy {
  display: grid;
  gap: 10px;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.badge,
.hero-chip,
.mode-kicker,
.meta-pill,
.info-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badge {
  margin: 0;
  color: #0b4039;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(13, 123, 113, 0.18), rgba(13, 123, 113, 0.06));
}

.hero-chip {
  color: #1a4452;
  background: linear-gradient(135deg, rgba(244, 180, 68, 0.18), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(20, 148, 135, 0.12);
}

.hero-chip-soft {
  background: linear-gradient(135deg, rgba(23, 63, 75, 0.08), rgba(255, 255, 255, 0.72));
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.04;
  max-width: 14ch;
}

.subtitle {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.7;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.overview-card {
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(237, 248, 244, 0.74));
  border: 1px solid rgba(13, 123, 113, 0.08);
}

.overview-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.overview-text {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.panel-kicker {
  display: inline-block;
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.6;
  color: #214a56;
  background: linear-gradient(135deg, rgba(244, 180, 68, 0.18), rgba(244, 180, 68, 0.08));
}

.panel-note-dark {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.step-list {
  display: grid;
  gap: 14px;
}

.step-list-compact {
  gap: 12px;
}

.step-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.step-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.step-item p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.side-panel .step-item p {
  color: rgba(255, 255, 255, 0.78);
}

.step-number {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--spruce-600), var(--navy-800));
  box-shadow: 0 10px 18px rgba(8, 19, 30, 0.18);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-height: 296px;
  padding: 28px;
  border: 1px solid transparent;
  border-radius: 30px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.mode-card::before {
  content: "";
  position: absolute;
  inset: auto -30px -60px auto;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  opacity: 0.22;
}

.mode-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-strong);
  filter: brightness(1.02);
}

.mode-card-hunt {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(135deg, #eefaf5, #d8eee6 48%, #bfe5d9);
  border-color: rgba(13, 123, 113, 0.1);
}

.mode-card-hunt::before {
  background: radial-gradient(circle, rgba(13, 123, 113, 0.8), transparent 70%);
}

.mode-card-memory {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.4), transparent 34%),
    linear-gradient(135deg, #fff7e7, #fce7bb 54%, #f4c96e);
  border-color: rgba(244, 180, 68, 0.16);
}

.mode-card-memory::before {
  background: radial-gradient(circle, rgba(244, 180, 68, 0.78), transparent 70%);
}

.mode-kicker {
  color: #163f4c;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(23, 63, 75, 0.08);
}

.mode-title {
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  line-height: 1.02;
}

.mode-text {
  max-width: 31ch;
  color: rgba(24, 48, 62, 0.82);
  line-height: 1.65;
}

.mode-meta,
.memory-tags,
.finish-meta,
.hero-info-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  color: #244452;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(23, 63, 75, 0.08);
}

.mode-cta {
  margin-top: auto;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #153d49;
}

.screen-game {
  display: grid;
  gap: 18px;
}

.hero-compact {
  margin-bottom: 0;
}

.hero-info-strip {
  margin-top: 18px;
}

.info-pill {
  color: #294652;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 63, 75, 0.08);
}

.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
}

.status-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 249, 246, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.status-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--spruce-600), var(--sun-400));
}

.status-label {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.7rem, 2.6vw, 2.25rem);
  line-height: 1;
}

.ghost-btn,
.restart-btn {
  min-height: 56px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.ghost-btn:hover,
.restart-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.ghost-btn:active,
.restart-btn:active {
  transform: translateY(0);
}

.restart-btn {
  border: 1px solid rgba(0, 0, 0, 0.02);
  color: #ffffff;
  background: linear-gradient(135deg, var(--spruce-700), var(--spruce-600));
  box-shadow: 0 16px 24px rgba(13, 123, 113, 0.26);
}

.ghost-btn {
  color: #163f4c;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(23, 63, 75, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.game-panel {
  min-height: 360px;
}

.hunt-shell {
  max-width: 760px;
  margin: 0 auto;
}

.hunt-stage-card {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 246, 0.94));
  border: 1px solid rgba(13, 123, 113, 0.1);
  box-shadow: var(--shadow-soft);
}

.hunt-stage-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 22%);
  pointer-events: none;
}

.hunt-intro-card {
  background:
    radial-gradient(circle at top right, rgba(244, 180, 68, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 246, 0.94));
}

.scanner-stage-card,
.question-stage-card,
.hunt-success-card {
  display: grid;
  gap: 18px;
}

.hunt-stage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hunt-stage-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #163f4c;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(23, 63, 75, 0.1);
}

.hunt-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.hunt-feature-card {
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(237, 248, 244, 0.8));
  border: 1px solid rgba(13, 123, 113, 0.08);
}

.scanner-description {
  margin: 0;
  max-width: 42ch;
  color: var(--ink-soft);
  line-height: 1.65;
}

.question-stage-card .progress-shell {
  margin-top: 4px;
}

.hunt-inline-message {
  margin: 2px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  font-weight: 800;
  line-height: 1.6;
  border: 1px solid transparent;
  color: #3a5660;
  background: rgba(237, 243, 245, 0.9);
}

.hunt-inline-message.is-success {
  color: var(--success);
  border-color: rgba(15, 140, 115, 0.18);
  background: rgba(236, 251, 246, 0.92);
}

.hunt-inline-message.is-error {
  color: var(--danger);
  border-color: rgba(214, 64, 69, 0.16);
  background: rgba(255, 244, 244, 0.95);
}

.hunt-success-card {
  text-align: center;
  background:
    radial-gradient(circle at top center, rgba(20, 148, 135, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 246, 0.94));
}

.success-burst {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 2.3rem;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--spruce-700), var(--spruce-600));
  box-shadow: 0 20px 34px rgba(13, 123, 113, 0.22);
}

.app-shell[data-mode="hunt"] .status-row {
  max-width: 760px;
  margin: 0 auto;
}

.app-shell[data-mode="hunt"] .status-card {
  background: linear-gradient(180deg, rgba(9, 23, 34, 0.96), rgba(16, 38, 55, 0.92));
  border-color: rgba(255, 255, 255, 0.08);
}

.app-shell[data-mode="hunt"] .status-card::before {
  background: linear-gradient(90deg, var(--sun-400), var(--spruce-600));
}

.app-shell[data-mode="hunt"] .status-label {
  color: rgba(255, 255, 255, 0.72);
}

.app-shell[data-mode="hunt"] .status-value {
  color: white;
}

.hunt-layout,
.question-layout,
.memory-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(270px, 0.78fr);
  gap: 20px;
  align-items: start;
}

.hunt-view {
  animation: rise-in 240ms ease;
}

.side-panel {
  color: white;
  background: linear-gradient(180deg, rgba(9, 23, 34, 0.95), rgba(16, 38, 55, 0.92));
  border-color: rgba(255, 255, 255, 0.08);
}

.side-panel-accent {
  background:
    radial-gradient(circle at top right, rgba(244, 180, 68, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(9, 23, 34, 0.96), rgba(16, 38, 55, 0.94));
}

.side-panel-soft {
  background:
    radial-gradient(circle at top right, rgba(20, 148, 135, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(9, 23, 34, 0.92), rgba(16, 38, 55, 0.9));
}

.side-panel .panel-kicker,
.side-panel .panel-note,
.side-copy {
  color: rgba(255, 255, 255, 0.85);
}

.scanner-preview {
  position: relative;
  min-height: min(60vw, 420px);
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(145deg, #0a2833, #11625a);
}

.scanner-video {
  width: 100%;
  height: 100%;
  min-height: min(60vw, 420px);
  object-fit: cover;
  display: block;
}

.scanner-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.scanner-frame::before {
  content: "";
  width: min(58vw, 268px);
  height: min(58vw, 268px);
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: 0 0 0 999px rgba(8, 19, 30, 0.28);
}

.scanner-frame::after {
  content: "";
  position: absolute;
  width: min(52vw, 248px);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.92), transparent);
  animation: scanner-sweep 2.2s ease-in-out infinite;
}

.scanner-frame span {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #123640;
  background: rgba(255, 255, 255, 0.9);
}

.scanner-actions,
.manual-row,
.finish-actions,
.question-meta,
.progress-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.scanner-actions > *,
.manual-row > *,
.finish-actions > * {
  flex: 1 1 190px;
}

.scanner-actions {
  margin-top: 18px;
}

.scanner-status {
  margin: 16px 0 0;
  font-weight: 800;
  color: #34505c;
}

.scanner-status.is-success {
  color: var(--success);
}

.scanner-status.is-error {
  color: var(--danger);
}

.manual-form {
  margin-top: 18px;
}

.manual-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-weight: 800;
}

.manual-input {
  flex: 1 1 220px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.side-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.side-stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-stat span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.side-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.side-copy {
  margin: 0;
  line-height: 1.7;
}

.side-note-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.side-note-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.progress-shell {
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(237, 248, 244, 0.84), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(13, 123, 113, 0.08);
}

.progress-label-row {
  justify-content: space-between;
}

.progress-bar {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(13, 123, 113, 0.1);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--spruce-700), var(--sun-400));
  transition: width 220ms ease;
}

.question-meta {
  justify-content: space-between;
  margin-top: 18px;
}

.question-counter {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.question-title,
.finish-title {
  margin: 18px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.12;
}

.question-support {
  margin: 14px 0 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.answer-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.answer-btn {
  width: 100%;
  padding: 18px 18px;
  border: 1px solid rgba(23, 63, 75, 0.12);
  border-radius: 18px;
  text-align: left;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.answer-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.is-correct {
  color: white;
  border-color: rgba(15, 140, 115, 0.82);
  background: linear-gradient(135deg, #0f8c73, #18a487);
}

.answer-btn.is-wrong {
  color: white;
  border-color: rgba(214, 64, 69, 0.82);
  background: linear-gradient(135deg, #d64045, #ee595d);
}

.answer-btn.is-muted {
  opacity: 0.64;
}

.finish-card {
  text-align: center;
  background:
    radial-gradient(circle at top center, rgba(244, 180, 68, 0.16), transparent 34%),
    var(--paper-strong);
}

.finish-emblem {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 2.25rem;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--spruce-700), var(--sun-400));
  box-shadow: 0 20px 34px rgba(13, 123, 113, 0.22);
}

.finish-score {
  margin: 14px auto 0;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.7;
}

.finish-meta {
  justify-content: center;
  margin-top: 20px;
}

.finish-actions {
  justify-content: center;
  margin-top: 24px;
}

.memory-intro {
  background:
    radial-gradient(circle at top right, rgba(244, 180, 68, 0.14), transparent 30%),
    var(--paper-strong);
}

.memory-copy {
  margin: 14px 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.memory-tags {
  margin-top: 18px;
}

.memory-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(237, 248, 244, 0.68));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.memory-card {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  perspective: 900px;
  transition: transform 180ms ease;
}

.memory-card:hover {
  transform: translateY(-4px);
}

.memory-card:disabled {
  cursor: default;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 340ms ease;
}

.memory-card.is-revealed .memory-card-inner,
.memory-card.is-matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-face {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: var(--shadow-soft);
}

.memory-front {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(13, 123, 113, 0.08);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(145deg, #0f7b71, #194756);
  color: white;
}

.memory-front-mark {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(2.5rem, 5vw, 3.4rem);
  line-height: 1;
}

.memory-front-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
}

.memory-back {
  transform: rotateY(180deg);
  background: #dce3ea;
}

.memory-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.memory-card.is-matched .memory-face {
  box-shadow: 0 0 0 3px rgba(15, 140, 115, 0.72), var(--shadow-strong);
}

.feedback {
  margin: 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.feedback.is-neutral {
  color: #3a5660;
}

.feedback.is-success {
  color: var(--success);
  border-color: rgba(15, 140, 115, 0.18);
  background: rgba(236, 251, 246, 0.9);
}

.feedback.is-error {
  color: var(--danger);
  border-color: rgba(214, 64, 69, 0.16);
  background: rgba(255, 244, 244, 0.94);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scanner-sweep {
  0%,
  100% {
    transform: translateY(-90px);
    opacity: 0.35;
  }
  50% {
    transform: translateY(90px);
    opacity: 0.95;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .hunt-layout,
  .question-layout,
  .memory-shell {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .hunt-feature-grid {
    grid-template-columns: 1fr;
  }

  .status-row {
    grid-template-columns: 1fr 1fr;
  }

  .restart-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body {
    padding: 14px;
  }

  .app-shell {
    padding: 18px;
    border-radius: 24px;
  }

  .hero-panel,
  .side-panel,
  .memory-intro,
  .scanner-card,
  .question-card,
  .finish-card,
  .hunt-stage-card {
    padding: 18px;
    border-radius: 22px;
  }

  h1 {
    max-width: 16ch;
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .hero-head {
    flex-direction: column;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 250px;
    padding: 22px;
  }

  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    gap: 12px;
  }

  .manual-row,
  .finish-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hunt-stage-header {
    align-items: flex-start;
  }

  .side-stat-grid {
    grid-template-columns: 1fr;
  }

  .scanner-preview,
  .scanner-video {
    min-height: 300px;
  }

  .feedback {
    padding: 12px 14px;
    min-height: 48px;
    font-size: 0.96rem;
  }
}

@media (max-width: 520px) {
  .status-row {
    grid-template-columns: 1fr;
  }

  .hunt-stage-header {
    flex-direction: column;
  }

  .hero-info-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .scanner-preview,
  .scanner-video {
    min-height: 260px;
  }

  .scanner-frame span {
    width: calc(100% - 28px);
    text-align: center;
    font-size: 0.82rem;
  }
}

@media (max-width: 420px) {
  .memory-grid {
    grid-template-columns: 1fr;
  }
}
