:root {
  --bg-1: #080b11;
  --bg-2: #11151d;
  --ink: #f4f1ea;
  --panel: rgba(16, 18, 23, 0.88);
  --card: rgba(27, 29, 35, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --accent: #d12a2a;
  --accent-2: #f5c84c;
  --warn: #7a0f16;
  --chip: linear-gradient(90deg, #c91f26, #ea3a31);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --radius: 28px;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 400;
  color: var(--ink);
}

html {
  font-size: 15px;
}

body {
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 400;
}

html.game-booting body {
  overflow: hidden;
}

.intro-title,
.card-footer-title,
.decision-banner-label,
.unlock-banner-text,
.response-text,
.turn-chip-footer,
.adviser-chip,
.settings-panel-head strong,
.audio-control-label,
.stat-value,
.ending-stage h2,
#restartButton,
.response-kicker,
.intro-kicker,
.decision-banner-side,
.unlock-banner-kicker,
.intro-hint {
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(6, 8, 12, 0.38), rgba(6, 8, 12, 0.82)),
    url("../assets/background.jpg") center center / cover no-repeat fixed,
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  overflow: hidden;
  cursor: default;
  caret-color: transparent;
}

.debug-console {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 60;
  width: min(360px, 28vw);
  max-height: calc(100vh - 40px);
  padding: 12px 12px 10px;
  border-radius: 20px;
  background: rgba(7, 9, 13, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.debug-console.hidden {
  display: none;
}

.debug-console-head {
  margin-bottom: 8px;
  color: rgba(245, 200, 76, 0.9);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.debug-console-body {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding-right: 4px;
}

.debug-console-line {
  color: rgba(244, 241, 234, 0.92);
  font-family: Consolas, "SFMono-Regular", Monaco, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

@media (max-width: 1279px) {
  .debug-console {
    display: none !important;
  }
}

button { font: inherit; }
input,
textarea,
select {
  caret-color: auto;
}
a,
button,
.specialization-option,
.settings-trigger,
.settings-close,
#restartButton {
  cursor: pointer;
}

.menu-screen {
  position: relative;
  min-height: 100%;
  display: grid;
  align-items: stretch;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(245, 200, 76, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(10, 11, 16, 0.88), rgba(8, 10, 14, 0.96));
}

.menu-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(209, 42, 42, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 20%);
  pointer-events: none;
}

.menu-screen.hidden {
  display: none;
}

.specialization-overlay {
  position: absolute;
  inset: 0;
  z-index: 31;
  display: grid;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at top, rgba(245, 200, 76, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(10, 11, 16, 0.88), rgba(8, 10, 14, 0.96));
}

.specialization-overlay.hidden {
  display: none;
}

.specialization-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(209, 42, 42, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 20%);
  pointer-events: none;
}

.specialization-overlay.is-entering .specialization-panel {
  animation: specialization-screen-in 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.specialization-overlay.is-entering .specialization-option {
  animation: specialization-option-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.specialization-overlay.is-entering .specialization-option:nth-child(1) { animation-delay: 40ms; }
.specialization-overlay.is-entering .specialization-option:nth-child(2) { animation-delay: 90ms; }
.specialization-overlay.is-entering .specialization-option:nth-child(3) { animation-delay: 140ms; }
.specialization-overlay.is-entering .specialization-option:nth-child(4) { animation-delay: 190ms; }
.specialization-overlay.is-entering .specialization-option:nth-child(5) { animation-delay: 240ms; }

.specialization-overlay.is-entering .specialization-confirm {
  animation: specialization-cta-in 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: 220ms;
}

.specialization-overlay.is-leaving .specialization-panel {
  animation: specialization-screen-out 420ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.specialization-overlay.is-leaving .specialization-option,
.specialization-overlay.is-leaving .specialization-confirm {
  animation: specialization-fade-out 240ms ease both;
}

.intro-panel {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-items: center;

  gap: 20px;
  padding: 24px 18px 20px 18px;
  text-align: center;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(17, 18, 24, 0.94), rgba(11, 12, 17, 0.98)),
    var(--panel);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), var(--shadow);
}

.intro-panel-menu {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  max-width: 100%;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  justify-items: center;
  align-content: stretch;
  padding: 50px 34px 24px;
  gap: clamp(14px, 2.8vh, 22px);
  overflow: hidden;
}

.specialization-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  justify-items: center;
  align-content: stretch;
  gap: clamp(14px, 2.8vh, 22px);
  padding: 50px 34px 24px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(17, 18, 24, 0.94), rgba(11, 12, 17, 0.98)),
    var(--panel);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), var(--shadow);
  text-align: center;
  overflow: hidden;
}

.specialization-kicker {
  margin: 0;
  color: var(--accent-2);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.specialization-title {
  margin: 0;
  width: 100%;
  max-width: 12ch;
  margin-inline: auto;
  font-size: clamp(2.2rem, 6.4vw, 3.25rem);
  line-height: 0.96;
  text-transform: uppercase;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
  text-wrap: balance;
}

.specialization-text {
  margin: 0 auto;
  width: 100%;
  max-width: 38ch;
  font-size: 1.3rem;
  line-height: 1.18;
  opacity: 0.92;
}

.specialization-options {
  display: grid;
  grid-template-columns: 1fr;
  width: min(100%, 420px);
  gap: 12px;
  align-self: center;
  align-content: start;
  min-height: 0;
  overflow: visible;
}

.specialization-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  min-height: 96px;
  padding: 14px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: var(--ink);
  position: relative;
  justify-items: stretch;
  text-align: left;
}

.specialization-option-none {
  grid-column: auto;
}

.specialization-option.active {
  border-color: rgba(240, 197, 79, 0.46);
  background:
    linear-gradient(180deg, rgba(240, 197, 79, 0.14), rgba(240, 197, 79, 0.06));
  box-shadow: 0 0 0 2px rgba(240, 197, 79, 0.12), 0 18px 32px rgba(0, 0, 0, 0.2);
}

.specialization-option,
.specialization-confirm,
.btn,
.settings-trigger,
#restartButton {
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease, background 150ms ease;
}

.specialization-option:hover {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  border-color: rgba(240, 197, 79, 0.3);
}

.specialization-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(240, 197, 79, 0.22), 0 14px 28px rgba(0, 0, 0, 0.22);
  border-color: rgba(240, 197, 79, 0.38);
}

.specialization-option-badge,
.specialization-option-title,
.specialization-confirm,
.specialization-option-info {
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.specialization-option-badge {
  color: var(--accent-2);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
}

.specialization-option-title {
  display: block;
  margin-top: 2px;
  font-size: 1.02rem;
}

.specialization-option-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  text-align: left;
}

