/* Money Adventure — layout and components.
 *
 * Conventions inherited from the rest of the games app: BEM-ish blocks,
 * `is-` prefixes for state, `data-*` attributes as the only JS hooks, and
 * per-instance values passed in as inline custom properties.
 *
 * Two rules are load-bearing rather than cosmetic:
 *   1. #app must NOT claim min-height:100dvh — it sits under the sticky .ppgh
 *      header and would overflow the page by exactly one header.
 *   2. A coin and a note of the same value must never look interchangeable.
 */

:root {
  --coral: #ff8a5b;
  --sky: #4db8ff;
  --leaf: #5bc98c;
  --rose: #ff6fa5;
  --sun: #ffd166;
  --lav: #9c8cff;
  --teal: #3cc9b0;
  --orange: #ffb84d;
  --ink: #2e2a3a;
  --ink-soft: #6b6478;
  --paper: #fffdf6;
  --card: #fff;
  --line: #efe6d8;
  --shadow: 0 10px 30px rgba(46, 42, 58, 0.12);
  --shadow-sm: 0 4px 12px rgba(46, 42, 58, 0.1);
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --fs-sm: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
  --fs-md: clamp(1rem, 0.94rem + 0.3vw, 1.15rem);
  --fs-lg: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --fs-xl: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --tap: 48px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 209, 102, 0.28), transparent 45%),
    radial-gradient(circle at 85% 8%, rgba(77, 184, 255, 0.22), transparent 42%),
    var(--paper);
  min-height: 100dvh;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* #app flexes into the space under the sticky header — see rule 1 above. */
#app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px max(12px, calc((100% - 1120px) / 2)) 32px;
}

#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

:where(button, [tabindex]):focus-visible {
  outline: 3px solid var(--lav);
  outline-offset: 3px;
}

/* --- buttons -------------------------------------------------------------- */

.button {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  min-height: var(--tap);
  cursor: pointer;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 5px 0 #d96f45;
  transition: transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 140ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 0 #d96f45; }
.button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #d96f45; }
.button:disabled { opacity: 0.55; cursor: default; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.12); }
.button--primary { background: var(--teal); box-shadow: 0 5px 0 #249b87; }
.button--primary:hover:not(:disabled) { box-shadow: 0 8px 0 #249b87; }
.button--ghost { background: var(--card); color: var(--ink); box-shadow: 0 5px 0 var(--line); }
.button--ghost:hover:not(:disabled) { box-shadow: 0 8px 0 var(--line); }
.button--danger { background: #e5484d; box-shadow: 0 5px 0 #b53a3e; }
.button--big { font-size: var(--fs-lg); padding: 16px 30px; }

.icon-button {
  border: 0;
  background: var(--card);
  border-radius: 50%;
  width: var(--tap);
  height: var(--tap);
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  color: #385c68;
  border: 1px solid rgba(56, 92, 104, 0.1);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}
.icon-button:hover { transform: translateY(-2px); background: #eaf9f6; color: #168c7b; }
.icon-button .ui-icon { width: 25px; height: 25px; }
/* `display: grid` above outranks the UA rule for [hidden], so hiding the hint
 * and back buttons needs saying explicitly. */
.icon-button[hidden] { display: none; }

/* --- hud ------------------------------------------------------------------ */

.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  position: sticky;
  top: 0;
  z-index: 30;
}
/* Never `flex-wrap: wrap` here. On a 375px phone the five HUD children need
   354px of row and have 351, and wrapping turns that 3px shortfall into a
   34px-taller header with the two chips stacked and the back button stranded
   at mid-height. Shrinking beats stacking; the narrow breakpoints at the foot
   of this file tighten the row until it fits, and only below 360px does the
   header become two DELIBERATE rows. */
.hud__stats { display: flex; gap: 10px; margin-inline-end: auto; flex-wrap: nowrap; }
.hud__stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-family: var(--font-display);
  box-shadow: var(--shadow-sm);
}
.hud__stat svg { width: 22px; height: 22px; }
.hud__back[hidden], .hud__hint[hidden] { display: none; }

/* --- stage and panels ----------------------------------------------------- */

.stage { display: flex; flex-direction: column; gap: 16px; }
.stage__title { font-size: var(--fs-xl); text-align: center; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.panel__title { font-size: var(--fs-lg); }

/* --- illustrated welcome -------------------------------------------------- */

.adventure-hero {
  position: relative;
  min-height: clamp(300px, 40vw, 420px);
  overflow: hidden;
  isolation: isolate;
  border-radius: 30px;
  background: #073c4e;
  box-shadow: 0 18px 46px rgba(23, 54, 62, 0.2);
}

.adventure-hero__art,
.adventure-hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.adventure-hero__art {
  object-fit: cover;
  object-position: center;
}

.adventure-hero__shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(3, 41, 54, 0.98) 0%, rgba(3, 41, 54, 0.9) 38%, rgba(3, 41, 54, 0.18) 67%, transparent 100%),
    linear-gradient(0deg, rgba(3, 32, 42, 0.28), transparent 55%);
}

.adventure-hero__copy {
  position: relative;
  z-index: 2;
  width: min(55%, 590px);
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(26px, 5vw, 56px);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 22, 30, 0.3);
}

