html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #67c1d7;
}

.ta-page,
.ta-card {
  width: 100%;
  margin: 0;
  padding: 0;
}

.treasure-add-game {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 10%, rgba(255,255,255,0.22), transparent 24%),
    linear-gradient(180deg, #7fe0f5 0%, #52c5e1 11%, #ecd6a3 11%, #e6c77e 100%);
}

.ta-sky-band {
  position: absolute;
  inset: 0 0 auto;
  height: 16%;
  background:
    radial-gradient(circle at 18% 38%, rgba(255,255,255,0.18), transparent 18%),
    radial-gradient(circle at 82% 24%, rgba(255,255,255,0.14), transparent 16%),
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
}

.ta-map-rim {
  position: absolute;
  inset: 11% 4% 22%;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0)),
    radial-gradient(circle at top, rgba(255,255,255,0.1), transparent 32%),
    linear-gradient(180deg, #f5e1ad 0%, #e6c77e 100%);
  border: 2px solid rgba(124, 88, 34, 0.2);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.18),
    0 18px 30px rgba(15, 23, 42, 0.14);
}

.ta-map-crease {
  position: absolute;
  background: rgba(124, 88, 34, 0.08);
  pointer-events: none;
}

.ta-map-crease--v {
  top: 14%;
  bottom: 26%;
  left: 50%;
  width: 2px;
}

.ta-map-crease--h {
  left: 8%;
  right: 8%;
  top: 42%;
  height: 2px;
}

.ta-hud {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 8;
  flex-wrap: wrap;
  justify-content: center;
}

.ta-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ta-map-area {
  position: absolute;
  inset: 15% 7% 24%;
  z-index: 4;
}

.ta-route-map,
.ta-route-lines,
.ta-route-decor {
  position: absolute;
  inset: 0;
}

.ta-step-line {
  position: absolute;
  height: 6px;
  transform-origin: 0 50%;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(124, 88, 34, 0.76) 0 16px,
      rgba(124, 88, 34, 0) 16px 26px
    );
  opacity: 0.8;
}

.ta-waypoint-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(124, 88, 34, 0.92);
  border: 3px solid rgba(255,255,255,0.72);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.12);
}

.ta-target-x {
  position: absolute;
  font-size: clamp(2.8rem, 10vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  color: rgba(164, 28, 36, 0.88);
  text-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  transform: translate(-50%, -50%) rotate(-9deg);
  z-index: 2;
  opacity: 1;
  pointer-events: none;
}

.ta-player-marker {
  position: absolute;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  transition: left 0.34s ease, top 0.34s ease, transform 0.18s ease;
  z-index: 3;
  pointer-events: none;
}

.ta-player-marker .composite-racer {
  width: 100%;
  height: 100%;
}

.ta-player-marker .composite-racer {
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.18));
}

.ta-player-marker .composite-racer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ta-player-marker.is-advancing {
  transform: translate(-50%, -50%) scale(1.08);
}

.ta-treasure-chest-wrap {
  position: absolute;
  width: 108px;
  height: 108px;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
}

.ta-palm-tree {
  position: absolute;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.14));
}

.ta-treasure-chest-wrap.is-visible {
  opacity: 1;
}

.ta-treasure-chest-wrap.is-opening {
  animation: chestHop 0.46s ease;
}

.ta-treasure-chest {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.16));
}

.ta-reward-coin-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.ta-reward-coin {
  position: fixed;
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
  z-index: 1200;
  animation: treasureCoinFlight 0.85s cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}

@keyframes treasureCoinFlight {
  0% {
    opacity: 0;
    transform: translate(var(--coin-start-x), var(--coin-start-y)) scale(0.7);
  }
  12% {
    opacity: 1;
    transform: translate(var(--coin-start-x), var(--coin-start-y)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--coin-end-x), var(--coin-end-y)) scale(0.56);
  }
}