.specialization-option-info-wrap {
  position: relative;
  align-self: center;
}

.specialization-option-info {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
}

.specialization-option-info:hover,
.specialization-option-info:focus-visible,
.specialization-option-info.is-open {
  background: rgba(245, 200, 76, 0.2);
  box-shadow: 0 0 0 1px rgba(245, 200, 76, 0.24);
  outline: none;
}

.specialization-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 3;
  width: min(240px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(12, 14, 20, 0.98);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
  font-size: 0.86rem;
  line-height: 1.24;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.specialization-option-info-wrap:hover .specialization-tooltip,
.specialization-option-info-wrap:focus-within .specialization-tooltip,
.specialization-option-info.is-open + .specialization-tooltip {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.specialization-confirm {
  justify-self: stretch;
  align-self: end;
  min-width: 0;
  width: 100%;
  min-height: 56px;
  padding: 15px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--chip);
  color: #fff;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.specialization-confirm:hover,
#restartButton:hover {
  filter: brightness(1.05);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.3);
}

.settings-inline-button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  min-height: 56px;
  padding: 15px 18px;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.settings-inline-button:hover {
  transform: translateY(-1px);
  background: rgba(245, 200, 76, 0.12);
  border-color: rgba(245, 200, 76, 0.28);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.intro-actions {
  display: flex;
  justify-content: stretch;
  align-self: end;
  margin-top: 0;
  width: 100%;
}

.intro-help-button {
  width: 100%;
  min-width: 0;
}

.intro-kicker {
  margin: 5px 0px 0px 0px;
  color: var(--accent-2);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.intro-title {
  margin: 0;
  width: 100%;
  max-width: 12ch;
  margin-inline: auto;
  padding: 0 15px 5px 15px;
  font-size: clamp(2.2rem, 6.4vw, 3.25rem);
  line-height: 0.96;
  text-transform: uppercase;
  text-wrap: balance;
}

.intro-text,
.intro-hint {
  margin: 0;
}

.intro-text {
  width: 100%;
  max-width: 38ch;
  justify-self: center;
  font-size: 1.3rem;
  line-height: 1.18;
  opacity: 0.92;
  text-wrap: pretty;
}

.intro-media-wrap {
  position: relative;
  width: 100%;
  align-self: center;
  display: grid;
  place-items: center;
  min-height: var(--shared-card-media-size);
  margin: 0;
}

.intro-art-card {
  width: min(100%, var(--shared-card-media-size));
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  touch-action: none;
  will-change: transform, opacity;
  transition: transform 180ms ease, opacity 180ms ease;
}

.intro-art-card.dragging {
  transition: none;
}

.intro-art-card.animating {
  transition: transform 220ms ease, opacity 220ms ease;
}

.intro-art {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(10, 11, 16, 0.18), rgba(10, 11, 16, 0.18)),
    url("../assets/card_back.png") center center / cover no-repeat;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.08);
}

.intro-hint {
  width: 100%;
  max-width: 32ch;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.72;
  margin-bottom: 0;
}

.app-shell {
  --shared-card-media-size: 320px;
  position: relative;
  width: min(100vw, 460px);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: 1fr;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(17, 18, 24, 0.9), rgba(11, 12, 17, 0.96)),
    var(--panel);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), var(--shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.boot-loader {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at top, rgba(245, 200, 76, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(8, 10, 14, 0.96), rgba(8, 10, 14, 0.985));
  transition: opacity 280ms ease, visibility 0s linear 280ms;
}

html.game-booting .boot-loader {
  opacity: 1;
  visibility: visible;
  transition: opacity 280ms ease, visibility 0s linear 0s;
}

.boot-loader-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(245, 200, 76, 0.96);
  border-right-color: rgba(209, 42, 42, 0.8);
  box-shadow: 0 0 0 8px rgba(10, 11, 16, 0.22);
  animation: request-loader-spin 620ms linear infinite;
}

html.game-booting #menuScreen,
html.game-booting #specializationOverlay,
html.game-booting #gameShell {
  visibility: hidden;
}

#menuScreen,
#specializationOverlay,
#gameShell {
  opacity: 1;
  transition: opacity 280ms ease;
}

html.game-booting #menuScreen,
html.game-booting #specializationOverlay,
html.game-booting #gameShell,
.app-shell.is-boot-fading #menuScreen,
.app-shell.is-boot-fading #specializationOverlay,
.app-shell.is-boot-fading #gameShell {
  opacity: 0;
}

.game-shell {
  height: 100%;
  min-height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.game-shell.hidden {
  display: none;
}

.topbar,
.bottombar {
  padding: 12px;
}

.topbar {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background:
    linear-gradient(180deg, rgba(10, 11, 15, 0.96), rgba(20, 22, 28, 0.92));
  border-bottom: 4px solid var(--accent);
}

.bottombar {
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--chip);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.footer-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.footer-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
  padding-left: 12px;
}

.specialization-chip {
  padding: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-self: start;
}

.inventory-slot {
  width: 60px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 7px 8px;
  background: linear-gradient(180deg, rgba(8, 11, 16, 0.72), rgba(16, 21, 28, 0.92));
  color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 16px rgba(0, 0, 0, 0.16);
  display: grid;
  grid-template-rows: 22px minmax(0, 1fr);
  place-items: center;
  align-content: center;
  gap: 2px;
  overflow: hidden;
  justify-self: end;
  transition: width 140ms ease, transform 140ms ease, filter 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.inventory-slot.is-active {
  width: 96px;
  background:
    radial-gradient(circle at top, rgba(245, 200, 76, 0.22), transparent 54%),
    linear-gradient(180deg, rgba(210, 42, 42, 0.96), rgba(131, 20, 27, 0.98));
  border-color: rgba(255, 223, 133, 0.78);
  color: #fff;
  animation: inventory-slot-pulse 1.4s ease-in-out infinite;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(255, 223, 133, 0.18),
    0 14px 28px rgba(0, 0, 0, 0.28),
    0 0 26px rgba(209, 42, 42, 0.26);
}

.inventory-slot.is-empty {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.96;
}

.inventory-slot:disabled {
  cursor: default;
}

.inventory-slot:not(:disabled):hover {
  filter: brightness(1.12) saturate(1.04);
  transform: translateY(-2px) scale(1.045);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 16px 30px rgba(0, 0, 0, 0.26),
    0 0 22px rgba(245, 200, 76, 0.22);
}

.inventory-slot-label {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.58rem;
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.92;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-slot.is-empty .inventory-slot-label {
  display: none;
}

.inventory-slot-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 1.08rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(255, 230, 152, 0.28);
}

.inventory-slot.is-empty .inventory-slot-icon {
  opacity: 0.62;
  text-shadow: none;
}

.inventory-slot-cta {
  display: none;
}

.inventory-slot-cta.is-visible {
  display: none;
}

.inventory-slot.feedback-get {
  animation: inventory-slot-get 560ms ease-out;
}

.inventory-slot.feedback-use {
  animation: inventory-slot-use 420ms ease-out;
}

.inventory-slot.feedback-pop {
  animation: inventory-slot-pop 220ms ease-out;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 8px 4px;
  display: grid;
  justify-items: center;
  gap: 5px;
  overflow: visible;
}

.stat:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(245, 200, 76, 0.24);
  border-color: rgba(245, 200, 76, 0.36);
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}