.adventure-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.adventure-hero__eyebrow svg { width: 19px; height: 19px; }
.adventure-hero__title { font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 0.95; letter-spacing: -0.035em; }
.adventure-hero__tagline { max-width: 28rem; margin: 12px 0 18px; font-size: clamp(1rem, 1.8vw, 1.25rem); line-height: 1.45; }

.adventure-hero__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adventure-hero__chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #174b57;
  text-shadow: none;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 24, 32, 0.12);
}

.adventure-hero__chips svg { width: 18px; height: 18px; color: #dc6c43; }

.adventure-hero--compact { min-height: clamp(220px, 28vw, 290px); }
.adventure-hero--compact .adventure-hero__copy { padding-block: 26px; }
.adventure-hero--compact .adventure-hero__title { font-size: clamp(2rem, 4vw, 3.25rem); }

.map-heading { text-align: center; padding: 4px 12px 0; }
.map-heading p { margin: 4px 0 0; color: var(--ink-soft); }

/* --- town map ------------------------------------------------------------- */

.town {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: clamp(12px, 2.5vw, 24px);
  background:
    linear-gradient(rgba(255, 253, 246, 0.78), rgba(255, 253, 246, 0.95)),
    url('/money-adventure/assets/art/backgrounds/rupee-town-wide-1536.webp') center / cover;
  border: 1px solid rgba(180, 139, 74, 0.15);
}
.town__street { position: absolute; inset: auto 0 0; width: 100%; opacity: 0.5; pointer-events: none; }
.town__nodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.district {
  width: 100%;
  min-height: 150px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #fff 0%, color-mix(in srgb, var(--district-accent) 8%, #fff) 100%);
  box-shadow: 0 8px 20px rgba(46, 42, 58, 0.1);
  cursor: pointer;
  padding: 14px 12px;
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  position: relative;
  border: 1px solid color-mix(in srgb, var(--district-accent) 24%, #fff);
  border-top: 6px solid var(--district-accent, var(--sky));
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.district:not(:disabled):hover { transform: translateY(-5px); box-shadow: 0 13px 26px rgba(46, 42, 58, 0.16); }
.district--sun { --district-accent: var(--sun); }
.district--sky { --district-accent: var(--sky); }
.district--teal { --district-accent: var(--teal); }
.district--plum { --district-accent: var(--lav); }
.district--leaf { --district-accent: var(--leaf); }
.district--coral { --district-accent: var(--coral); }
.district--orange { --district-accent: var(--orange); }
.district--rose { --district-accent: var(--rose); }

.district__emoji {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--district-accent) 17%, #fff);
  color: color-mix(in srgb, var(--district-accent) 78%, #27303b);
}
.district__emoji svg { width: 39px; height: 39px; }
.district__name { font-family: var(--font-display); font-size: var(--fs-md); }
.district__blurb { font-size: var(--fs-sm); color: var(--ink-soft); }
.district__stars { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); }
.district__stars svg { width: 18px; height: 18px; }
.district__lock {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.district__lock svg { width: 17px; height: 17px; }

/* State is never colour alone: locked districts are also desaturated,
 * badged with a padlock, and labelled for screen readers. */
.town__node.is-locked .district,
.town__node.is-coming-soon .district {
  filter: grayscale(0.85);
  opacity: 0.62;
  cursor: default;
  box-shadow: none;
}

.daily-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(120deg, #fff1c7, #fffaf0 52%, #e9faf5);
  border: 1px solid rgba(224, 168, 46, 0.24);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.daily-card__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #fff;
  color: #dc6c43;
  box-shadow: var(--shadow-sm);
}
.daily-card__icon svg { width: 34px; height: 34px; }
.daily-card__copy h3 { font-size: var(--fs-md); }
.daily-card__copy p { margin: 2px 0 0; color: var(--ink-soft); font-size: var(--fs-sm); }
.daily-card .button { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.daily-card .button svg { width: 21px; height: 21px; }
}
.daily-card__streak {
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow-sm);
}

/* --- world / level select ------------------------------------------------- */

.world { display: flex; flex-direction: column; gap: 16px; }
.world__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--fs-xl);
  text-align: center;
}
.world__title svg {
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--sky) 16%, #fff);
  color: #287da5;
}
.tier {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.tier.is-locked { opacity: 0.55; }
.tier__title {
  font-size: var(--fs-md);
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.tier__ages { font-family: var(--font-body); font-size: var(--fs-sm); color: var(--ink-soft); }
.level-row { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.level-card {
  min-width: 92px;
  min-height: 84px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  padding: 10px;
}
.level-card:disabled { cursor: default; opacity: 0.6; }
.level-card__order { font-family: var(--font-display); font-size: var(--fs-lg); }
.level-card__stars { display: inline-flex; gap: 2px; }
.level-card__stars svg { width: 16px; height: 16px; }

/* --- play ----------------------------------------------------------------- */

.play { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.play__progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
}
.play__dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(46, 42, 58, 0.16);
}
.play__dot.is-done { background: var(--teal); }
.play__dot.is-current { background: var(--coral); transform: scale(1.28); }

.play__prompt {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  text-align: center;
  margin: 0;
  min-height: 2.2em;
}
.play__board {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

/* --- money ---------------------------------------------------------------- */

.money-card {
  border: 0;
  background: none;
  padding: 0;
  cursor: default;
  position: relative;
  display: inline-grid;
  place-items: center;
  line-height: 0;
  touch-action: none;
}
button.money-card { cursor: pointer; }

.money-card__art { display: block; height: auto; user-select: none; -webkit-user-drag: none; }

/* Coins are square-framed and round; notes are wide rectangles. A ₹10 coin and
 * a ₹10 note are never the same silhouette. */
.money-card--coin .money-card__art {
  width: clamp(64px, 17vw, 92px);
  aspect-ratio: 1;
  filter: drop-shadow(0 3px 5px rgba(46, 42, 58, 0.28));
}
.money-card--note .money-card__art {
  width: clamp(120px, 34vw, 176px);
  aspect-ratio: 2.17;
  border-radius: 8px;
  filter: drop-shadow(0 3px 6px rgba(46, 42, 58, 0.22));
}

.money-card.is-counted { transform: translateY(-8px); }
.money-card.is-counted::after {
  content: '✓';
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  line-height: 1;
}
.money-card.dragging { z-index: 30; }
.money-card.selected { outline: 3px dashed var(--lav); outline-offset: 4px; }

.money-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }

/* --- tray & wallet -------------------------------------------------------- */

.tray {
  width: 100%;
  min-height: 116px;
  border: 3px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.tray--count { border-style: solid; background: var(--card); box-shadow: var(--shadow-sm); }
.tray.drop-near { border-color: var(--teal); background: rgba(60, 201, 176, 0.12); }

.wallet-strip {
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 10px 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  /* The strip scrolls sideways; the page never does. */
  overscroll-behavior-x: contain;
}
.left-handed .wallet-strip { flex-direction: row-reverse; }

.tray-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.total-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  border: 3px solid transparent;
}
.total-chip__label { font-family: var(--font-body); font-size: var(--fs-sm); color: var(--ink-soft); }
.total-chip.is-match { border-color: var(--teal); }
.total-chip.is-over { border-color: var(--coral); }

.target-banner {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--sun);
  border-radius: 999px;
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
}
.target-banner__label { font-family: var(--font-body); font-size: var(--fs-sm); }

/* --- shop ----------------------------------------------------------------- */

.shop-counter {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.product-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.product-card__art { width: clamp(72px, 20vw, 112px); height: auto; }
.product-card__name { font-size: var(--fs-sm); color: var(--ink-soft); }
.price-tag {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  background: var(--sun);
  border-radius: 999px;
  padding: 2px 14px;
}
.paid-block { display: grid; justify-items: center; gap: 6px; }
.paid-block__label { font-family: var(--font-display); font-size: var(--fs-md); }

/* --- compare -------------------------------------------------------------- */

.compare-scene {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.purse {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  position: relative;
  border: 3px solid transparent;
}
.purse__total {
  position: absolute;
  bottom: -14px;
  font-family: var(--font-display);
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 3px 14px;
  font-size: var(--fs-sm);
}
.compare-scene.is-revealed[data-winner='left'] .purse--left,
.compare-scene.is-revealed[data-winner='right'] .purse--right { border-color: var(--teal); }

/* --- choices -------------------------------------------------------------- */

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.choice-grid--money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid--sides { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.choice-card {
  min-height: 76px;
  border: 3px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px 8px;
  transition: transform 120ms ease, border-color 120ms ease;
}
.choice-card:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--sky); }
.choice-card:disabled { opacity: 0.5; cursor: default; }
.choice-card.is-correct { border-color: var(--teal); background: rgba(60, 201, 176, 0.14); }
.choice-card.is-correct::after { content: '✓'; color: var(--teal); font-size: 1.4rem; }
.choice-card.is-wrong { border-color: var(--coral); }
.choice-label { line-height: 1.2; }

/* --- number line ---------------------------------------------------------- */

.numberline {
  width: 100%;
  /* Both needed. `.play__board` is a flex column, and a flex item defaults to
   * min-width:auto — so without this the number line inflates to its 320px
   * content and pushes the whole page sideways at 320px wide, instead of
   * letting the scroller below do its job. */
  min-width: 0;
  max-width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 12px 10px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
}
.numberline__scroll {
  position: relative;
  overflow-x: auto;
  max-width: 100%;
  padding: 6px 0 2px;
  overscroll-behavior-x: contain;
}
/* The last tick label is centred on x=100 and hangs half its width past the
 * edge; clip it rather than lose the even tick spacing. */
.numberline__svg { width: 100%; min-width: 320px; height: 92px; display: block; overflow: hidden; }
.numberline__marker {
  position: absolute;
  top: 6px;
  translate: -50% 0;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--lav);
  color: #fff;
  font-family: var(--font-display);
  display: grid;
  place-items: center;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: left 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.numberline.is-arrived .numberline__marker { background: var(--teal); }
.numberline__controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.numberline__hop {
  min-width: 64px;
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--sky);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  cursor: pointer;
  box-shadow: 0 4px 0 #2f92cf;
}
.numberline__hop--reset { background: var(--ink-soft); box-shadow: 0 4px 0 #4c465a; min-width: 56px; }
.numberline__readout {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  min-height: 1.6em;
}
.numberline.is-arrived .numberline__readout { color: var(--teal); }

/* --- results & collection ------------------------------------------------- */

.result-stars { display: flex; gap: 10px; justify-content: center; }
.result-stars svg { width: 56px; height: 56px; }
.result-gems { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: var(--fs-lg); }
.result-gems svg { width: 26px; height: 26px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.reward-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  text-align: start;
}
.reward-row svg, .reward-row img { width: 46px; height: 46px; }

.sticker-shelf, .badge-shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  width: 100%;
}
.shelf-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  font-size: var(--fs-sm);
}
.shelf-item small { color: var(--ink-soft); font-size: 0.78rem; }
.shelf-item.is-locked { opacity: 0.45; filter: grayscale(1); }
.sticker-face { display: grid; place-items: center; }
.sticker-face svg, .sticker-face img { width: 52px; height: 52px; object-fit: contain; }
.badge-face { width: 52px; height: 52px; }