@keyframes chestHop {
  0% { transform: translate(-50%, -50%) scale(0.92); }
  35% { transform: translate(-50%, -60%) scale(1.04); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.problem-ui {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translateX(-50%);
  width: min(94vw, 560px);
  text-align: center;
  z-index: 10;
}

.problem-kicker {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 900;
  color: rgba(61, 40, 13, 0.58);
  margin-bottom: 8px;
}

.problem-text {
  color: #2f2008;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow: 0 4px 10px rgba(255, 255, 255, 0.32);
  margin-bottom: 16px;
}

.answers {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
  align-items: start;
  min-height: 80px;
  width: 100%;
}

.answers--1 .answer-btn {
  width: clamp(124px, 28vw, 148px);
}

.answers--2 .answer-btn,
.answers--3 .answer-btn,
.answers--4 .answer-btn {
  width: clamp(72px, 15vw, 104px);
}

.answer-btn {
  width: clamp(72px, 15vw, 104px);
  min-height: 62px;
  padding: 14px 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe38f, #ffb703);
  color: #402400;
  font-size: 1.18rem;
  font-weight: 900;
  box-shadow: 0 6px 0 #d48e00, 0 8px 20px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}

.answer-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #ffe9a8, #ffbd1d);
}

.answer-btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #d48e00, 0 5px 14px rgba(15, 23, 42, 0.16);
}

.answer-btn.disabled {
  opacity: 0.45;
  filter: grayscale(1);
  pointer-events: none;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-0.5deg); }
  40% { transform: translateX(8px) rotate(0.4deg); }
  60% { transform: translateX(-6px) rotate(-0.3deg); }
  80% { transform: translateX(5px) rotate(0.2deg); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.2s ease-out;
}

.results-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.64);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 76px 16px 24px;
}

.results-panel {
  position: relative;
  max-width: 460px;
  width: min(100%, 460px);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 26px 22px 20px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(250, 204, 21, 0.16), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--bg-panel) 100%);
  border: 1px solid rgba(250, 204, 21, 0.18);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.32);
  animation: resultsPop 0.25s ease-out;
}

@keyframes resultsPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.results-header {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  margin-bottom: 10px;
}

.results-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--muted);
}

#resultsTitle {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  color: #1f2937;
}

.results-meta {
  font-size: 0.98rem;
  color: #4b5563;
}

.results-home-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  padding: 6px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(148, 163, 184, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.results-home-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.results-home-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.results-home-icon:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.result-box {
  border-radius: 18px;
  padding: 14px 14px 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

.result-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: #1f2937;
}

.result-value--coins {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.result-coin-icon {
  width: 18px;
  height: 18px;
}

.results-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

#playAgainBtn {
  min-width: 170px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe38f, #ffb703);
  box-shadow: 0 6px 0 #d48e00, 0 14px 26px rgba(15, 23, 42, 0.14);
  color: #402400;
}

#playAgainBtn:hover {
  background: linear-gradient(180deg, #ffe9a8, #ffbd1d);
}

.ad-results {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 58px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

body.game-mode .site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

body.game-mode footer {
  display: none;
}

body.game-mode .site-header .site-wrapper {
  padding: 6px 0;
}

body.game-mode .logo img {
  height: 40px;
}

body.game-mode .avatar {
  width: 32px;
  height: 32px;
}

body.game-mode .coins {
  padding: 4px 8px;
  font-size: 0.85rem;
}

body.game-mode .coin-icon {
  width: 9px;
  height: 9px;
}

@media (max-width: 700px) {
  .ta-map-rim {
    inset: 12% 4% 21%;
    border-radius: 28px;
  }

  .ta-map-crease--v {
    top: 16%;
    bottom: 25%;
  }

  .ta-map-area {
    inset: 16% 5% 24%;
  }

  .ta-hud {
    top: 62px;
    gap: 6px;
  }

  .ta-pill {
    font-size: 0.75rem;
    padding: 7px 10px;
  }

  .ta-player-marker {
    width: 44px;
    height: 44px;
  }

  .ta-treasure-chest-wrap {
    width: 88px;
    height: 88px;
  }

  .ta-palm-tree {
    width: 78px;
    height: 78px;
  }

  .problem-ui {
    bottom: 4%;
  }

  .results-overlay {
    align-items: flex-start;
    padding: 62px 10px 10px;
    overflow-y: auto;
  }

  .results-panel {
    width: min(100%, 400px);
    max-height: calc(100vh - 72px);
    padding: 18px 14px 12px;
    border-radius: 22px;
    overflow-y: auto;
  }

  .results-home-icon {
    top: 12px;
    right: 12px;
  }

  .results-grid {
    gap: 8px;
    margin: 10px 0 12px;
  }

  .result-box {
    padding: 10px 10px 9px;
    border-radius: 14px;
  }

  .result-label {
    font-size: 0.62rem;
    color: #6b7280;
    margin-bottom: 6px;
  }

  .result-value {
    font-size: 1.16rem;
    color: #1f2937;
  }
}