.stat-indicators {
  position: relative;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 14px;
  align-self: center;
  justify-self: center;
}

.stat-indicator {
  --indicator-size: 10px;
  --indicator-scale: 0.4;
  position: absolute;
  width: var(--indicator-size);
  height: var(--indicator-size);
  border-radius: 50%;
  transform: scale(var(--indicator-scale));
  opacity: 0;
  transition:
    width 180ms ease,
    height 180ms ease,
    transform 180ms ease,
    opacity 180ms ease,
    background-color 180ms ease;
  background: rgba(214, 219, 229, 0.78);
}

.stat-indicator.active {
  opacity: 1;
  --indicator-scale: 1;
}

.stat-indicator.small {
  --indicator-size: 6px;
}

.stat-indicator.medium {
  --indicator-size: 10px;
}

.stat-indicator.large {
  --indicator-size: 14px;
}

.stat-indicator.neutral { background: rgba(214, 219, 229, 0.78); }
.stat-indicator.positive { background: #1f9d55; }
.stat-indicator.negative { background: #d64545; }

.stat.impact-positive::after { animation: stat-impact-positive 420ms ease-out; }
.stat.impact-negative::after { animation: stat-impact-negative 420ms ease-out; }

.stat-ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(var(--accent) var(--progress, 0%), rgba(255, 255, 255, 0.1) 0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.stat.impact-positive .stat-ring,
.stat.impact-negative .stat-ring {
  animation: stat-ring-bump 380ms ease-out;
}

.stat-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(19, 20, 24, 0.98);
  display: grid;
  place-items: center;
  font-size: 1.18rem;
}

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

.stat-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% - 4px);
  z-index: 3;
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(12, 14, 20, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-size: 0.7rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: opacity 140ms ease, transform 140ms ease;
}

.stat:hover .stat-tooltip,
.stat:focus-visible .stat-tooltip,
.stat.is-tooltip-open .stat-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.stat-value {
  font-size: 0.96rem;
  font-weight: 700;
  min-height: 0.85rem;
}

.stat-value.hidden {
  display: block;
  min-height: 14px;
  height: 14px;
  opacity: 0;
  pointer-events: none;
}

.playfield {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
}

.card-stage {
  --unlock-banner-bottom: 88px;
  position: relative;
  display: grid;
  grid-template-rows: minmax(120px, 1fr) auto minmax(96px, 1fr);
  justify-items: stretch;
  align-items: stretch;
  min-height: 100%;
  height: 100%;
  min-height: 0;
  padding: 18px 14px;
}

.request-loader {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.request-loader.hidden {
  display: none;
}

.request-loader-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(245, 200, 76, 0.92);
  border-right-color: rgba(209, 42, 42, 0.76);
  box-shadow: 0 0 0 6px rgba(10, 11, 16, 0.18);
  opacity: 0.92;
  animation: request-loader-spin 620ms linear infinite;
}

.decision-banner {
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  z-index: 12;
  padding: 14px 16px;
  border-radius: 20px;
  color: #fff;
  text-align: center;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-50%) scale(0.96);
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}

.decision-banner.show {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.decision-banner.left { background: rgba(142, 47, 63, 0.94); }
.decision-banner.left {
  background: linear-gradient(180deg, rgba(130, 19, 27, 0.96), rgba(98, 8, 15, 0.96));
}

.decision-banner.right {
  background: linear-gradient(180deg, rgba(209, 42, 42, 0.98), rgba(162, 23, 28, 0.96));
}

.decision-banner-side {
  display: block;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.decision-banner-label {
  display: block;
  margin-top: 4px;
  font-size: 1.22rem;
}

.unlock-banner {
  position: absolute;
  bottom: var(--unlock-banner-bottom);
  left: 50%;
  z-index: 13;
  width: min(calc(100% - 24px), 420px);
  padding: 13px 16px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(240, 197, 79, 0.96), rgba(209, 122, 28, 0.94));
  color: #120f08;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, 10px) scale(0.94);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.unlock-banner.show {
  animation: unlock-banner-inout 2400ms ease forwards;
}

.unlock-banner.show.gold {
  animation:
    unlock-banner-inout 2400ms ease forwards,
    unlock-banner-glow-gold 1.15s ease-in-out 2;
}

.unlock-banner.show.orange {
  animation:
    unlock-banner-inout 2400ms ease forwards,
    unlock-banner-glow-orange 1.05s ease-in-out 2;
}

.unlock-banner.show.inverse {
  animation: unlock-banner-inout 2400ms ease forwards;
}

.unlock-banner.gold {
  background: linear-gradient(180deg, rgba(240, 197, 79, 0.96), rgba(209, 122, 28, 0.94));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 239, 181, 0.18),
    0 0 24px rgba(245, 200, 76, 0.18);
}

.unlock-banner.accent {
  background: linear-gradient(180deg, rgba(230, 64, 64, 0.98), rgba(169, 24, 31, 0.96));
  color: #fff;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 196, 196, 0.14),
    0 0 24px rgba(209, 46, 54, 0.18);
}

.unlock-banner.teal {
  background: linear-gradient(180deg, rgba(41, 218, 190, 0.98), rgba(18, 133, 146, 0.96));
  color: #f4fffd;
}

.unlock-banner.inverse {
  background:
    linear-gradient(180deg, rgba(22, 16, 18, 0.98), rgba(8, 8, 10, 0.98)),
    linear-gradient(135deg, rgba(214, 48, 56, 0.36), rgba(214, 48, 56, 0));
  border: 1px solid rgba(214, 48, 56, 0.42);
  color: #fff1f1;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(214, 48, 56, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.unlock-banner.orange {
  background: linear-gradient(180deg, rgba(176, 88, 24, 0.98), rgba(102, 43, 8, 0.96));
  color: #fff8ef;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 198, 125, 0.18),
    0 0 22px rgba(219, 112, 31, 0.16);
}

