/* Price: a green card, one big number you drag. */
.gamecard.price {
  --green: #0B6B4F;
  --mint: #B8F2D8;
  container-type: size;
  color: #FFFFFF;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(184, 242, 216, 0.2), transparent 60%),
    var(--green);
}

.play, .screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 22px;
}

/* HUD: round dots on the left, the running total on the right */
.hud { display: flex; justify-content: space-between; align-items: flex-start; }
.rounds { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.dots { display: flex; gap: 5px; margin: 0; padding: 0; list-style: none; }
.dots li { width: 22px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.2); transition: background-color 300ms ease, width 300ms cubic-bezier(.2,.8,.2,1); }
.dots li.done { background: var(--mint); }
.dots li.now { width: 34px; background: #FFFFFF; }
.round { margin: 0; font-size: 13px; font-weight: 600; opacity: 0.7; }
.total { margin: 0; display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; line-height: 0.9; letter-spacing: -0.05em; }
.total span:first-child { display: inline-block; font-size: clamp(44px, 13cqw, 60px); font-variant-numeric: tabular-nums; transform-origin: right center; }
.total-label { margin-top: 4px; font-size: 13px; font-weight: 600; letter-spacing: 0; opacity: 0.7; }
.total.pop span:first-child { animation: pop 420ms cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { 30% { transform: scale(1.18); } }

.question { margin-top: 22px; }
.kind { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }
.ask { margin: 6px 0 0; font-size: clamp(26px, 7.4cqw, 32px); font-weight: 700; line-height: 1.05; letter-spacing: -0.04em; text-wrap: balance; }
.hint { margin: 10px 0 0; font-size: 15px; font-weight: 500; opacity: 0.75; }

/* The guess */
.guess { flex: 1; display: flex; flex-direction: column; padding-bottom: 6px; }
.readout { position: relative; margin: auto 0; padding: 12px 0; }
.local { margin: 10px 0 0; font-size: 18px; font-weight: 600; opacity: 0.8; font-variant-numeric: tabular-nums; }
.price-big {
  margin: 0;
  font-size: clamp(72px, 24cqw, 112px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.reveal-line { min-height: 1.4em; margin: 8px 0 0; font-size: 16px; font-weight: 700; color: var(--mint); }
.guess .track { margin-top: 40px; }

/* The verdict stamp: "Bullseye", "Close", "Way off" */
.verdict {
  position: absolute;
  right: 0; top: 0;
  margin: 0;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--green);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: rotate(6deg) scale(0.4);
  pointer-events: none;
}
.verdict.show { animation: stamp 520ms cubic-bezier(.2,.9,.3,1.5) forwards; }
.verdict.off { background: #FFFFFF; color: #B42318; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(14deg) scale(1.8); } 60% { opacity: 1; transform: rotate(5deg) scale(0.94); } 100% { opacity: 1; transform: rotate(6deg) scale(1); } }

.track { position: relative; height: 44px; }
.slider {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: grab;
}
.slider:active { cursor: grabbing; }
.slider::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); }
.slider::-moz-range-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px; height: 34px;
  margin-top: -12px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(255, 255, 255, 0.18);
  transition: transform 120ms ease;
}
.slider:active::-webkit-slider-thumb { transform: scale(1.12); }
.slider::-moz-range-thumb {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(255, 255, 255, 0.18);
}
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px #FFFFFF, 0 0 0 7px var(--green); }
.slider:disabled { cursor: default; }
.slider:disabled::-webkit-slider-thumb { opacity: 0; }
.slider:disabled::-moz-range-thumb { opacity: 0; }

/* After locking in: your guess and the real price as pins on the track */
.marker { position: absolute; top: 50%; left: var(--x, 50%); width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; opacity: 0; transform: scale(0.4); transition: opacity 260ms ease, transform 360ms cubic-bezier(.2,.9,.3,1.4), left 500ms cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.marker.you { background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
.marker.real { background: var(--mint); box-shadow: 0 0 0 4px rgba(184, 242, 216, 0.35); }
.marker.real b { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 8px; background: var(--mint); color: var(--green); font-size: 13px; font-weight: 700; white-space: nowrap; }
.revealed .marker { opacity: 1; transform: none; }
/* The US price as a fixed reference on the track */
.ref { position: absolute; top: 50%; left: var(--x, 50%); width: 3px; height: 22px; margin: -11px 0 0 -1.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); pointer-events: none; }
.ref b { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; white-space: nowrap; opacity: 0.75; }
.revealed .ref { opacity: 0.4; }

.scale { display: flex; justify-content: space-between; margin-top: 20px; font-size: 13px; font-weight: 600; opacity: 0.6; }

.actions { display: grid; margin-top: 18px; }
.actions .pill { min-height: 56px; font-size: 17px; }
.pill.white { --edge: #8CCFB0; color: var(--green); }
.key { margin-left: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(11, 107, 79, 0.1); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Start and result */
.screen { justify-content: space-between; z-index: 2; background: inherit; }
.s-kicker { margin: 0; font-size: 13px; font-weight: 600; opacity: 0.75; }
.s-title { margin: 6px 0 14px; font-size: clamp(64px, 20cqw, 92px); font-weight: 800; line-height: 0.85; letter-spacing: -0.07em; }
.s-text { margin: 0 0 10px; max-width: 30ch; font-size: 16px; font-weight: 500; line-height: 1.4; opacity: 0.85; }
.s-note { margin: 12px 0 0; display: inline-block; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.14); font-size: 14px; font-weight: 600; }

.price .chips:not(:empty) { margin-bottom: 14px; }
.anchor { margin-top: 4px; }
.anchor-big { margin: 0; font-size: clamp(80px, 26cqw, 120px); font-weight: 800; line-height: 0.85; letter-spacing: -0.065em; color: var(--mint); }
.anchor-k { margin: 12px 0 0; max-width: 28ch; font-size: 17px; font-weight: 600; line-height: 1.35; opacity: 0.85; }

.s-big { margin: 6px 0 0; display: flex; align-items: baseline; gap: 10px; font-weight: 800; line-height: 0.85; letter-spacing: -0.07em; }
.s-big span:first-child { font-size: clamp(72px, 22cqw, 104px); font-variant-numeric: tabular-nums; }
.s-big-unit { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; opacity: 0.7; }
.s-zone { margin: 14px 0 14px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }

.recap { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.recap li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); font-size: 14px; }
.recap .what { font-weight: 600; }
.recap .what small { display: block; font-weight: 500; opacity: 0.7; font-size: 13px; }
.recap .pts { font-weight: 800; font-size: 18px; letter-spacing: -0.03em; }
.recap .pts.great { color: var(--mint); }

.s-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.s-actions .pill { min-height: 54px; }

/* ---------- The counter stage and the side panel ---------- */
.gamecard.price { display: grid; grid-template-rows: 40% 1fr; }
.side-area { position: relative; min-height: 0; }
@media (min-width: 900px) {
  .gamecard.price { grid-template-rows: 1fr; grid-template-columns: 1.05fr 1fr; }
  .play, .screen { padding: 40px 48px 36px 24px; }
  .screen { justify-content: center; gap: 28px; }
  .s-title { font-size: 120px; }
  .ask { font-size: 38px; }
}

.gamecard.price { background: radial-gradient(60% 60% at 26% 45%, rgba(184, 242, 216, 0.2), transparent 70%), var(--green); }
.stage { position: relative; overflow: hidden; }
.counter { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: rgba(0, 0, 0, 0.12); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.1); }
.where { position: absolute; top: 24px; left: 28px; z-index: 2; display: flex; align-items: center; gap: 12px; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.flag { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 6px 14px rgba(0, 0, 0, 0.25); }

/* The item stands on the counter, slightly left of centre so the tag can hang to its right */
.item { position: absolute; z-index: 1; left: 38%; bottom: calc(26% - 10px); width: min(48%, 380px); transform: translateX(-50%); }
.item svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.2)); }

