:root {
  color-scheme: dark;
  --bg: #111112;
  --bg-soft: rgba(255, 255, 255, 0.05);
  --panel: rgba(28, 28, 31, 0.84);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #f6f7fb;
  --muted: #a2a6b3;
  --accent-a: #f66e6e;
  --accent-b: #65a8ff;
  --yes: #6edd8a;
  --no: #ff7e7e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --content-width: 430px;
  --shell-gap: 10px;
  --shell-pad-x: 10px;
  --shell-pad-top: 10px;
  --shell-pad-bottom: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(246, 110, 110, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(101, 168, 255, 0.16), transparent 35%),
    linear-gradient(180deg, #19191b 0%, #0c0c0d 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI Variable", "Trebuchet MS", sans-serif;
}

[hidden] {
  display: none !important;
}

body {
  display: flex;
  justify-content: center;
}

body:not([data-game-over="true"]) {
  overflow: hidden;
}

.phone-shell {
  width: min(100%, var(--content-width));
  min-height: 100svh;
  height: 100svh;
  padding:
    calc(var(--shell-pad-top) + env(safe-area-inset-top))
    calc(var(--shell-pad-x) + env(safe-area-inset-right))
    calc(var(--shell-pad-bottom) + env(safe-area-inset-bottom))
    calc(var(--shell-pad-x) + env(safe-area-inset-left));
}

.app-panel {
  display: grid;
  min-height: 100%;
  height: 100%;
  gap: var(--shell-gap);
  grid-template-rows: minmax(0, 10svh) minmax(0, 10svh) minmax(0, 1fr) minmax(0, 5svh);
}

.answers-panel,
.user-panel,
.login-panel,
.questions-panel,
.grid-panel,
.footer-action,
.top-bar {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.answers-panel,
.user-panel,
.login-panel,
.questions-panel,
.grid-panel,
.footer-action,
.top-bar {
  border-radius: var(--radius-xl);
}

h1,
h2,
p {
  margin: 0;
}

.win-popup h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 10vw, 3rem);
  line-height: 0.95;
}

.win-popup h2::after {
  display: none;
}