.unlock-banner-kicker {
  display: block;
  font-size: clamp(0.82rem, 2.6vw, 0.94rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.unlock-banner-text {
  display: block;
  margin-top: 4px;
  font-size: clamp(1rem, 3.6vw, 1.18rem);
  line-height: 1.24;
}

.game-card {
  --card-copy-height: 132px;
  --card-media-size: var(--shared-card-media-size);
  --card-footer-height: 72px;
  --card-copy-gap: 5px;
  --card-copy-padding-top: 2px;
  --card-copy-padding-bottom: 6px;
  --card-copy-padding-inline: 4px;
  --card-footer-gap: 2px;
  --card-footer-padding-top: 10px;
  --card-footer-padding-bottom: 2px;
  --card-footer-padding-inline: 4px;
  --card-title-size: clamp(1.28rem, 4vw, 1.72rem);
  --card-title-line-height: 1.02;
  --card-description-size: 1.48rem;
  --card-description-line-height: 1.5;
  --card-description-padding-inline: 4px;
  --card-media-padding-top: 0;
  --adviser-chip-margin-top: 2px;
  width: 100%;
  display: grid;
  grid-template-rows:
    minmax(var(--card-copy-height), 0.82fr)
    minmax(var(--card-media-size), 1.58fr)
    minmax(var(--card-footer-height), 0.5fr);
  grid-row: 1 / span 3;
  gap: 0;
  height: 100%;
  min-height: 100%;
  min-height: 0;
  align-content: stretch;
}

.card-body,
.card-footer {
  transition: opacity 180ms ease;
}

.card-body.fading,
.card-footer.fading {
  opacity: 0;
}

.game-card.response-mode .card-body,
.game-card.response-mode .card-footer {
  opacity: 0;
  pointer-events: none;
}

.card-body {
  grid-row: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--card-copy-gap);
  text-align: center;
  min-height: 0;
  height: 100%;
  padding:
    var(--card-copy-padding-top)
    var(--card-copy-padding-inline)
    var(--card-copy-padding-bottom);
  overflow: hidden;
}

.adviser-chip {
  justify-self: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: rgba(244, 241, 234, 0.68);
  font-size: clamp(0.82rem, 2.8vw, 0.96rem);
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-variation-settings: "wdth" 100, "wght" 600;
  text-wrap: balance;
}

.adviser-chip-footer {
  margin-top: var(--adviser-chip-margin-top);
}

.card-footer-title {
  margin: 0;
  font-size: var(--card-title-size);
  line-height: var(--card-title-line-height);
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}

.card-description {
  margin: 0;
  display: grid;
  align-content: center;
  padding: 0 var(--card-description-padding-inline);
  height: 100%;
  font-size: var(--card-description-size);
  line-height: var(--card-description-line-height);
  text-align: center;
}

.card-media {
  grid-row: 2;
  position: relative;
  width: min(100%, var(--card-media-size));
  max-width: var(--card-media-size);
  aspect-ratio: 1 / 1;
  justify-self: center;
  align-self: center;
  padding: var(--card-media-padding-top) 6px 0;
  perspective: 1400px;
}

.card-footer {
  grid-row: 3;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: var(--card-footer-gap);
  min-height: 0;
  height: 100%;
  padding:
    var(--card-footer-padding-top)
    var(--card-footer-padding-inline)
    var(--card-footer-padding-bottom);
}

.card-stack-shadow {
  position: absolute;
  inset: 8px 14px 0;
  z-index: 0;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.32);
  filter: blur(2px);
  transform: scale(0.96);
  opacity: 1;
  pointer-events: none;
}