/* The price tag hanging off the item on a string */
.string { position: absolute; top: 18%; left: 86%; width: 22%; height: 2px; background: rgba(255, 255, 255, 0.85); transform-origin: left center; transform: rotate(22deg); }
.tag {
  position: absolute;
  top: 22%; left: 104%;
  display: flex; flex-direction: column; align-items: flex-start;
  min-width: 160px;
  padding: 14px 20px 14px 32px;
  background: #FFFFFF;
  color: var(--green);
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%);
  border-radius: 6px;
  transform: rotate(-7deg);
  transform-origin: 0% 50%;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.25));
}
.tag-hole { position: absolute; left: 13px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--green); }
.tag-k { font-size: 12px; font-weight: 700; color: #4F8A74; }
.tag-price { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.tag-local { margin-top: 2px; font-size: 13px; font-weight: 600; color: #4F8A74; font-variant-numeric: tabular-nums; }
.tag-stamp { position: absolute; z-index: 3; left: 150%; top: 10%; padding: 7px 12px; border-radius: 12px; background: var(--mint); color: var(--green); font-size: 16px; font-weight: 800; white-space: nowrap; transform: rotate(10deg) scale(0.4); opacity: 0; box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.35); }
.tag-stamp.show { animation: stamp 520ms cubic-bezier(.2,.9,.3,1.5) forwards; }
.tag-stamp.off { background: #FDE3E0; color: #B42318; }
.tag.real { background: var(--mint); }

@media (prefers-reduced-motion: no-preference) {
  .tag { animation: sway 4s ease-in-out infinite; }
  .tag.swing { animation: swing 380ms cubic-bezier(.3,.8,.3,1.4); }
  .stage.arrive .item { animation: slide-in 600ms cubic-bezier(.2,.8,.2,1); }
  .stage.arrive .where { animation: rise 500ms cubic-bezier(.2,.8,.2,1); }
}
@keyframes sway { 50% { transform: rotate(-4deg); } }
@keyframes swing { 30% { transform: rotate(-12deg); } 70% { transform: rotate(-4deg); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-30px) scale(0.95); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Phones: a shorter counter, the tag tucked in */
@media (max-width: 899px) {
  .where { top: 14px; left: 16px; font-size: 18px; }
  .flag { width: 34px; height: 34px; }
  .item { left: 28%; width: min(38%, 170px); }
  .tag { left: 100%; top: 6%; min-width: 128px; padding: 9px 14px 9px 26px; }
  .tag-price { font-size: 32px; }
  .tag-local { font-size: 12px; }
  .tag-stamp { left: 135%; top: -6%; font-size: 13px; }
}
/* Phones: the button must always be on screen. Shorter phones (most of them once the browser's bars take their
   share) get a slightly smaller picture and a tighter panel; on a tiny screen the panel scrolls as a last resort
   rather than cutting the button off. */
@media (max-width: 899px) {
  .play, .screen { overflow-y: auto; overscroll-behavior: contain; }
}
/* On every phone the panel keeps its text and spacing tight: the longest questions ("Rent and bills that cost $100
   in the US...") need it even on a tall iPhone. Tall phones keep a bigger picture. */
@media (max-width: 899px) {
  .gamecard.price { grid-template-rows: 34% 1fr; }
  .play { padding: 14px 20px 14px; }
  .total span:first-child { font-size: 40px; }
  .question { margin-top: 10px; }
  .ask { font-size: 24px; }
  .hint { margin-top: 8px; font-size: 14px; }
  .reveal-line { margin-top: 4px; }
  .guess .track { margin-top: 14px; }
  .scale { margin-top: 10px; }
  .actions { margin-top: 10px; }
  .actions .pill { min-height: 52px; }
}
@media (max-width: 899px) and (max-height: 780px) {
  .gamecard.price { grid-template-rows: 28% 1fr; }
  .item { left: 32%; width: min(30%, 140px); }
}
/* Very short phones (Android with bigger system text or the three-button bar): a smaller picture and tighter text */
@media (max-width: 899px) and (max-height: 660px) {
  .gamecard.price { grid-template-rows: 24% 1fr; }
  /* Just the flag: the question already names the country, and the name would sit on the picture */
  .where { top: 10px; left: 14px; }
  .where span { display: none; }
  .flag { width: 30px; height: 30px; }
  .item { left: 32%; width: min(26%, 110px); bottom: calc(26% - 6px); }
  .tag { top: 0; min-width: 110px; padding: 6px 12px 6px 24px; }
  .tag-price { font-size: 26px; }
  .tag-local { font-size: 11px; }
  .play { padding: 10px 18px 12px; }
  .rounds { gap: 6px; padding-top: 4px; }
  .total span:first-child { font-size: 32px; }
  .total-label { font-size: 12px; }
  .question { margin-top: 4px; }
  .ask { font-size: 21px; }
  .hint { margin-top: 5px; font-size: 14px; }
  .reveal-line { min-height: 1.2em; margin-top: 2px; font-size: 14px; line-height: 1.25; }
  .s-big span:first-child { font-size: 64px; }
  .s-zone { margin: 10px 0; }
  .recap li { padding: 7px 12px; }
  .guess .track { margin-top: 6px; }
  .scale { margin-top: 6px; }
  .actions { margin-top: 8px; }
  .actions .pill { min-height: 48px; }
}
/* The shortest phones: a smaller picture still, and once the answer is in, the hint makes room for the result */
@media (max-width: 899px) and (max-height: 580px) {
  .gamecard.price { grid-template-rows: 20% 1fr; }
  .item { width: min(22%, 92px); }
  .play { padding-top: 8px; }
  .total span:first-child { font-size: 28px; }
  .ask { font-size: 19px; }
  .hint { font-size: 13px; }
  .gamecard.revealed .hint { display: none; }
}
/* The slider sits right above the button, where the thumb is */
.guess { margin-top: auto; flex: none; }
/* If the text is still too big for the panel (very large system text), the panel scrolls but the button stays put */
@media (max-width: 899px) {
  .play .actions { position: sticky; bottom: 0; z-index: 3; }
  /* The result's round list is longer than most phones have room for: Share stays on screen, the list scrolls under it */
  .screen { padding-bottom: 0; }
  .screen .s-actions { position: sticky; bottom: 0; z-index: 3; margin: 0 -22px; padding: 16px 22px 18px; background: linear-gradient(rgba(11, 107, 79, 0), var(--green) 16px); }
}