.win-kicker {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.win-copy {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.ghost-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: white;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 0.96rem;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.15;
}

.answers-panel,
.user-panel,
.login-panel,
.questions-panel,
.grid-panel,
.footer-action,
.top-bar {
  padding: 14px;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background:
    radial-gradient(circle at top left, rgba(246, 110, 110, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(101, 168, 255, 0.16), transparent 34%),
    var(--panel);
}

.top-bar-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-bar-player-icon {
  flex: none;
  font-size: 1rem;
  line-height: 1;
}

.top-bar-player-name {
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.05;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-actions {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 6px;
  align-items: center;
}

.top-bar-actions form {
  margin: 0;
}

.brand-logo-login {
  width: min(220px, 68vw);
}

.user-kicker,
.user-stat-label {
  color: var(--muted);
}

.user-kicker {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.leaderboard-trigger {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: 100%;
  min-height: 40px;
  padding: 0;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
}

.top-bar-trigger {
  width: 40px;
}

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

.user-stat {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-stat strong {
  font-size: 1.35rem;
}

.login-panel {
  display: grid;
  gap: 16px;
}

.login-panel h1 {
  font-size: 1.8rem;
  line-height: 1;
}

.login-copy {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-label {
  font-size: 0.88rem;
  font-weight: 700;
}

.login-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

.login-alert {
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.5;
}

.login-alert-error {
  background: rgba(255, 126, 126, 0.14);
  border: 1px solid rgba(255, 126, 126, 0.35);
  color: #ffd0d0;
}

.login-alert-success {
  background: rgba(110, 221, 138, 0.14);
  border: 1px solid rgba(110, 221, 138, 0.35);
  color: #d9ffe3;
}

.leaderboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(10px);
}

.leaderboard-modal {
  width: min(100%, 420px);
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(246, 110, 110, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(101, 168, 255, 0.14), transparent 36%),
    #17181d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.leaderboard-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.leaderboard-head h2 {
  margin-top: 6px;
  font-size: 1.4rem;
}

.leaderboard-close {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 36px;
  height: 36px;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.collection-modal {
  display: grid;
  gap: 16px;
}

.answers-modal {
  width: min(100%, 420px);
}

.answers-modal-body {
  max-height: min(58svh, 440px);
  overflow: auto;
  scrollbar-width: thin;
}

.answers-modal .answer-list {
  grid-template-columns: 1fr;
}

.collection-counter {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.collection-card {
  border: 0;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.collection-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.78;
  object-fit: cover;
}

.collection-card-name {
  display: block;
  padding: 10px 10px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.15;
}

.collection-empty {
  padding-top: 0;
}

.collection-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.collection-detail-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 28px;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(10px);
}

.collection-detail-card {
  position: relative;
  width: min(100%, 340px);
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(246, 110, 110, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(101, 168, 255, 0.16), transparent 36%),
    #15161b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.42);
}

.collection-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
}

.collection-detail-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.72;
  object-fit: cover;
}

.collection-detail-copy {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.collection-detail-copy h3 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
}

.collection-detail-id {
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collection-page {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.collection-nav {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  width: 44px;
  height: 40px;
  font: inherit;
  font-size: 1.35rem;
  cursor: pointer;
}

.collection-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.leaderboard-row-current {
  background: rgba(101, 168, 255, 0.14);
  border-color: rgba(101, 168, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(101, 168, 255, 0.12);
}

.leaderboard-rank {
  min-width: 2.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffd27d;
}

.leaderboard-player,
.leaderboard-score {
  display: grid;
  gap: 4px;
}

.leaderboard-player span,
.leaderboard-score span {
  color: var(--muted);
  font-size: 0.8rem;
}

.leaderboard-score {
  justify-items: end;
  text-align: right;
}

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

.question-list {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(8, 9, 12, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  touch-action: pan-y;
}

.questions-panel {
  display: grid;
  align-content: start;
  min-height: 0;
  padding: 8px 10px;
}

.answer-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.answer-text {
  font-size: 0.84rem;
  line-height: 1.2;
}

.answer-chip-yes {
  background: rgba(110, 221, 138, 0.14);
  border-color: rgba(110, 221, 138, 0.35);
}

.answer-chip-yes .answer-text,
.answer-chip-yes .answer-icon,
.answer-chip-yes .answer-mark {
  color: var(--yes);
}

.answer-chip-no {
  background: rgba(255, 72, 72, 0.18);
  border-color: rgba(255, 72, 72, 0.5);
}

.answer-chip-no .answer-text,
.answer-chip-no .answer-icon,
.answer-chip-no .answer-mark {
  color: var(--no);
}

.empty-state {
  color: var(--muted);
  line-height: 1.5;
  padding: 4px 2px 0;
}

.question-list form,
.animal-grid form {
  margin: 0;
}

.animal-grid form {
  height: 100%;
  min-height: 0;
}

.question-card-slot,
.question-card-slot form {
  min-width: 0;
}

.question-card-slot {
  min-height: 100%;
}

.question-button,
.animal-card {
  width: 100%;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.question-button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(101, 168, 255, 0.16), rgba(246, 110, 110, 0.12)),
    rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.question-nav-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.question-nav-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.question-position {
  margin: 4px 0 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.question-empty {
  margin: 4px 0 0;
  text-align: center;
}

.question-icon,
.answer-icon {
  font-size: 0.92rem;
}

.question-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.question-prefix {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.answer-mark {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.question-label {
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.15;
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.grid-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.grid-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 6px;
}

.app-footer {
  display: grid;
  place-items: center;
  min-height: 0;
}

.brand-logo-footer {
  width: min(72px, 24vw);
  max-height: 100%;
}

[data-answers-container] {
  min-height: 0;
}

.answer-splash {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 12;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  max-width: min(calc(100% - 8px), 280px);
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: answer-splash-in 2400ms ease forwards;
}

.answer-splash-yes {
  background: linear-gradient(135deg, rgba(110, 221, 138, 0.94), rgba(52, 180, 108, 0.94));
  color: #f2fff6;
}

.answer-splash-no {
  background: linear-gradient(135deg, rgba(255, 72, 72, 0.97), rgba(215, 38, 38, 0.96));
  color: #fff1f1;
}

.answer-splash-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.answer-splash-text {
  min-width: 0;
  font-size: 0.94rem;
  line-height: 1.2;
}

.answer-splash-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.answer-splash-yes .answer-splash-mark {
  color: #198754;
}

.answer-splash-no .answer-splash-mark {
  color: #d62828;
}

.win-overlay {
  position: fixed;
  inset: 0;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 9, 12, 0.68);
  backdrop-filter: blur(10px);
}

.win-popup {
  position: relative;
  overflow: hidden;
  width: min(100%, 280px);
  padding: 22px 18px 18px;
  border-radius: 26px;
  text-align: center;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(135deg, rgba(246, 110, 110, 0.92), rgba(101, 168, 255, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

.win-popup::after {
  content: "";
  position: absolute;
  inset: auto -16% -40% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  filter: blur(8px);
}

.win-card {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(16, 16, 20, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.win-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.8;
  object-fit: cover;
}

.win-card-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 12px 14px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.78) 74%);
}

.win-reward-zone {
  position: relative;
  margin-top: 18px;
  min-height: 332px;
  padding-top: 18px;
}

.reward-card {
  position: absolute;
  left: 50%;
  bottom: 40px;
  z-index: 3;
  width: min(78vw, 320px);
  max-width: calc(100vw - 56px);
  overflow: hidden;
  border-radius: 24px;
  background: rgba(15, 17, 24, 0.96);
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, 78px) scale(0.52);
  opacity: 0;
  transition: transform 540ms cubic-bezier(0.18, 0.8, 0.24, 1), opacity 240ms ease;
}

.reward-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.7;
  object-fit: cover;
}

.reward-card-badge,
.reward-card-name {
  position: absolute;
  left: 10px;
  right: 10px;
}

.reward-card-badge {
  top: 14px;
  left: auto;
  right: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reward-card-name {
  bottom: 14px;
  padding: 34px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.82) 72%);
}

.reward-card-new {
  border-color: rgba(255, 229, 122, 0.72);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(255, 225, 110, 0.28);
}

.win-chest {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 88px;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.34));
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  appearance: none;
}

.win-reward-hint {
  margin: 0;
  padding-top: 106px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  color: rgba(255, 245, 214, 0.88);
}

.win-chest:focus-visible {
  outline: 3px solid rgba(255, 232, 137, 0.9);
  outline-offset: 8px;
}

.win-overlay.is-reward-teasing .win-chest {
  animation: chest-wiggle 625ms ease-in-out 4;
}

.win-chest-lid,
.win-chest-base,
.win-chest-lock {
  position: absolute;
  display: block;
}

.win-chest-lid {
  left: 8px;
  top: 10px;
  width: 104px;
  height: 28px;
  border-radius: 18px 18px 10px 10px;
  background:
    linear-gradient(180deg, #f8d977 0%, #d5962f 100%);
  border: 2px solid rgba(78, 45, 6, 0.52);
  transform-origin: 14px 24px;
  transition: transform 420ms ease;
}

.win-chest-base {
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #d18f2b 0%, #8e5418 100%);
  border: 2px solid rgba(78, 45, 6, 0.52);
}

.win-chest-base::before,
.win-chest-base::after,
.win-chest-lid::before,
.win-chest-lid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: rgba(88, 46, 8, 0.56);
}

.win-chest-base::before,
.win-chest-lid::before {
  left: 16px;
}

.win-chest-base::after,
.win-chest-lid::after {
  right: 16px;
}

.win-chest-lock {
  left: 50%;
  top: 36px;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff2b0 0%, #e6b03c 100%);
  border: 2px solid rgba(78, 45, 6, 0.48);
  transform: translateX(-50%);
  transition: transform 420ms ease, opacity 180ms ease;
}

.win-chest-lock::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -11px;
  width: 14px;
  height: 14px;
  border: 3px solid rgba(255, 236, 162, 0.92);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  transform: translateX(-50%);
}

.win-overlay.is-reward-open .reward-card {
  opacity: 1;
  transform: translate(-50%, -142px) scale(1);
  animation: reward-card-wiggle 1400ms ease-in-out infinite;
}

.win-overlay.is-reward-open .win-reward-hint {
  opacity: 0;
}

.win-overlay.is-reward-open .win-chest-lid {
  transform: translateY(-8px) rotate(-28deg);
}

.win-overlay.is-reward-open .win-chest-lock {
  opacity: 0.75;
  transform: translate(-50%, 6px);
}

.animal-card {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #18181b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.animal-card img {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
}

.animal-art {
  display: grid;
  place-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(8, 8, 10, 0.24));
}

.animal-art-emoji,
.win-art-emoji {
  font-size: clamp(3.2rem, 11vw, 4.6rem);
}

.animal-name,
.flip-badge {
  position: absolute;
  left: 0;
  right: 0;
  color: #fff;
}

.animal-name {
  bottom: 0;
  padding: 10px 8px 8px;
  font-weight: 800;
  font-size: 0.88rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.76) 76%);
}

.flip-badge {
  top: 12px;
  left: 12px;
  right: auto;
  padding: 5px 8px;
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.animal-card.is-flipped {
  opacity: 0.42;
  filter: grayscale(1);
  transform: scale(0.98) rotate(-1deg);
}

.question-button:disabled,
.animal-card:disabled {
  cursor: default;
}

body[data-game-over="true"] .question-button,
body[data-game-over="true"] .animal-card {
  opacity: 0.72;
}

body[data-game-over="true"] .win-popup {
  width: min(100%, 320px);
  margin-inline: auto;
}

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

button:focus-visible {
  outline: 3px solid rgba(101, 168, 255, 0.8);
  outline-offset: 3px;
}

@keyframes answer-splash-in {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 10px)) scale(0.96);
  }

  12%,
  76% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 6px)) scale(0.98);
  }
}