.art-card {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.ghost-card {
  z-index: 1;
  transform: scale(0.92);
  opacity: 0.62;
  pointer-events: none;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.next-card {
  z-index: 2;
  transform: scale(0.96);
  opacity: 0.9;
  transition: transform 280ms ease, opacity 280ms ease;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.next-card.promote {
  transform: scale(1) rotateY(180deg);
  opacity: 1;
}

.next-card.animating {
  transition: transform 260ms cubic-bezier(0.22, 0.82, 0.2, 1);
}

.next-card.unlock-flash {
  animation: next-card-unlock 820ms ease;
}

.card-back {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(10, 11, 16, 0.22), rgba(10, 11, 16, 0.22)),
    url("../assets/card_back.png") center center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.active-art-card {
  z-index: 3;
  touch-action: none;
  will-change: transform, opacity;
  transition: transform 180ms ease, opacity 180ms ease;
}

.active-art-card.dragging {
  transition: none;
}

.active-art-card.animating {
  transition: transform 220ms ease, opacity 220ms ease;
}

.placeholder-art {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(36, 39, 46, 0.92), rgba(18, 20, 26, 0.98)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 16px, rgba(255, 255, 255, 0.01) 16px, rgba(255, 255, 255, 0.01) 32px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.art-fallback-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2rem, 12vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  z-index: 0;
}

.placeholder-art.has-image {
  background:
    linear-gradient(180deg, rgba(10, 11, 16, 0.18), rgba(10, 11, 16, 0.18)),
    center center / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.placeholder-art.response-active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(7, 9, 14, 0.58), rgba(7, 9, 14, 0.84));
  z-index: 1;
}

.response-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.response-overlay.hidden {
  display: none;
}

.response-overlay-inner {
  display: grid;
  gap: 12px;
  max-width: 48ch;
}

.response-kicker {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.response-text {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.32;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.36);
}

.turn-chip-footer {
  width: 100%;
  text-align: left;
  padding: 0;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1.08rem;
  text-shadow: 0 1px 0 rgba(0,0,0,0.22);
}

.settings-trigger,
.settings-close {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.confirm-actions .btn {
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.confirm-actions .btn.alt {
  background: var(--chip);
  color: #fff;
}

.confirm-actions .btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.08);
}

.settings-trigger {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(11, 13, 18, 0.26);
  color: #fff;
  font-size: 1.18rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.settings-trigger:hover {
  background: rgba(11, 13, 18, 0.38);
}

.loyalty-trigger {
  position: relative;
}

.loyalty-trigger.has-content {
  color: var(--accent-2);
}

.loyalty-trigger.is-complete {
  color: #d9ffe5;
  background:
    radial-gradient(circle at 30% 20%, rgba(132, 255, 177, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(19, 72, 42, 0.92), rgba(13, 47, 31, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px rgba(132, 255, 177, 0.26),
    0 0 24px rgba(82, 214, 129, 0.28);
}

.loyalty-trigger-notice {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(13, 15, 22, 0.9);
  animation: loyalty-notice-pulse 1.2s ease-in-out infinite;
}

.loyalty-trigger-notice.is-complete {
  background: linear-gradient(180deg, #44d67d, #1f9d55);
  color: #fff;
  animation: loyalty-complete-pulse 1.4s ease-in-out infinite;
}

.loyalty-panel-card {
  width: min(100%, 520px);
}

.loyalty-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.loyalty-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.07);
}

.loyalty-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f5c84c, #d12a2a);
  transition: width 180ms ease;
}

.loyalty-progress-fill.is-complete {
  background: linear-gradient(90deg, #44d67d, #a9ffb6);
  box-shadow: 0 0 18px rgba(82, 214, 129, 0.34);
}

.loyalty-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.loyalty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.loyalty-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.loyalty-card > * {
  position: relative;
  z-index: 1;
}

.loyalty-card.is-complete {
  background:
    radial-gradient(circle at top, rgba(255, 236, 162, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(35, 66, 43, 0.94), rgba(18, 37, 24, 0.98));
  border-color: rgba(145, 255, 186, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 0 1px rgba(145, 255, 186, 0.12),
    0 0 30px rgba(82, 214, 129, 0.16);
}

.loyalty-card.is-complete::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 80%;
  background: radial-gradient(circle, rgba(255, 240, 174, 0.32), rgba(255, 240, 174, 0) 65%);
  pointer-events: none;
  animation: loyalty-card-glow 2.4s ease-in-out infinite;
}

.loyalty-card.is-new {
  animation: loyalty-card-pop 1.1s ease-out 2;
}

.loyalty-card-art {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.76));
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.06);
}

.loyalty-card.is-locked .loyalty-card-art {
  filter: grayscale(1) brightness(0.35);
}

.loyalty-card.is-complete .loyalty-card-art {
  border-color: rgba(255,255,255,0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 0 24px rgba(255, 230, 149, 0.16);
}

.loyalty-card-fallback {
  font-size: 2rem;
  opacity: 0.78;
}

.loyalty-card-badge {
  justify-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(68, 214, 125, 0.98), rgba(31, 157, 85, 0.96));
  color: #fff;
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 0 18px rgba(82, 214, 129, 0.22);
}

.loyalty-card-name {
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.15;
  min-height: 2.1em;
}

.loyalty-card.is-locked .loyalty-card-name {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.78;
}

@keyframes loyalty-notice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes loyalty-card-pop {
  0% { transform: scale(0.96); box-shadow: 0 0 0 rgba(245, 200, 76, 0); }
  45% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(245, 200, 76, 0.08); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(245, 200, 76, 0); }
}

@keyframes loyalty-card-glow {
  0%, 100% { opacity: 0.5; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(3%) scale(1.04); }
}

@keyframes loyalty-complete-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(13, 15, 22, 0.9), 0 0 0 rgba(82, 214, 129, 0); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 2px rgba(13, 15, 22, 0.9), 0 0 18px rgba(82, 214, 129, 0.38); }
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 18px 14px calc(22px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 8, 12, 0.22);
  backdrop-filter: blur(8px);
}

.settings-panel.hidden {
  display: none;
}

.settings-panel-card {
  width: min(100%, 460px);
  border-radius: 24px;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, rgba(21, 24, 33, 0.98), rgba(13, 15, 22, 0.98));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.08);
}

.settings-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings-panel-head strong {
  font-size: 1.08rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.settings-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.settings-option {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.settings-option + .settings-option {
  margin-top: 10px;
}

.audio-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0;
  color: rgba(255, 255, 255, 0.92);
}

.audio-control-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  min-width: 64px;
}

.audio-slider {
  width: 100%;
  accent-color: var(--accent-2);
}

.settings-inline-button {
  width: 100%;
}

.help-panel-card {
  width: min(100%, 560px);
  display: grid;
  gap: 12px;
}

.help-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.help-tab {
  min-width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255,255,255,0.16);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.help-tab.is-active {
  width: 34px;
  background: linear-gradient(90deg, #f5c84c, #d12a2a);
}

.help-carousel {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.help-track {
  display: flex;
  will-change: transform;
  transition: transform 220ms ease;
}

.help-track.is-dragging {
  transition: none;
}

.help-slide {
  width: 100%;
  flex: 0 0 100%;
  padding: 14px;
}

.help-slide-card {
  display: grid;
  gap: 12px;
}

.help-slide-media {
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 21, 28, 0.92), rgba(9, 11, 16, 0.98)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 16px, rgba(255,255,255,0.01) 16px, rgba(255,255,255,0.01) 32px);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  position: relative;
}

.help-slide-media.has-image {
  background-position: center;
  background-size: cover;
}

.help-slide-media.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.08), rgba(6, 8, 12, 0.34));
}

.help-slide-media.has-image .help-slide-media-fallback {
  opacity: 0;
}

.help-slide-media-fallback {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.78;
}

.help-slide-title {
  margin: 0;
  font-size: clamp(1.3rem, 5vw, 2rem);
  line-height: 1;
  text-transform: uppercase;
}

.help-slide-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.36;
  opacity: 0.94;
  white-space: pre-wrap;
}

.help-meta,
.help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.help-meta {
  font-size: 0.84rem;
  opacity: 0.82;
}

.help-swipe-hint {
  max-width: 28ch;
}