/* --- tutorial & settings -------------------------------------------------- */

.tutorial { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; width: 100%; }
.tutorial__step {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: start;
  font-size: var(--fs-md);
}
.tutorial__art { font-size: 2rem; }
.tutorial__art {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #eaf9f6;
  color: #168c7b;
}
.tutorial__art svg { width: 33px; height: 33px; }

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  padding: 6px 4px;
  font-size: var(--fs-md);
  cursor: pointer;
}
.setting-row input[type='checkbox'] { width: 26px; height: 26px; accent-color: var(--teal); }
.setting-row select { margin-inline-start: auto; min-height: 40px; font-size: var(--fs-md); border-radius: 10px; }

/* --- hints ---------------------------------------------------------------- */

.hint-arrow { position: fixed; z-index: 45; pointer-events: none; width: 56px; }
.hint-arrow svg { width: 100%; height: auto; }

/* The identify board's hint prints each note's value over its art: it points a
 * child at where the number lives without saying which number to look for. */
.play--identify .hint-glow .money-card::after {
  content: '₹' attr(data-value);
  position: absolute;
  inset-block-end: -4px;
  inset-inline-end: -4px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.85rem;
  font-family: var(--font-display);
  line-height: 1.3;
}

/* --- high contrast -------------------------------------------------------- */

