/* Classroom leaderboards and adventure games. */
.mini-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.mini-top span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.mini-top strong {
  color: var(--blue-dark);
  font-weight: 900;
}

.rank-summary-card {
  background: linear-gradient(135deg, #ffffff 0%, #f5fbff 100%);
  border-color: #cdeaff;
  border-bottom-color: #a9dbff;
}

.rank-hero {
  background: linear-gradient(135deg, #58cc02 0%, #1cb0f6 100%);
  color: #ffffff;
  border-radius: 22px;
  border-bottom: 5px solid #1899d6;
  padding: 26px 28px;
  margin: 18px 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.rank-hero .eyebrow {
  color: #e9ffd6;
}

.rank-hero h2 {
  color: #ffffff;
  font-size: 1.55rem;
  margin-bottom: 6px;
}

.rank-hero p {
  margin-bottom: 0;
  color: #ffffffef;
  font-weight: 600;
}

.gold-wallet {
  background: #ffffff24;
  border: 2px solid #ffffff55;
  border-radius: 18px;
  padding: 14px 20px;
  min-width: 175px;
  text-align: center;
}

.gold-wallet span {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff6d6;
}

.gold-wallet strong {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffe36e;
  text-shadow: 0 2px 0 #00000022;
}

.rank-list {
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  margin-bottom: 6px;
  border: 2px solid transparent;
  background: #ffffff;
}

.rank-list li:not(:last-child) {
  border-bottom: 2px solid #f2f2f2;
}

.rank-list li small {
  display: block;
  font-weight: 600;
}

.rank-list .is-me {
  background: var(--blue-soft);
  border: 2px solid #84d8ff;
}

.rank-number {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--ink);
  font-size: 0.92rem;
}

.rank-number.top-1 {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-ink);
}

.rank-number.top-2 {
  background: #eef2f6;
  border-color: #c5d0dc;
  color: #46586e;
}

.rank-number.top-3 {
  background: #ffe8d6;
  border-color: #f4a261;
  color: #9c4a12;
}

/* Game Hub */
.play-intro {
  background: linear-gradient(135deg, #ce82ff 0%, #8549ba 100%);
  color: #ffffff;
  border-radius: 22px;
  border-bottom: 5px solid #6b359c;
  padding: 26px 28px;
  margin-bottom: 20px;
}

.play-intro .eyebrow {
  color: #f3e0ff;
}

.play-intro h1 {
  color: #ffffff;
  margin-bottom: 6px;
}

.play-intro p {
  margin-bottom: 0;
  color: #ffffffeb;
  font-weight: 600;
}

.game-menu .game-tile {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  transition: transform 0.14s ease;
}

.game-menu .game-tile:hover {
  transform: translateY(-3px);
}

.game-symbol {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  margin-bottom: 16px;
  border: 2px solid #0000000d;
}

.game-symbol svg {
  width: 155px;
  height: 100px;
  filter: drop-shadow(0 4px 0 #00000014);
}

.fish .game-symbol { background: linear-gradient(180deg, #daf4ff, #b8e8ff); }
.puzzle .game-symbol { background: linear-gradient(180deg, #e1ffd2, #c7f8ac); }
.gold .game-symbol { background: linear-gradient(180deg, #fff6cf, #ffe793); }

.game-tile h2 {
  margin: 4px 0 8px;
}

.game-tile p {
  min-height: 76px;
  flex: 1;
}

.game-tile button {
  width: 100%;
  margin-top: auto;
}

.game-tile.fish button {
  background: var(--blue);
  border-bottom-color: var(--blue-dark);
}

.game-tile.gold button {
  background: var(--gold);
  color: #5c3d00;
  border-bottom-color: var(--gold-dark);
}

/* Active Game Screen */
.game-screen {
  max-width: 1050px;
  margin: 0 auto;
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.game-top h1 {
  margin: 0;
  font-size: 1.55rem;
}

.game-gold {
  padding: 8px 16px;
  border-radius: 16px;
  background: var(--gold-soft);
  border: 2px solid var(--gold);
  color: var(--gold-ink);
  white-space: nowrap;
  font-weight: 800;
}

.game-gold strong {
  font-size: 1.45rem;
  font-weight: 900;
}

.game-finish {
  text-align: center;
  padding: 48px 25px;
}

.game-finish button {
  margin: 8px;
}

.answer-feedback {
  margin: 20px 0;
  padding: 22px;
  border-radius: 20px;
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  background: var(--surface);
}

.answer-feedback.correct {
  background: var(--green-soft);
  border-color: #8ee055;
  border-bottom-color: var(--green);
}

.answer-feedback.incorrect {
  background: var(--red-soft);
  border-color: #ff9c9c;
  border-bottom-color: var(--red);
}

.answer-feedback.pending {
  background: var(--blue-soft);
  border-color: #84d8ff;
  border-bottom-color: var(--blue);
}

.answer-feedback h2 {
  font-size: 1.2rem;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-grid button {
  text-align: left;
  justify-content: flex-start;
  min-height: 54px;
  background: var(--surface);
  color: var(--ink-strong);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
}

.answer-grid button:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: #84d8ff;
  border-bottom-color: var(--blue);
  color: var(--blue-ink);
  filter: none;
}

.game-question {
  margin: 20px 0;
}

.game-question button[type="submit"],
.game-question > button:not([data-option]) {
  margin-top: 14px;
}

/* Fish Game */
.aquarium {
  position: relative;
  overflow: hidden;
  border: 4px solid #1899d6;
  border-bottom-width: 7px;
  border-radius: 26px;
  background: linear-gradient(#7de4f7, #1cb0f6 62%, #0e7eb5);
  padding: 25px 12px 45px;
  min-height: 360px;
}

.water-surface {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  border-top: 4px dashed #e6fbff88;
}

.fish-lane {
  height: 105px;
  position: relative;
}

.fish-answer {
  position: absolute;
  left: 8%;
  height: 90px;
  width: min(270px, 72%);
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 0;
  border-radius: 45%;
  animation: swim 8s ease-in-out infinite alternate;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #243e55;
}

.fish-answer svg {
  position: absolute;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 3px #00476c55);
}

.fish-answer span {
  position: relative;
  padding: 0 28px 0 15px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  max-height: 80px;
  overflow: auto;
  text-shadow: 0 1px #ffffff70;
}

.fish-answer.fish-1 { animation-delay: -3s; animation-duration: 9s; }
.fish-answer.fish-2 { animation-delay: -5s; animation-duration: 7s; }
.fish-answer.fish-3 { animation-delay: -1s; }
.fish-answer.fish-4 { animation-delay: -6s; }

.fish-answer:hover, .fish-answer:focus-visible {
  animation-play-state: paused;
  filter: brightness(1.08);
}

.fish-answer.caught {
  animation-play-state: paused;
  outline: 4px solid white;
}

.fish-answer:disabled {
  opacity: 0.85;
}

.sea-floor {
  height: 32px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #e5be7b;
  border-radius: 50% 50% 0 0;
}

.sea-floor:before, .sea-floor:after {
  content: '';
  position: absolute;
  border: 9px solid #58cc02;
  border-top: 0;
  border-bottom: 0;
  width: 28px;
  height: 90px;
  bottom: 15px;
  border-radius: 50%;
  left: 10%;
}

.sea-floor:after {
  left: 80%;
  height: 65px;
}

.bubbles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, #ffffff55 0 4px, transparent 5px),
    radial-gradient(circle at 80% 40%, #ffffff55 0 7px, transparent 8px),
    radial-gradient(circle at 50% 65%, #ffffff55 0 5px, transparent 6px);
}

@keyframes swim {
  from { left: 2%; }
  to { left: calc(98% - min(270px, 72%)); }
}

.fish-options {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.fish-options li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  background: var(--surface-soft);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
}

.fish-options strong {
  color: var(--blue-dark);
  font-weight: 900;
  flex-shrink: 0;
}

.fish-options span {
  overflow-wrap: anywhere;
}

.fish-answer span.fish-letter {
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 900;
  padding: 0 5px 0 0;
  transform: translateX(-3%);
  color: #173958;
  overflow: visible;
  max-height: none;
  text-shadow: 0 2px 0 #ffe7ba;
}

/* Fish roam in both axes; letters stay upright as the fish turns. */
.fish-school {
  position: relative;
  height: 380px;
  width: 100%;
  overflow: hidden;
}

.fish-answer.swimming-fish {
  left: 0;
  top: 0;
  width: 160px;
  max-width: 52%;
  height: 68px;
  animation: none !important;
  will-change: transform;
  border: 0;
  padding: 0;
}

.swimming-fish svg {
  transition: transform 0.2s ease-out;
  pointer-events: none;
}

.swimming-fish.heading-right svg {
  transform: scaleX(-1);
}

.swimming-fish span.fish-letter {
  font-size: 2.15rem;
  pointer-events: none;
  transform: translateX(-3%);
}

.swimming-fish.heading-right span.fish-letter {
  transform: translateX(9%);
}

.swimming-fish.caught {
  outline: 3px solid white;
  outline-offset: -5px;
}

/* Puzzle Memory Game */
.puzzle-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: #b5dfed url('/puzzle.svg') center/cover no-repeat;
  border: 4px solid #a8eb76;
  border-radius: 22px;
  min-height: 400px;
  margin: 18px 0;
}

.memory-card {
  position: relative;
  min-height: 125px;
  background: linear-gradient(135deg, #1cb0f6, #1493d4);
  padding: 12px;
  border: 2px solid #ffffff85;
  border-bottom: 5px solid #0e76ad;
  border-radius: 16px;
  color: white;
  transition: background 0.2s, transform 0.1s;
}

.card-back {
  font-size: 1.7rem;
  font-weight: 900;
}

.card-face {
  display: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.card-face small {
  display: block;
  color: var(--blue-dark);
  margin-bottom: 8px;
}

.memory-card.flipped {
  background: #ffffff;
  color: var(--ink-strong);
  border-color: #84d8ff;
  border-bottom-color: var(--blue);
}

.memory-card.flipped .card-back { display: none; }
.memory-card.flipped .card-face { display: block; }

.memory-card.matched {
  background: transparent;
  border-color: transparent;
  opacity: 1;
  cursor: default;
}

.memory-card.matched span {
  visibility: hidden;
}

.puzzle-board.split-puzzle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 14px;
  align-items: start;
}

.memory-side {
  min-width: 0;
  border-radius: 16px;
  padding: 12px;
  background: #edf8ffeb;
  border: 2px solid #84d8ff;
}

.memory-side h2 {
  font-size: 1.1rem;
  text-align: center;
  margin: 0 0 12px;
  color: var(--blue-dark);
  background: #ffffff;
  border: 2px solid #cbeeff;
  border-radius: 12px;
  padding: 8px;
}

.answer-side {
  background: #fff6e0eb;
  border-color: #ffc800;
}

.answer-side h2 {
  color: var(--orange-dark);
  background: #ffffff;
  border-color: #ffe28a;
}

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

.memory-half .memory-card {
  width: 100%;
  min-height: 140px;
  overflow-wrap: anywhere;
}

.question-side .memory-card {
  background: linear-gradient(135deg, #1cb0f6, #1899d6);
  border-bottom-color: #0e76ad;
}

.answer-side .memory-card {
  background: linear-gradient(135deg, #ff9600, #e58300);
  border-bottom-color: #bd6a00;
}

.memory-side .memory-card.flipped {
  background: #ffffff;
  color: var(--ink-strong);
}

.answer-side .memory-card.flipped {
  background: #fffdf7;
  color: #62390d;
  border-color: #ffd066;
  border-bottom-color: var(--orange);
}

.memory-half .memory-card.matched {
  visibility: hidden;
  pointer-events: none;
  background: transparent;
}

.memory-card.mismatch {
  outline: 4px solid var(--red);
}

.split-puzzle.completed .memory-side {
  background: transparent;
  border-color: transparent;
}

.split-puzzle.completed .memory-side h2 {
  visibility: hidden;
}

.memory-card.previewing:disabled {
  opacity: 1;
  cursor: default;
}

#puzzle-preview:not(:empty) {
  background: var(--blue-soft);
  border: 2px solid #84d8ff;
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--blue-dark);
  font-weight: 800;
}

/* Gold Miner Game */
.mine {
  position: relative;
  height: 380px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(#8ed6f2 0 72px, #ca9766 73px, #825332 77px, #3e2d31 100%);
  border: 4px solid #73513c;
  border-bottom-width: 7px;
}

.miner-label {
  position: absolute;
  top: 10px;
  left: 16px;
  font-weight: 900;
  color: #183f50;
  max-width: 35%;
  line-height: 1.3;
}

.winch {
  position: absolute;
  top: 33px;
  left: calc(50% - 26px);
  width: 52px;
  height: 45px;
  background: #a94930;
  border: 7px solid #e7af56;
  border-radius: 13px;
}

.hook-arm {
  position: absolute;
  top: 70px;
  left: 50%;
  height: 1px;
  width: 1px;
  transform-origin: 0 0;
  z-index: 2;
}

.rope {
  position: absolute;
  left: -2px;
  width: 4px;
  height: 53px;
  background: #f1d5ad;
  transition: height 0.8s ease-out;
}

.claw {
  position: absolute;
  top: 43px;
  left: -15px;
  width: 30px;
  height: 26px;
  border: 5px solid #ced9df;
  border-top: 0;
  border-radius: 0 0 15px 15px;
  transition: top 0.8s ease-out;
}

.rope.extending { height: 235px; }
.claw.extending { top: 225px; }

.nugget {
  position: absolute;
  width: 70px;
  height: 65px;
  left: calc(50% - 35px);
  top: 280px;
  filter: drop-shadow(0 5px 3px #21191c90);
  transition: opacity 0.3s, transform 0.5s;
}

.nugget svg {
  width: 100%;
  height: 100%;
}

.nugget-0 { left: calc(50% + 145px); top: 205px; }
.nugget-1 { left: calc(50% + 65px); top: 260px; }
.nugget-2 { top: 280px; }
.nugget-3 { left: calc(50% - 135px); top: 260px; }
.nugget-4 { left: calc(50% - 215px); top: 205px; }

.nugget.collected {
  opacity: 0;
  transform: translateY(-100px);
}

.nugget.hooked {
  filter: drop-shadow(0 0 8px #ffe092);
}

.mystery-chest {
  filter: drop-shadow(0 0 7px #e4b85488);
}

.nugget[data-reveal="diamond"] {
  filter: drop-shadow(0 0 12px #7ff2ff);
}

.nugget[data-reveal="rock"] {
  filter: drop-shadow(0 4px 3px #1118);
}

.mine-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: #2c2429;
  border-radius: 50% 40% 0 0;
}

.mine-controls {
  padding: 15px 0;
}

.mine-controls p {
  margin: 0;
  flex: 1;
  font-weight: 700;
}

.mine[data-phase="pulling"] .rope,
.mine[data-phase="pulling"] .claw {
  transition-duration: 1.1s;
  transition-timing-function: cubic-bezier(0.25, 0.7, 0.25, 1);
}

.gold-reward {
  position: absolute;
  left: 50%;
  top: 85px;
  transform: translateX(-50%);
  color: #ffed8e;
  font-size: 1.65rem;
  font-weight: 900;
  text-shadow: 0 2px 4px #271d11;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.gold-reward.loss {
  color: #ffb3ac;
}

.gold-reward.show {
  animation: gold-bonus 1s ease-out forwards;
}

@keyframes gold-bonus {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.7); }
  30% { opacity: 1; transform: translate(-50%, -3px) scale(1.1); }
  100% { opacity: 1; transform: translate(-50%, -20px) scale(1); }
}

#gold-playfield {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#gold-playfield[aria-disabled="true"] {
  cursor: default;
}

#gold-playfield:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 4px;
}

/* Gold Dialog & Explanation Feedback Modal */
.gold-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: 85svh;
  overflow: auto;
  border: 2px solid var(--gold);
  border-bottom: 5px solid var(--gold-dark);
  border-radius: 24px;
  padding: 24px;
  color: var(--ink-strong);
  background: var(--surface);
  box-shadow: 0 24px 90px #071c4a66;
}

.gold-dialog::backdrop {
  background: #10213dcc;
  backdrop-filter: blur(3px);
}

.gold-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.gold-dialog > header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.gold-dialog > header button {
  flex-shrink: 0;
}

.gold-dialog .game-question {
  padding: 18px;
  margin: 12px 0 0;
  background: var(--surface-soft);
  border: 2px solid var(--border);
}

.gold-dialog .game-question h2 {
  font-size: 1.15rem;
}

.gold-dialog .answer-grid {
  grid-template-columns: 1fr;
}

.gold-dialog .answer-grid button {
  margin-top: 0;
}

.gold-dialog #gold-request-status {
  margin: 12px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.explanation-dialog {
  width: min(560px, calc(100% - 30px));
  max-height: 85svh;
  overflow: auto;
  border: 2px solid var(--border);
  border-bottom: 6px solid var(--border);
  border-radius: 26px;
  padding: 28px;
  text-align: center;
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: 0 20px 80px #061d4266;
}

.explanation-dialog::backdrop {
  background: #102642a6;
  backdrop-filter: blur(3px);
}

.explanation-dialog h2 {
  font-size: 1.55rem;
  margin: 14px 0 8px;
}

.explanation-dialog #explanation-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.65;
  font-weight: 600;
}

.explanation-badge {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 2.1rem;
  font-weight: 900;
  background: var(--green-soft);
  color: var(--green-dark);
  border: 3px solid var(--green);
}

.explanation-badge.incorrect {
  background: var(--red-soft);
  color: var(--red-dark);
  border-color: var(--red);
}

.explanation-badge.pending {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-color: var(--blue);
}

.explanation-points {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--green-dark);
  margin: 6px 0;
}

.explanation-points.loss {
  color: var(--red-dark);
}

.explanation-clock {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
}

.explanation-clock span {
  display: block;
  height: 100%;
  background: var(--green);
  transform-origin: left;
  animation: explanation-time 7s linear forwards;
}

@keyframes explanation-time {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Audio Controls */
.audio-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
}

.audio-controls button {
  font-size: 0.9rem;
  padding: 8px 14px;
  min-height: 42px;
}

.audio-controls button[aria-pressed="true"] {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-color: #84d8ff;
  border-bottom-color: var(--blue);
}

.audio-controls button[aria-pressed="false"] {
  background: var(--surface-soft);
  color: var(--muted);
  border-color: var(--border);
}

.audio-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.9rem;
  white-space: nowrap;
}

.audio-controls input {
  width: 120px;
  padding: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.audio-hint:empty {
  display: none;
}

.retry-hint {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  margin: 12px 0 0;
}

#game-time {
  font-weight: 800;
  color: var(--orange-dark);
}

#game-feedback:empty {
  display: none;
}

/* Matching & Multi-select inside games */
.matching-input {
  display: grid;
  gap: 10px;
  margin: 15px 0;
}

.matching-input label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0;
  padding: 12px 14px;
  background: var(--blue-soft);
  border: 2px solid #a8e2ff;
  border-radius: 14px;
  overflow-wrap: anywhere;
}

.game-question label.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.game-question label.option:has(input:checked) {
  background: var(--blue-soft);
  border-color: var(--blue);
  border-bottom-color: var(--blue-dark);
  color: var(--blue-ink);
}

.game-question label.option input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

#import-preview ol, #import-preview ul {
  max-height: 340px;
  overflow: auto;
  padding-right: 12px;
}

#import-preview li {
  margin: 8px 0;
}

@media (max-width: 760px) {
  .rank-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .gold-wallet {
    width: 100%;
  }

  .game-top {
    flex-wrap: wrap;
  }

  .game-top > div:nth-child(2) {
    order: 3;
    width: 100%;
  }

  .game-top h1 {
    font-size: 1.45rem;
  }

  .game-tile p {
    min-height: 0;
  }

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

  .puzzle-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 370px;
  }

  .memory-card {
    min-height: 110px;
    padding: 6px;
  }

  .card-face {
    font-size: 0.875rem;
    overflow-wrap: anywhere;
  }

  .mine {
    height: 360px;
  }

  .nugget-0 { left: calc(50% + 95px); top: 205px; }
  .nugget-1 { left: calc(50% + 40px); }
  .nugget-3 { left: calc(50% - 110px); }
  .nugget-4 { left: calc(50% - 165px); top: 205px; }

  .mine-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .miner-label {
    font-size: 0.9rem;
    max-width: 30%;
  }

  .fish-answer {
    animation-duration: 11s;
  }

  .rank-list li {
    gap: 8px;
    grid-template-columns: 40px 1fr auto;
  }
}

@media (max-width: 600px) {
  .fish-options { grid-template-columns: 1fr; }
  .gold-dialog { padding: 16px; }
  .gold-dialog > header { gap: 8px; }
  .gold-dialog > header h2 { font-size: 1.1rem; }
  .gold-dialog .game-question { padding: 14px; }
  .puzzle-board.split-puzzle { gap: 8px; padding: 8px; }
  .memory-side { padding: 7px; }
  .memory-half { grid-template-columns: 1fr; }
  .memory-side h2 { font-size: 1rem; padding: 7px 3px; }
  .memory-half .memory-card { min-height: 120px; }
  .fish-answer span.fish-letter { font-size: 2.6rem; }
  .audio-controls { gap: 8px; }
  .audio-controls label { flex: 1; }
  .audio-controls input { min-width: 70px; flex: 1; }
  .audio-hint { width: 100%; }
  .fish-school { height: 340px; }
  .fish-answer.swimming-fish { width: 135px; height: 62px; }
  .swimming-fish span.fish-letter { font-size: 2rem; }
}

@media (max-width: 500px) {
  .matching-input label {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fish-answer { animation: none; left: 15%; }
  .memory-card, .nugget, .rope, .claw, .swimming-fish svg { transition: none; }
  .gold-reward.show { animation: none; opacity: 1; }
  .mine[data-phase="pulling"] .rope, .mine[data-phase="pulling"] .claw { transition-duration: 0.01s; }
  .explanation-clock span { animation: none; }
}

/* Đảo phiêu lưu: hand-drawn characters, storybook scenery and tactile cards. */
.arcade-hub, .game-screen {
  --adventure-ink: #383654;
  --adventure-muted: #69647f;
  --adventure-purple: #8060ba;
  color: var(--adventure-ink);
}
.arcade-hub { max-width: 1160px; margin: auto; }
.arcade-hub .play-intro {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 280px; padding: 32px 44px; overflow: hidden; position: relative;
  background: radial-gradient(ellipse at 90% 10%, #c6f1e3 0, transparent 47%), #eee9fb;
  color: #383654; border: 2px solid #e1d8f3; border-bottom: 5px solid #d9ccec;
  border-radius: 32px; isolation: isolate;
}
.play-intro:after { content: ''; position: absolute; width: 430px; height: 160px; background: #fff8; border-radius: 50%; right: -90px; bottom: -100px; z-index: -1; }
.play-intro .eyebrow { color: #756096; letter-spacing: .12em; font-size: .8rem; }
.play-intro h1 { color: #383654; font-size: clamp(2rem, 3.5vw, 3.2rem); line-height: 1.15; letter-spacing: -.04em; margin: 12px 0; }
.play-intro h1 span { color: #8060ba; }
.play-intro p { color: #625c78; line-height: 1.7; font-weight: 600; }
.intro-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.intro-tags span { background: #fff9; border: 1px solid #dcd1ed; border-radius: 20px; padding: 5px 12px; color: #6b5689; font-size: .8rem; font-weight: 750; }
.intro-mascot { position: relative; width: 230px; flex-shrink: 0; margin: 4px 35px 0 20px; }
.intro-mascot > svg { width: 100%; filter: drop-shadow(0 10px 14px #8060ba20); animation: buddy-float 4s ease-in-out infinite; }
.mascot-speech { position: absolute; right: -40px; top: 0; background: #fff; color: #6c508d; padding: 9px 15px; border: 2px solid #e2d7f0; border-radius: 18px 18px 18px 3px; font-size: .875rem; font-weight: 800; transform: rotate(5deg); white-space: nowrap; }
.mascot-orbit { position: absolute; color: #d4a344; font-size: 2.5rem; animation: sparkle-pulse 3s ease-in-out infinite; }
.orbit-one { left: -25px; top: 5px; }.orbit-two { right: -16px; bottom: 15px; animation-delay: -1.5s; }
.adventure-picker { display: flex; align-items: center; gap: 18px; border: 2px solid #e7e1ef; border-bottom-width: 4px; border-radius: 22px; padding: 20px 24px; }
.picker-icon { width: 62px; flex-shrink: 0; }.picker-icon svg { width: 100%; display: block; }
.adventure-picker > div:last-child { flex: 1; min-width: 0; }
.adventure-picker label { font-weight: 800; margin: 0 0 6px; }
.adventure-picker select { margin: 0 0 5px; background-color: #faf8fe; border-color: #ddd4eb; color: #383654; }
.adventure-picker small { color: #69647f; }
.arcade-section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 26px 0 15px; }
.arcade-section-title h2 { margin: 0; font-size: 1.25rem; color: #383654; }
.arcade-section-title > span { font-size: .875rem; color: #777086; }
.game-menu { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.game-menu .game-tile { padding: 0; border: 2px solid #e2ddec; border-bottom: 5px solid #d5ccdf; border-radius: 26px; overflow: hidden; background: #fff; transition: transform .25s, box-shadow .25s; }
.game-menu .game-tile:hover { transform: translateY(-5px); box-shadow: 0 14px 28px #5c437d12; }
.tile-scene { height: 216px; position: relative; overflow: hidden; isolation: isolate; background: #dcf3eb; }
.tile-scene .scene-backdrop { inset: 0; }
.tile-scene .game-symbol { position: absolute; width: 155px; height: 145px; bottom: 10px; left: calc(50% - 96px); margin: 0; padding: 0; border: 0; background: none; z-index: 1; animation: buddy-float 4s ease-in-out infinite; }
.tile-scene .game-symbol > svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 4px #34345125); }
.fish .tile-scene .game-symbol { width: 180px; height: 125px; left: 15px; bottom: 25px; }
.gold .tile-scene { background: #4b406c; }.gold .tile-scene .game-symbol { height: 158px; bottom: 8px; left: 22px; }
.scene-companion { position: absolute; width: 100px; right: 6px; bottom: 12px; transform: rotate(8deg); animation: buddy-float 4.5s ease-in-out -2s infinite; }
.scene-companion svg { width: 100%; display: block; }.fish .scene-companion { bottom: 5px; right: 4px; width: 120px; }
.puzzle .scene-companion { width: 113px; }.gold .scene-companion { width: 100px; bottom: 27px; }
.garden-hills { position: absolute; inset: 0; background: #d9f0ec url('/puzzle.svg') center 40% / cover; }
.world-label { position: absolute; top: 16px; left: 16px; z-index: 2; background: #fffffff2; color: #514c6b; padding: 5px 12px; border-radius: 15px; font-size: .8rem; font-weight: 800; }
.scene-star { position: absolute; color: #fff5b7; font-size: 1.8rem; animation: sparkle-pulse 3s ease-in-out infinite; z-index: 1; }
.star-one { right: 25px; top: 68px; }.star-two { left: 25px; bottom: 17px; font-size: 1.3rem; animation-delay: -1.5s; }
.tile-copy { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.game-tag { color: #6d6880; font-size: .8rem; font-weight: 700; }
.game-tile h2 { color: #383654; margin-top: 8px; font-size: 1.55rem; }
.game-tile p { color: #69647f; font-size: .95rem; line-height: 1.7; min-height: 96px; margin: 0 0 22px; }
.game-tile button { background: #9875d0; border-bottom-color: #7553a8; border-radius: 14px; }
.game-tile.fish button { background: #329eb4; border-bottom-color: #257e92; }
.game-tile.gold button { background: #e8a83d; border-bottom-color: #bc802b; color: #402f16; }
.arcade-rules { margin-top: 23px; border: 1px solid #e3ddec; border-radius: 16px; padding: 14px 18px; color: #69647f; font-size: .875rem; background: #faf8fd; }
.arcade-rules summary { cursor: pointer; font-weight: 750; }.arcade-rules p { line-height: 1.8; }

/* Shared game HUD and scenery. */
.game-screen { max-width: 1120px; padding: 20px; border-radius: 30px; background: #f7f5fc; border: 1px solid #e9e2f3; }
.game-top { border-color: #e7e0ef; border-bottom: 4px solid #dfd5ec; border-radius: 22px; padding: 12px 16px; }
.game-heading { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; }
.game-heading > div { min-width: 0; }.game-heading small { display: block; overflow-wrap: anywhere; color: #69647f; }
.heading-character { width: 58px; height: 58px; flex-shrink: 0; }.heading-character svg { width: 100%; height: 100%; }
.game-top h1 { color: #383654; font-size: 1.4rem; }
.game-top .secondary { font-size: .875rem; padding: 10px 13px; }
.game-gold { display: flex; align-items: center; gap: 6px; background: #fff6db; border: 2px solid #efd89c; padding: 6px 12px 6px 5px; border-radius: 16px; color: #84602b; }
.wallet-icon { width: 45px; height: 35px; }.wallet-icon svg { width: 100%; height: 100%; }.game-gold strong { font-size: 1.3rem; }
.game-gold > div { white-space: nowrap; }
.audio-controls { background: #fffc; border: 1px solid #e7e0ef; border-radius: 16px; margin: 12px 0; padding: 9px 12px; }
.audio-controls button { border-radius: 12px; font-size: .8rem; padding: 7px 10px; }
.audio-controls button[aria-pressed="true"] { background: #eee8f9; color: #715195; border-color: #d7c6ed; border-bottom-color: #b89dd7; }
.audio-controls input { accent-color: #9875d0; }.audio-controls label { font-size: .8rem; color: #69647f; }
.journey-status { margin: 18px 2px 22px; }.journey-status p { margin: 0 0 8px; font-size: .875rem; font-weight: 750; color: #69647f; }
.journey-meter { height: 12px; background: #e8e1f1; border: 2px solid #e0d7eb; border-radius: 20px; overflow: hidden; }
.journey-meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #a788d8, #79c6b3); transition: width .65s cubic-bezier(.2,.8,.2,1); }
.scene-backdrop, .ambient-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene-art { width: 100%; height: 100%; display: block; }
.ambient-particles i { position: absolute; left: calc(5% + var(--i) * 11%); width: calc(5px + var(--i) * 1px); height: calc(5px + var(--i) * 1px); border: 2px solid #e9ffff7d; border-radius: 50%; bottom: -20px; animation: bubble-rise calc(8s + var(--i) * .7s) linear infinite; animation-delay: calc(var(--i) * -2.1s); }
.ambient-particles i:nth-child(1) { --i: 0; }.ambient-particles i:nth-child(2) { --i: 1; }.ambient-particles i:nth-child(3) { --i: 2; }
.ambient-particles i:nth-child(4) { --i: 3; }.ambient-particles i:nth-child(5) { --i: 4; }.ambient-particles i:nth-child(6) { --i: 5; }
.ambient-particles i:nth-child(7) { --i: 6; }.ambient-particles i:nth-child(8) { --i: 7; }.ambient-particles i:nth-child(9) { --i: 8; }
.cave-particles i { border: 0; background: #e3daff; width: 4px; height: 4px; box-shadow: 0 0 7px #c2b3ff; animation-duration: 12s; }
.character-eyes { transform-box: fill-box; transform-origin: center; animation: character-blink 6s infinite; }
.icon-spark { transform-box: fill-box; transform-origin: center; animation: sparkle-pulse 2.5s ease-in-out infinite; }

/* Vịnh bong bóng. */
.fish-question.card { border: 2px solid #d9e9ef; border-bottom: 4px solid #c4dee8; border-radius: 23px; padding: 20px 22px; }
.fish-question h2 { color: #383654; font-size: 1.25rem; margin: 10px 0; }.fish-question > small { color: #567282; font-weight: 700; }
.fish-options li { background: #f9fcff; border: 1px solid #e1eaf1; border-radius: 14px; align-items: center; padding: 10px 12px; }
.fish-options strong { display: grid; place-items: center; width: 32px; height: 32px; background: #ffdf9e; color: #76552e; border-radius: 10px; }
.fish-options .option-color-1 strong { background: #ffd3e5; color: #8c4874; }.fish-options .option-color-2 strong { background: #e2d9ff; color: #66528c; }
.fish-options .option-color-3 strong { background: #c1f0de; color: #357966; }.fish-options .option-color-4 strong { background: #c6ebff; }.fish-options .option-color-5 strong { background: #ffdac6; }
.aquarium { padding: 62px 10px 48px; border: 3px solid #78c6d7; border-bottom: 7px solid #4598af; border-radius: 28px; background: #65d7e3; box-shadow: inset 0 0 25px #fff3; }
.ocean-caption { position: absolute; top: 18px; left: 22px; color: #205b70; font-weight: 900; font-size: .9rem; }
.ocean-caption span { font-weight: 650; margin-left: 12px; font-size: .8rem; color: #276377; }
.water-surface { top: 7px; border: 0; height: 10px; background: radial-gradient(ellipse at 50% 0, #ecffff75 50%, transparent 53%) 0 0/65px 12px repeat-x; }
.fish-school { height: 330px; z-index: 1; }
.fish-answer.swimming-fish { height: 92px; width: 160px; max-width: 48%; overflow: visible; border-radius: 45%; }
.swimming-fish svg { filter: drop-shadow(0 7px 3px #217f9b30); }
.swimming-fish span.fish-letter { position: absolute; left: 49%; top: 58%; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: #fff6df; border: 2px solid #fff; box-shadow: 0 3px 0 #b17d3540; font-size: 1.15rem; font-weight: 900; color: #514361; text-shadow: none; transform: none; }
.swimming-fish.heading-right span.fish-letter { left: 28%; transform: none; }
.swimming-fish:hover, .swimming-fish:focus-visible { filter: drop-shadow(0 0 8px #fff9); }
.swimming-fish.caught { outline: 3px dashed #fff; outline-offset: 3px; }
.fish-tail { transform-box: fill-box; transform-origin: left center; animation: tail-wiggle 1.1s ease-in-out infinite; }

/* Vườn trí nhớ: illustrated two-sided cards. */
.puzzle-help { display: flex; align-items: center; gap: 12px; background: #fff; border: 2px solid #e6deef; border-radius: 20px; padding: 10px 16px; }
.puzzle-helper { width: 64px; flex-shrink: 0; }.puzzle-helper svg { width: 100%; display: block; }
.puzzle-help p { margin: 0; font-size: .9rem; color: #69647f; }.puzzle-help strong { display: block; color: #514469; font-size: 1rem; margin-bottom: 4px; }
#puzzle-preview:not(:empty) { border: 1px solid #d5c7ea; background: #eee7fa; color: #6d508f; font-size: .9rem; }
.puzzle-board.split-puzzle { position: relative; isolation: isolate; background: #d5f0df url('/puzzle.svg') center/cover no-repeat; border: 3px solid #b5d6b7; border-bottom: 6px solid #8fb794; padding: 16px; gap: 16px; border-radius: 26px; min-height: 450px; }
.memory-side { background: transparent; border: 0; padding: 0; border-radius: 18px; }.answer-side { background: transparent; }
.memory-side h2 { display: flex; align-items: center; justify-content: center; gap: 8px; background: #f2fbfff2; border: 2px solid #b5dced; color: #4a798e; padding: 7px; border-radius: 15px; font-size: 1rem; box-shadow: 0 3px 0 #80a8b72b; }
.memory-side h2 > span { width: 34px; height: 34px; }.memory-side h2 svg { width: 100%; height: 100%; }
.answer-side h2 { background: #fff5e8f2; border-color: #ebc59e; color: #966438; }
.memory-half { gap: 12px; }.memory-half .memory-card { min-height: 178px; padding: 12px; border-radius: 18px; border: 2px solid #8cbdd4; border-bottom: 5px solid #719bb2; box-shadow: 0 4px 10px #35474c14; transition: transform .25s, background .25s, box-shadow .25s; }
.question-side .memory-card { background: radial-gradient(circle at 10% 15%, #ffffff35 0 3px, transparent 4px) 0 0/24px 24px, #a6d5e9; border-bottom-color: #719bb2; }
.answer-side .memory-card { background: radial-gradient(circle at 10% 15%, #ffffff45 0 3px, transparent 4px) 0 0/24px 24px, #f7caa4; border-color: #dca87b; border-bottom-color: #bc8e69; }
.memory-card:before { content: ''; position: absolute; inset: 6px; border: 1px dashed #ffffffb3; border-radius: 12px; pointer-events: none; }
.memory-card:hover:not(:disabled) { transform: translateY(-3px) rotate(-1deg); filter: none; box-shadow: 0 7px 14px #35474c25; }
.memory-card:focus-visible { outline: 4px solid #77539c; outline-offset: 3px; }
.card-back { display: flex; align-items: center; justify-content: center; flex-direction: column; position: relative; width: 100%; font-size: 1rem; }
.card-back > svg { width: 96px; height: 100px; filter: drop-shadow(0 4px 0 #fff4); transition: transform .3s; }
.memory-card:hover .card-back > svg { transform: rotate(5deg); }
.card-corner { position: absolute; left: 0; top: -3px; color: #426c82; font-size: .875rem; font-weight: 900; }
.answer-side .card-corner { color: #926438; }.card-back-caption { font-size: .8rem; color: #3f657a; margin-top: 2px; font-weight: 800; }
.answer-side .card-back-caption { color: #835c38; }.card-mini-star { position: absolute; right: 0; bottom: 30px; color: #fff8ce; font-size: 1.1rem; }
.memory-side .memory-card.flipped { background: #fffffff5; color: #383654; border-color: #a1cddf; border-bottom-color: #80aabb; animation: card-turn .38s ease-out; }
.answer-side .memory-card.flipped { background: #fffaf4f7; color: #644b3a; border-color: #e8c39c; border-bottom-color: #c29c79; }
.memory-card.flipped:before { border-color: #d9e6ec; }.answer-side .memory-card.flipped:before { border-color: #e7d8c8; }
.memory-card.flipped .card-face { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 145px; gap: 10px; position: relative; line-height: 1.6; font-size: .95rem; }
.card-face-tag { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: #567689; font-weight: 800; }
.answer-side .card-face-tag { color: #926c48; }.card-face-flower { color: #acc5ba; font-size: 1.2rem; line-height: 1; }
.memory-card.mismatch { outline: 3px solid #ec8b9c; animation: gentle-shake .4s ease-in-out; }
.memory-card.matching { box-shadow: 0 0 20px #fff4b6; border-color: #fff0ab; }
.memory-half .memory-card.matched { visibility: hidden; }
.split-puzzle.completed { display: block; min-height: 0; padding: 0; overflow: hidden; background: #f5faee; }
.split-puzzle.completed .memory-side { display: none; }
.puzzle-reveal-art { display: block; width: 100%; height: auto; }
.puzzle-help[hidden], #puzzle-preview[hidden] { display: none; }
.puzzle-discovery { padding: 22px 20px 24px; text-align: center; background: #f5faee; }
.puzzle-discovery .eyebrow { color: #557b60; }.puzzle-discovery h2 { color: #3f6249; margin: 8px 0; font-size: 1.4rem; }
.puzzle-discovery p { color: #55765e; font-size: .9rem; margin: 0 0 15px; }
.puzzle-discovery button { background: #9875c6; border-bottom-color: #7551a1; }

/* Hang kho báu: Cú Mầm's crystal cavern. The hook origin stays at y=70. */
.mine { height: 440px; border: 3px solid #9581ad; border-bottom: 7px solid #6d5c8a; border-radius: 27px; background: linear-gradient(#d0eee9 0 66px, #b2cda9 66px 73px, #4d406d 73px); }
.mine > .scene-backdrop { top: 73px; }.mine > .ambient-particles { top: 90px; }
.miner-label { top: 13px; left: 18px; color: #486c66; font-size: .9rem; max-width: 30%; line-height: 1.35; z-index: 1; }
.miner-label > span { display: block; font-size: .75rem; font-weight: 650; margin-top: 2px; }
.miner-character { position: absolute; width: 82px; height: 82px; left: calc(50% - 103px); top: -6px; pointer-events: none; z-index: 1; }
.miner-character svg { width: 100%; height: 100%; }.helmet-light { animation: sparkle-pulse 3s ease-in-out infinite; }
.mine-clouds { position: absolute; top: 0; right: 4%; width: 28%; height: 60px; background: radial-gradient(ellipse at 20% 15%, #fff9 0 14px, transparent 15px), radial-gradient(ellipse at 70% 60%, #fff9 0 32px, transparent 33px); pointer-events: none; }
.winch { background: #a28bc4; border: 5px solid #e5d4f4; width: 52px; height: 41px; top: 29px; border-radius: 13px; box-shadow: 0 4px 0 #88739e; }
.winch > span { position: absolute; inset: 6px; border-radius: 50%; border: 3px solid #6d5b89; background: repeating-linear-gradient(0deg,#d7c6a7 0 3px,#a99a85 3px 5px); }
.mine[data-phase="lowering"] .winch > span, .mine[data-phase="pulling"] .winch > span { animation: winch-spin 1s linear infinite; }
.rope { width: 4px; background: repeating-linear-gradient(0deg, #fff0ce 0 5px, #ccaf82 5px 8px); box-shadow: 1px 0 2px #191d4533; }
.claw { border-color: #e7e6f5; box-shadow: 0 3px 2px #1a16394d; }
.nugget { z-index: 1; filter: drop-shadow(0 5px 4px #1b173e77); transition: opacity .3s, transform .5s; }
.nugget > svg { overflow: visible; }.nugget:not(.hooked) .icon-spark { animation-duration: 3s; }
.nugget.hooked { filter: drop-shadow(0 0 12px #ffe092); }
.mystery-chest { filter: drop-shadow(0 0 9px #d0a7f399); }
.mine-touch-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); color: #e0d5f2; background: #25243c99; border: 1px solid #a18db759; border-radius: 20px; padding: 5px 14px; white-space: nowrap; font-size: .75rem; font-weight: 700; pointer-events: none; }
.mine:not([data-phase="aiming"]) .mine-touch-hint { opacity: 0; }
.mine-controls { gap: 16px; padding: 16px 4px 0; align-items: center; }.mine-controls p { font-size: .875rem; color: #69647f; line-height: 1.7; }
.loot-guide { display: flex; gap: 8px; flex-shrink: 0; }.loot-guide > span { display: flex; align-items: center; gap: 3px; background: #fff; padding: 5px 10px 5px 5px; border: 1px solid #e5ddec; border-radius: 13px; font-size: .875rem; font-weight: 800; color: #74618b; }
.loot-guide svg { width: 36px; height: 28px; }
.gold-dialog, .explanation-dialog { border-color: #dccbe9; border-bottom-color: #b69bcf; border-radius: 28px; background: #fffdfd; }
.gold-dialog::backdrop, .explanation-dialog::backdrop { background: #2b254d9e; backdrop-filter: blur(5px); }
.gold-dialog[open], .explanation-dialog[open] { animation: dialog-pop .3s cubic-bezier(.2,.8,.2,1); }
.dialog-companion { width: 56px; height: 60px; flex-shrink: 0; }.dialog-companion svg { width: 100%; height: 100%; }
.gold-dialog > header { gap: 10px; }.gold-dialog > header h2 { flex: 1; color: #55406f; }
.gold-dialog > header button { padding: 8px 10px; font-size: .8rem; }
.gold-dialog .game-question { background: #f9f6fc; border-color: #e7dfef; border-radius: 18px; }
.gold-dialog .answer-grid button { border-color: #e0d7ec; border-bottom-color: #c9b8df; color: #4b405e; border-radius: 14px; }
.gold-dialog .answer-grid button:hover:not(:disabled) { background: #eee6fa; border-color: #bda0db; color: #634082; }
.explanation-character { width: 105px; height: 100px; margin: 0 auto; }.explanation-character svg { width: 100%; height: 100%; }
.explanation-badge { position: relative; width: 35px; height: 35px; font-size: 1.1rem; border-width: 2px; margin: -14px auto 0; background: #e4f5ec; border-color: #80bea3; color: #458267; }
.explanation-dialog h2 { color: #55406f; }.explanation-points { color: #42876d; }.explanation-clock span { background: #ad91cd; }
.explanation-dialog[data-result="incorrect"] .explanation-clock span { background: #eaa2b2; }
.game-finish { position: relative; overflow: hidden; background: radial-gradient(ellipse at top, #f3eafa, #fff 70%); border: 2px solid #e0d3ed; border-bottom: 5px solid #ccbadf; border-radius: 25px; }
.finish-friends { display: flex; justify-content: center; align-items: end; gap: 6px; margin: 0 auto 22px; }
.finish-friends svg { width: 100px; height: 110px; animation: buddy-float 3s ease-in-out infinite; }.finish-friends svg:nth-child(2) { width: 130px; height: 140px; animation-delay: -.8s; }.finish-friends svg:nth-child(3) { animation-delay: -1.5s; }
.game-finish h2 { color: #55406f; }.finish-score strong { color: #a77b2c; font-size: 1.6rem; }

/* Short-lived feedback particles never block the controls. */
.game-burst { position: absolute; left: 50%; top: 35%; pointer-events: none; z-index: 10; width: 0; height: 0; }
.game-burst i { position: absolute; width: 12px; height: 12px; background: #ffe09a; clip-path: polygon(50% 0,62% 35%,100% 50%,62% 63%,50% 100%,37% 63%,0 50%,37% 35%); animation: particle-burst 1.2s cubic-bezier(.15,.65,.3,1) forwards; }
.game-burst i:nth-child(3n) { background: #c8a5ee; }.game-burst i:nth-child(3n+1) { background: #97e0ce; }
.game-burst.confetti i { clip-path: none; width: 8px; height: 13px; border-radius: 2px; }
.game-burst.bubbles-burst i { clip-path: none; border: 2px solid #eaffff; border-radius: 50%; background: #c6ffff55; }
@keyframes buddy-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes sparkle-pulse { 0%,100% { opacity: .55; scale: .85; } 50% { opacity: 1; scale: 1.1; } }
@keyframes character-blink { 0%,44%,48%,100% { scale: 1 1; } 46% { scale: 1 .1; } }
@keyframes tail-wiggle { 0%,100% { rotate: -4deg; } 50% { rotate: 5deg; } }
@keyframes bubble-rise { from { translate: 0 0; opacity: 0; } 12% { opacity: .7; } to { translate: 18px -480px; opacity: 0; } }
@keyframes card-turn { from { transform: perspective(700px) rotateY(75deg) scale(.96); } to { transform: perspective(700px) rotateY(0) scale(1); } }
@keyframes gentle-shake { 0%,100% { translate: 0; } 25%,75% { translate: -4px; } 50% { translate: 4px; } }
@keyframes dialog-pop { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes winch-spin { to { rotate: 360deg; } }
@keyframes particle-burst { 0% { opacity: 0; transform: translate(0,0) scale(.2); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx),var(--dy)) rotate(var(--spin)) scale(.4); } }
@media (max-width: 1100px) {
  .game-menu { gap: 14px; }.tile-copy { padding: 18px; }.game-tile p { font-size: .9rem; }
  .tile-scene .game-symbol { width: 135px; left: 10px; }.scene-companion { width: 86px; right: -8px; }.puzzle .scene-companion { width: 96px; }
  .fish .tile-scene .game-symbol { width: 150px; left: 2px; }.fish .scene-companion { width: 100px; }.gold .tile-scene .game-symbol { left: 0; }
}
@media (max-width: 760px) {
  .arcade-hub .play-intro { padding: 25px; min-height: 240px; }.intro-mascot { width: 160px; margin: 20px 10px 0; }.mascot-speech { right: -12px; top: -18px; font-size: .75rem; }
  .game-menu { grid-template-columns: 1fr; gap: 18px; }.game-menu .game-tile { display: grid; grid-template-columns: 42% 58%; }.tile-scene { height: 100%; min-height: 255px; }
  .game-tile p { min-height: 0; margin-bottom: 16px; }.tile-scene .game-symbol { left: calc(50% - 72px); bottom: 55px; }.scene-companion { right: 2px; bottom: 12px; }
  .fish .tile-scene .game-symbol { left: calc(50% - 75px); bottom: 80px; }.gold .tile-scene .game-symbol { left: calc(50% - 70px); bottom: 55px; }
  .gold .scene-companion { bottom: 20px; }.world-label { left: 10px; top: 12px; font-size: .75rem; padding: 5px 9px; }
  .arcade-section-title > span { display: none; }.game-screen { padding: 12px; border-radius: 24px; }
  .game-top .game-heading { order: 3; flex: 1 0 100%; width: 100%; }.game-top { gap: 10px; }.game-top > .game-gold { width: auto; order: 0; }
  .fish-question.card { padding: 16px; }.fish-school { height: 300px; }.aquarium { padding: 58px 7px 48px; }
  .mine { height: 390px; }.mine-controls { flex-wrap: wrap; align-items: start; }.loot-guide { width: 100%; }
  .memory-half .memory-card { min-height: 170px; }.memory-card.flipped .card-face { min-height: 137px; font-size: .9rem; }
  .puzzle-board.split-puzzle { padding: 10px; gap: 10px; }.memory-half { gap: 9px; }
}
@media (max-width: 500px) {
  .arcade-hub .play-intro { padding: 23px 20px; min-height: 270px; align-items: flex-start; }.play-intro h1 { font-size: 2rem; }.play-intro p { font-size: .875rem; max-width: 210px; }
  .intro-mascot { width: 105px; position: absolute; right: 3px; bottom: 45px; margin: 0; }.mascot-speech { top: -14px; right: 0; font-size: .65rem; padding: 5px 8px; }.mascot-orbit { font-size: 1.4rem; }.orbit-one { left: -6px; top: -25px; }.intro-tags { max-width: 230px; gap: 5px; }.intro-tags span { font-size: .7rem; padding: 4px 9px; }
  .adventure-picker { padding: 16px; gap: 10px; }.picker-icon { display: none; }.adventure-picker label { font-size: .95rem; }.adventure-picker select { font-size: .9rem; }.adventure-picker small { font-size: .8rem; }
  .game-menu .game-tile { display: flex; }.tile-scene { height: 205px; min-height: 0; }.tile-copy { padding: 20px; }.game-tile p { font-size: .95rem; }
  .tile-scene .game-symbol { width: 160px; left: calc(50% - 100px); bottom: 10px; }.fish .tile-scene .game-symbol { width: 180px; left: 25px; bottom: 25px; }.gold .tile-scene .game-symbol { left: 22px; bottom: 5px; }
  .scene-companion, .puzzle .scene-companion { width: 115px; right: 14px; bottom: 3px; }.fish .scene-companion { width: 130px; right: 4px; }.gold .scene-companion { width: 110px; bottom: 30px; }
  .game-screen { padding: 9px; }.heading-character { width: 48px; height: 48px; }.game-top { padding: 12px; }.game-gold { padding-right: 8px; }.game-gold strong { font-size: 1.1rem; }.wallet-icon { width: 36px; }
  .game-top .game-heading small { font-size: .8rem; }.audio-controls label { flex: 1 0 100%; }.audio-controls input { width: auto; }.audio-controls button { flex: 1; }
  .ocean-caption { left: 15px; }.ocean-caption span { display: block; margin: 3px 0 0; }.aquarium { padding-top: 76px; }.fish-school { height: 350px; }
  .fish-answer.swimming-fish { width: 128px; height: 80px; }.swimming-fish span.fish-letter { width: 29px; height: 29px; font-size: 1rem; }
  .fish-options { gap: 8px; }.fish-options li { padding: 9px; font-size: .9rem; }.fish-options strong { width: 28px; height: 28px; }
  .puzzle-helper { width: 46px; }.puzzle-help { padding: 10px; gap: 8px; }.puzzle-help p { font-size: .8rem; }.puzzle-help strong { font-size: .9rem; }
  .memory-half { grid-template-columns: 1fr; }.memory-side h2 { font-size: .875rem; gap: 3px; }.memory-side h2 > span { width: 28px; height: 28px; }
  .puzzle-discovery { padding: 18px 14px 20px; }.puzzle-discovery h2 { font-size: 1.15rem; }
  .memory-half .memory-card { min-height: 165px; padding: 10px; }.memory-card.flipped .card-face { min-height: 135px; }.card-back > svg { width: 88px; height: 95px; }
  .miner-label { font-size: .75rem; left: 10px; max-width: 27%; }.miner-label span { font-size: .65rem; }.miner-character { width: 69px; left: calc(50% - 88px); top: 4px; }
  .mine { height: 380px; }.mine-touch-hint { font-size: .65rem; padding: 4px 8px; }.dialog-companion { width: 40px; }.gold-dialog { padding: 16px; }.gold-dialog > header h2 { font-size: 1rem; }
  .finish-friends svg { width: 75px; }.finish-friends svg:nth-child(2) { width: 95px; }.game-finish { padding: 30px 15px; }.game-finish button { display: block; width: 100%; margin: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .arcade-hub *, .game-screen *, .gold-dialog *, .explanation-dialog * { animation: none !important; transition: none !important; }
  .game-burst { display: none; }.ambient-particles i { bottom: calc(12% + var(--i) * 8%); opacity: .4; }
  .game-menu .game-tile:hover, .memory-card:hover:not(:disabled) { transform: none; }
}