.help-counter {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.help-actions .btn {
  flex: 1 1 0;
  min-height: 46px;
}

.credits-panel-card {
  width: min(100%, 520px);
  padding-bottom: 28px;
}

.credits-card {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
  padding-bottom: 8px;
}

.credits-media {
  width: 100%;
  min-height: 150px;
  padding-bottom: 50px;
  position: relative;
  display: grid;
  place-items: center;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.credits-media.has-image .credits-media-fallback {
  opacity: 0;
}

.credits-media-fallback {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.78;
}

.credits-text {
  margin: 0;
  width: 100%;
  max-width: 30ch;
  font-size: 0.98rem;
  line-height: 1.38;
  opacity: 0.94;
  text-align: center;
  padding-bottom: 6px;
}

.credits-text b,
.credits-text strong {
  font-weight: 700;
}

.credits-text i,
.credits-text em {
  font-style: italic;
}

.credits-text u {
  text-decoration: underline;
}

.card-footer {
  grid-row: 3;
  display: grid;
  gap: var(--card-footer-gap);
  align-content: start;
  justify-items: center;
  text-align: center;
  min-height: 0;
  height: 100%;
  padding:
    var(--card-footer-padding-top)
    var(--card-footer-padding-inline)
    var(--card-footer-padding-bottom);
}

.hidden { display: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at top, rgba(245, 200, 76, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(10, 11, 16, 0.88), rgba(8, 10, 14, 0.96));
  z-index: 35;
}

.overlay.hidden { display: none; }

.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(209, 42, 42, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 20%);
  pointer-events: none;
}

.overlay.is-entering .ending-copy {
  animation: ending-copy-in 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.overlay.is-entering .ending-art-card {
  animation: ending-card-in 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.overlay.is-entering #restartButton {
  animation: ending-cta-in 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ending-screen {
  width: 100%;
  min-height: 100%;
  height: 100%;
  display: grid;
}

.ending-stage {
  --ending-rhythm: clamp(18px, 3.2vh, 28px);
  position: relative;
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  gap: var(--ending-rhythm);
  text-align: center;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(17, 18, 24, 0.94), rgba(11, 12, 17, 0.98)),
    var(--panel);
  border-radius: 30px;
  padding: 50px 55px 24px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), var(--shadow);
  overflow: hidden;
}

.ending-stage.is-victory {
  background:
    radial-gradient(circle at 50% -10%, rgba(245, 200, 76, 0.22), transparent 38%),
    radial-gradient(circle at 85% 10%, rgba(209, 42, 42, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(25, 20, 10, 0.96), rgba(18, 12, 9, 0.98)),
    var(--panel);
}

.ending-stage:not(.is-victory) .ending-celebration {
  display: none;
}

.ending-celebration {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.celebration-burst,
.celebration-confetti {
  position: absolute;
  opacity: 0;
}

.celebration-burst {
  width: 180px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.94) 0 4%, transparent 4.4% 100%),
    repeating-conic-gradient(
      from 0deg,
      rgba(245, 200, 76, 0.92) 0deg 10deg,
      transparent 10deg 20deg
    );
  filter: blur(0.2px) drop-shadow(0 0 16px rgba(245, 200, 76, 0.36));
  mix-blend-mode: screen;
  animation: celebration-burst 2200ms ease-out infinite;
}

.burst-a { top: 10%; left: 10%; animation-delay: 0ms; }
.burst-b { top: 8%; right: 12%; animation-delay: 540ms; }
.burst-c { top: 28%; left: 18%; animation-delay: 1040ms; }
.burst-d { top: 24%; right: 16%; animation-delay: 1480ms; }

.celebration-confetti {
  top: -14%;
  width: 10px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3c5, #f5c84c 55%, #d12a2a);
  box-shadow: 0 0 16px rgba(245, 200, 76, 0.2);
  animation: celebration-confetti-fall linear infinite;
}

.confetti-a { left: 8%; animation-duration: 3400ms; animation-delay: -400ms; }
.confetti-b { left: 18%; animation-duration: 2900ms; animation-delay: -1600ms; }
.confetti-c { left: 31%; animation-duration: 3600ms; animation-delay: -980ms; }
.confetti-d { left: 44%; animation-duration: 3000ms; animation-delay: -200ms; }
.confetti-e { left: 57%; animation-duration: 3500ms; animation-delay: -1800ms; }
.confetti-f { left: 68%; animation-duration: 2800ms; animation-delay: -1200ms; }
.confetti-g { left: 79%; animation-duration: 3200ms; animation-delay: -720ms; }
.confetti-h { left: 90%; animation-duration: 3700ms; animation-delay: -2200ms; }

.ending-summary{
  position: relative;
  z-index: 1;
}


.ending-copy,
.ending-main,
.ending-hero,
#restartButton {
  position: relative;
  z-index: 1;
}

.ending-main {
  align-self: center;
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ending-rhythm);
  justify-items: center;
}

.ending-copy {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: 100%;
  min-width: 0;
  max-width: 26rem;
}

.ending-hero {
  width: 100%;
  display: grid;
  place-items: center;
  margin: 0;
}

.ending-art-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  border-radius: 30px;
  padding: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(245, 200, 76, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(26, 28, 35, 0.98), rgba(13, 15, 21, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 34px rgba(0, 0, 0, 0.26);
}

.ending-stage.is-victory .ending-art-card {
  background:
    radial-gradient(circle at top, rgba(245, 200, 76, 0.24), transparent 44%),
    linear-gradient(180deg, rgba(54, 35, 17, 0.98), rgba(20, 14, 13, 0.98));
  border-color: rgba(245, 200, 76, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 0 1px rgba(245, 200, 76, 0.12),
    0 20px 42px rgba(0, 0, 0, 0.28),
    0 0 40px rgba(245, 200, 76, 0.1);
}

.ending-art {
  position: absolute;
  inset: 14px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(6, 8, 12, 0.64), rgba(6, 8, 12, 0.76)),
    url("../assets/card_back.png") center center / cover no-repeat;
  filter: saturate(0.22) brightness(0.46);
}

.ending-stage.is-victory .ending-art {
  filter: saturate(1.02) brightness(0.92);
}

.ending-summary {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  justify-items: center;
  width: min(100%, 220px);
  padding: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.ending-stage h2 {
  margin: 0;
  width: 100%;
  max-width: 12ch;
  margin-inline: auto;
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  line-height: 0.96;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.ending-stage.is-victory h2 {
  color: #fff4d0;
  text-shadow: 0 0 22px rgba(245, 200, 76, 0.2);
  animation: ending-title-victory-pulse 1800ms ease-in-out infinite;
}

.ending-stage p {
  margin: 0;
}

#endingText {
  width: 100%;
  max-width: 30ch;
  margin-inline: auto;
  font-size: 1.14rem;
  line-height: 1.28;
  opacity: 0.92;
  text-wrap: pretty;
}

.ending-turn {
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
  opacity: 0.96;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.38);
}

.ending-score-value {
  margin: 0;
  font-size: clamp(3.4rem, 15vw, 7rem);
  line-height: 0.92;
  color: var(--accent-2);
  text-shadow: 0 0 28px rgba(245, 200, 76, 0.2);
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.ending-score-value.is-counting {
  animation: ending-score-pulse 720ms ease-in-out infinite;
}

.ending-stage.is-victory .ending-score-value {
  color: #ffe58b;
  text-shadow:
    0 0 22px rgba(245, 200, 76, 0.28),
    0 0 44px rgba(245, 200, 76, 0.14);
}

#restartButton {
  min-width: 0;
  width: 100%;
  min-height: 56px;
  padding: 15px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--chip);
  color: #fff;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
  align-self: end;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 6, 10, 0.52);
  backdrop-filter: blur(10px);
}

.confirm-overlay.hidden {
  display: none;
}