.high-contrast {
  --line: #2e2a3a;
  --ink-soft: #2e2a3a;
  --paper: #fff;
}
.high-contrast .choice-card,
.high-contrast .level-card,
.high-contrast .district { border-width: 3px; border-color: var(--ink); }
.high-contrast .money-card::before {
  content: '₹' attr(data-value);
  position: absolute;
  inset-block-start: -6px;
  inset-inline-start: -6px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.85rem;
  font-family: var(--font-display);
  line-height: 1.3;
  z-index: 2;
}

/* --- responsive ----------------------------------------------------------- */

@media (min-width: 640px) {
  .town__nodes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

@media (min-width: 900px) {
  .town__nodes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #app { gap: 18px; }
  .play__board { max-width: 900px; }
}

/* --- the HUD on small screens -------------------------------------------- */

@media (max-width: 480px) {
  .hud { gap: 6px; }
  .hud__stats { gap: 6px; }
  .hud__stat { padding: 5px 10px 5px 6px; font-size: var(--fs-sm); }
  .hud__stat svg { width: 20px; height: 20px; }

  .adventure-hero,
  .adventure-hero--compact { min-height: 330px; border-radius: 24px; }
  .adventure-hero__art { object-position: 58% center; }
  .adventure-hero__shade {
    background: linear-gradient(90deg, rgba(3, 41, 54, 0.96), rgba(3, 41, 54, 0.8) 66%, rgba(3, 41, 54, 0.22));
  }
  .adventure-hero__copy { width: 100%; padding: 24px 20px; justify-content: flex-end; }
  .adventure-hero__title { max-width: 270px; font-size: 2.55rem; }
  .adventure-hero__tagline { max-width: 270px; margin-block: 9px 13px; }
  .adventure-hero__chips { max-width: 280px; }
  .adventure-hero__chips li { font-size: 0.74rem; padding: 6px 8px; }

  .daily-card { grid-template-columns: auto 1fr; }
  .daily-card .button { grid-column: 1 / -1; justify-content: center; width: 100%; }
}

/* Below 360px the row genuinely cannot hold four 48px buttons and two chips
   without dropping a tap target below the floor, so the stats move to their own
   full-width row. Two tidy rows beat one ragged one. */
@media (max-width: 359px) {
  .hud { flex-wrap: wrap; }
  .hud__back { margin-inline-end: auto; }
  .hud__stats {
    order: 2;
    flex-basis: 100%;
    margin-inline-end: 0;
    justify-content: center;
  }
}