@keyframes chest-wiggle {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg);
  }

  20% {
    transform: translateX(calc(-50% - 3px)) rotate(-3deg);
  }

  40% {
    transform: translateX(calc(-50% + 3px)) rotate(3deg);
  }

  60% {
    transform: translateX(calc(-50% - 2px)) rotate(-2deg);
  }

  80% {
    transform: translateX(calc(-50% + 2px)) rotate(2deg);
  }
}

@keyframes reward-card-wiggle {
  0%,
  100% {
    transform: translate(-50%, -142px) rotate(0deg) scale(1);
  }

  20% {
    transform: translate(calc(-50% - 3px), -144px) rotate(-2deg) scale(1.01);
  }

  40% {
    transform: translate(calc(-50% + 4px), -140px) rotate(2.4deg) scale(1.01);
  }

  60% {
    transform: translate(calc(-50% - 2px), -145px) rotate(-1.5deg) scale(1);
  }

  80% {
    transform: translate(calc(-50% + 2px), -141px) rotate(1.4deg) scale(1.01);
  }
}

@media (hover: hover) {
  .question-button:hover,
  .animal-card:hover,
  .ghost-button:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 430px) {
  .phone-shell {
    --shell-pad-x: 8px;
    --shell-pad-top: 8px;
    --shell-pad-bottom: 10px;
    --shell-gap: 8px;
  }

  .top-bar {
    gap: 6px;
    padding: 7px 8px;
  }

  .top-bar-player {
    gap: 6px;
  }

  .top-bar-player-name {
    font-size: 0.82rem;
  }

  .top-bar-actions {
    gap: 6px;
  }

  .leaderboard-trigger {
    min-height: 36px;
    font-size: 1.05rem;
  }

  .top-bar-trigger {
    width: 36px;
  }

  .brand-logo-footer {
    width: min(64px, 22vw);
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .animal-grid {
    gap: 6px;
  }

  .animal-name {
    font-size: 0.8rem;
  }

  .collection-grid {
    gap: 10px;
  }

  .collection-card-name {
    padding: 8px 8px 10px;
    font-size: 0.8rem;
  }

  .collection-detail-card {
    width: min(100%, 300px);
  }

  .reward-card {
    width: min(82vw, 300px);
    max-width: calc(100vw - 42px);
  }

  .win-chest {
    width: 110px;
  }

  .win-chest-lid {
    width: 94px;
  }
}