.confirm-card {
  width: min(100%, 420px);
  display: grid;
  gap: 12px;
  padding: 22px 18px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(21, 24, 33, 0.98), rgba(13, 15, 22, 0.98));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.08);
}

.confirm-kicker {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.confirm-title {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1;
  text-transform: uppercase;
  font-family: "apotek-variable", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 700;
}

.confirm-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.28;
  opacity: 0.92;
}

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

.inventory-use-flash {
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(245, 200, 76, 0.38), rgba(245, 200, 76, 0.1) 32%, rgba(245, 200, 76, 0) 60%),
    linear-gradient(180deg, rgba(245, 200, 76, 0.12), rgba(245, 200, 76, 0));
}

.inventory-use-flash.hidden {
  display: none;
}

.inventory-use-flash.is-active {
  animation: inventory-use-flash 520ms ease-out;
}

@keyframes inventory-slot-pulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 0 1px rgba(255, 223, 133, 0.16),
      0 14px 28px rgba(0, 0, 0, 0.24),
      0 0 0 rgba(245, 200, 76, 0);
    filter: brightness(1) saturate(1);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.24),
      0 0 0 1px rgba(255, 223, 133, 0.22),
      0 18px 34px rgba(0, 0, 0, 0.28),
      0 0 30px rgba(245, 200, 76, 0.22);
    filter: brightness(1.12) saturate(1.08);
  }
}

@keyframes inventory-cta-blink {
  0%, 100% {
    opacity: 0.72;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@keyframes inventory-slot-get {
  0% {
    transform: scale(0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 rgba(245, 200, 76, 0);
  }
  45% {
    transform: scale(1.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 28px rgba(245, 200, 76, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 rgba(245, 200, 76, 0);
  }
}

@keyframes inventory-slot-use {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(0.92);
    filter: brightness(1.18);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes inventory-slot-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes inventory-use-flash {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

@keyframes request-loader-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (min-width: 900px) {
  html {
    font-size: 17.5px;
  }

  .app-shell {
    --shared-card-media-size: 502px;
    width: min(88vw, 650px);
  }

  .card-stage {
    --unlock-banner-bottom: 74px;
    grid-template-rows: minmax(0, 1fr);
    padding-left: 22px;
    padding-right: 22px;
  }

  .game-card {
    --card-copy-height: 128px;
    --card-media-size: 502px;
    --card-footer-height: 66px;
    --card-title-size: 1.86rem;
    --card-description-size: 1.7rem;
    grid-template-rows:
      minmax(var(--card-copy-height), 0.82fr)
      minmax(var(--card-media-size), 1.58fr)
      minmax(var(--card-footer-height), 0.5fr);
    align-content: center;
    height: 100%;
    min-height: 100%;
  }

  .card-body {
    align-content: center;
  }

  .intro-panel {
    width: min(100%, 620px);
  }

  .intro-panel-menu {
    width: 100%;
    max-width: 100%;
  }

  .ending-art-card {
    width: min(100%, 360px);
  }

  .next-card {
    transform: scale(0.96);
  }
}

@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  html {
    font-size: 18.5px;
  }

  .app-shell {
    --shared-card-media-size: 522px;
    width: min(84vw, 690px);
  }

  .game-card {
    --card-copy-height: 132px;
    --card-media-size: 522px;
    --card-footer-height: 68px;
    --card-title-size: 1.94rem;
    --card-description-size: 1.78rem;
  }
}

@media (max-height: 860px) {
  .menu-screen {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .overlay {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .app-shell {
    --shared-card-media-size: 290px;
  }

  .intro-panel-menu {
    padding: 18px 16px 16px;
    gap: 10px;
  }

  .intro-title {
    font-size: clamp(1.8rem, 5.4vw, 2.5rem);
  }

  .intro-text {
    font-size: 1.12rem;
    line-height: 1.22;
    max-width: 38ch;
  }

  .intro-media-wrap {
    min-height: var(--shared-card-media-size);
    margin: 4px 0;
  }

  .ending-stage {
    --ending-rhythm: 14px;
    padding: 18px 16px 16px;
  }

  .ending-stage h2 {
    font-size: clamp(1.8rem, 5.4vw, 2.5rem);
  }

  #endingText {
    font-size: 1.02rem;
    line-height: 1.18;
    max-width: 38ch;
  }

  .ending-art-card {
    max-width: 280px;
  }

  .ending-summary {
    width: min(100%, 176px);
  }

  .intro-hint {
    font-size: 0.9rem;
  }

  .intro-help-button {
    min-width: min(100%, 220px);
  }

  .topbar {
    padding-top: calc(9px + env(safe-area-inset-top, 0px));
    padding-bottom: 9px;
  }

  .bottombar {
    padding-top: 9px;
    padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
  }

  .card-stage {
    --unlock-banner-bottom: 72px;
    padding: 12px 10px;
    grid-template-rows: minmax(0, 1fr);
  }

  .game-card {
    --card-copy-height: 118px;
    --card-media-size: var(--shared-card-media-size);
    --card-footer-height: 62px;
    --card-copy-padding-top: 2px;
    --card-copy-padding-bottom: 6px;
    --card-footer-padding-top: 8px;
    --card-footer-padding-bottom: 2px;
    --card-title-size: clamp(1rem, 3vw, 1.22rem);
    --card-title-line-height: 1;
    --card-description-size: 1.36rem;
    --card-description-line-height: 1.42;
    --card-media-padding-top: 0;
  }

  .turn-chip-footer {
    padding: 0;
    font-size: 0.92rem;
  }

  .settings-trigger {
    width: 40px;
    height: 40px;
  }

  .audio-control-label {
    font-size: 0.8rem;
  }

  .specialization-options {
    grid-template-columns: 1fr;
  }

  .specialization-panel {
    padding: 18px 16px 16px;
    gap: 10px;
  }

  .specialization-title {
    font-size: clamp(1.8rem, 5.4vw, 2.5rem);
  }

  .specialization-text {
    font-size: 1.12rem;
    line-height: 1.22;
  }

  .specialization-option {
    min-height: 76px;
    padding: 10px 11px;
    border-radius: 18px;
  }

  .specialization-option-title {
    font-size: 0.92rem;
  }

  .specialization-option-badge {
    font-size: 0.74rem;
  }

  .specialization-confirm {
    padding: 12px 16px;
  }
}

@media (max-height: 740px) {
  .app-shell {
    --shared-card-media-size: 250px;
  }

  .stats {
    gap: 6px;
  }

  .stat {
    padding: 6px 2px;
    gap: 3px;
  }

  .stat-ring {
    width: 42px;
    height: 42px;
  }

  .stat-label {
    font-size: 0.68rem;
    padding: 6px 0;
  }

  .card-stage {
    --unlock-banner-bottom: 64px;
    grid-template-rows: minmax(0, 1fr);
  }

  .game-card {
    --card-copy-height: 104px;
    --card-media-size: var(--shared-card-media-size);
    --card-footer-height: 56px;
    --card-copy-gap: 4px;
    --card-copy-padding-top: 2px;
    --card-copy-padding-bottom: 4px;
    --card-footer-gap: 2px;
    --card-footer-padding-top: 7px;
    --card-footer-padding-bottom: 1px;
    --card-title-size: clamp(0.9rem, 2.8vw, 1.08rem);
    --card-title-line-height: 1;
    --card-description-size: 1.26rem;
    --card-description-line-height: 1.36;
    --card-media-padding-top: 0;
    --adviser-chip-margin-top: 1px;
  }

  .settings-panel-card {
    border-radius: 20px;
    padding: 14px 14px 12px;
  }

  .ending-stage h2 {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }

  .ending-art-card {
    max-width: 240px;
    padding: 9px;
  }

  .ending-summary {
    gap: 7px;
    width: min(100%, 160px);
  }

  .specialization-panel {
    gap: 7px;
    padding: 12px 10px 10px;
  }

  .specialization-kicker {
    font-size: 1rem;
  }

  .specialization-title {
    font-size: clamp(1.8rem, 5.4vw, 2.5rem);
  }

  .specialization-text {
    font-size: 1.12rem;
    line-height: 1.22;
  }

  .specialization-options {
    gap: 7px;
  }

  .specialization-option {
    min-height: 62px;
    padding: 8px 9px;
  }

  .specialization-option-info {
    width: 24px;
    height: 24px;
  }

  .specialization-confirm {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
  }

  #endingText {
    font-size: 1.06rem;
  }

  #restartButton {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 900px) and (max-height: 1100px) {
  html {
    font-size: 16.5px;
  }

  .app-shell {
    --shared-card-media-size: 250px;
    width: min(84vw, 600px);
  }

  .card-stage {
    --unlock-banner-bottom: 70px;
    padding: 14px 14px 12px;
  }

  .game-card {
    --card-copy-height: 116px;
    --card-media-size: 250px;
    --card-footer-height: 60px;
    --card-title-size: 1.52rem;
    --card-description-size: 1.42rem;
  }

  .intro-panel {
    width: min(100%, 580px);
  }

  .intro-panel-menu {
    padding: 26px 24px 18px;
    gap: 12px;
  }

  .intro-kicker {
    font-size: 0.9rem;
    margin-top: 2px;
  }

  .intro-title {
    max-width: 11ch;
    padding-bottom: 2px;
    font-size: clamp(2rem, 5vw, 2.7rem);
  }

  .intro-text {
    max-width: 30ch;
    font-size: 1.08rem;
    line-height: 1.16;
  }

  .intro-media-wrap {
    min-height: var(--shared-card-media-size);
    margin: 2px 0;
  }

  .intro-hint {
    font-size: 0.86rem;
  }

  .intro-help-button {
    min-height: 50px;
    padding: 13px 16px;
  }

  .topbar,
  .bottombar {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .topbar {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }

  .bottombar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

@keyframes stat-ring-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes unlock-banner-inout {
  0% { opacity: 0; transform: translate(-50%, -14px) scale(0.92); }
  14% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  86% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -8px) scale(0.96); }
}

@keyframes unlock-banner-glow-gold {
  0%, 100% {
    box-shadow:
      0 18px 34px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(255, 239, 181, 0.18),
      0 0 24px rgba(245, 200, 76, 0.18);
  }
  50% {
    box-shadow:
      0 18px 34px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(255, 245, 206, 0.24),
      0 0 36px rgba(245, 200, 76, 0.34),
      0 0 62px rgba(245, 200, 76, 0.18);
  }
}

@keyframes unlock-banner-glow-orange {
  0%, 100% {
    box-shadow:
      0 18px 34px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(255, 198, 125, 0.18),
      0 0 22px rgba(219, 112, 31, 0.16);
  }
  50% {
    box-shadow:
      0 18px 34px rgba(0, 0, 0, 0.34),
      0 0 0 1px rgba(255, 215, 160, 0.22),
      0 0 34px rgba(234, 126, 41, 0.32),
      0 0 58px rgba(234, 126, 41, 0.16);
  }
}

@keyframes ending-copy-in {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ending-card-in {
  0% { opacity: 0; transform: translateY(34px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ending-cta-in {
  0% { opacity: 0; transform: translateY(22px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ending-score-pulse {
  0% { transform: scale(1); filter: brightness(1); }
  45% { transform: scale(1.06); filter: brightness(1.08); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes celebration-burst {
  0% { transform: scale(0.2); opacity: 0; }
  12% { opacity: 0.95; }
  62% { transform: scale(1); opacity: 0.34; }
  100% { transform: scale(1.22); opacity: 0; }
}

@keyframes celebration-confetti-fall {
  0% { transform: translate3d(0, -8%, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate3d(26px, 125vh, 0) rotate(560deg); opacity: 0; }
}

@keyframes ending-title-victory-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.035); filter: brightness(1.08); }
}

@keyframes specialization-screen-in {
  0% { opacity: 0; transform: translateY(28px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes specialization-screen-out {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-16px) scale(0.985); }
}

@keyframes specialization-option-in {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes specialization-cta-in {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes specialization-fade-out {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}


@keyframes next-card-unlock {
  0% { transform: scale(0.96); box-shadow: var(--shadow); }
  28% { transform: scale(1.01); box-shadow: 0 0 0 2px rgba(240, 197, 79, 0.36), 0 0 42px rgba(240, 197, 79, 0.24); }
  100% { transform: scale(0.96); box-shadow: var(--shadow); }
}

@keyframes stat-impact-positive {
  0% { opacity: 0; background: radial-gradient(circle, rgba(31, 157, 85, 0.28), transparent 60%); }
  30% { opacity: 1; background: radial-gradient(circle, rgba(31, 157, 85, 0.22), transparent 68%); }
  100% { opacity: 0; background: radial-gradient(circle, rgba(31, 157, 85, 0), transparent 78%); }
}

@keyframes stat-impact-negative {
  0% { opacity: 0; background: radial-gradient(circle, rgba(214, 69, 69, 0.28), transparent 60%); }
  30% { opacity: 1; background: radial-gradient(circle, rgba(214, 69, 69, 0.22), transparent 68%); }
  100% { opacity: 0; background: radial-gradient(circle, rgba(214, 69, 69, 0), transparent 78%); }
}
