/* ============================================================
   Kharidaar — the living bazaar
   Palette: paper, chilli, marigold, neem. Light & dark.
   ============================================================ */

:root {
  --bg: #f6efe2;
  --bg-2: #efe4d2;
  --surface: #fffaf0;
  --surface-2: #f9f0e1;
  --ink: #1e1a16;
  --ink-soft: #3a332c;
  --muted: #776b5e;
  --line: rgba(30, 26, 22, .14);
  --line-strong: rgba(30, 26, 22, .28);
  --accent: #d84a22;
  --accent-ink: #fff8ef;
  --gold: #e8a13c;
  --green: #25775f;
  --red: #cf3b2c;
  --band-bg: #191519;
  --band-ink: #f6eddc;
  --shadow: 0 1px 2px rgba(48, 33, 18, .05), 0 12px 34px -18px rgba(48, 33, 18, .3);
  --shadow-lift: 0 2px 4px rgba(48, 33, 18, .06), 0 26px 50px -22px rgba(48, 33, 18, .38);
  --radius: 20px;
  --font-display: "Fraunces", "Noto Sans Devanagari", Georgia, serif;
  --font-body: "Outfit", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --nav-h: 70px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --scene-ink: #241f1a;
  --scene-veil: rgba(246, 239, 226, .82);
  --hero-glow: rgba(255, 236, 196, .38);
}

html[data-theme="dark"] {
  --bg: #0d0c12;
  --bg-2: #131019;
  --surface: #17141e;
  --surface-2: #1e1a26;
  --ink: #f5eddf;
  --ink-soft: #ddd2c2;
  --muted: #a49a8c;
  --line: rgba(245, 237, 223, .13);
  --line-strong: rgba(245, 237, 223, .26);
  --accent: #ff7a45;
  --accent-ink: #1c1108;
  --gold: #ffce72;
  --green: #67d6ae;
  --red: #ff7a6a;
  --band-bg: #1b1720;
  --band-ink: #f5eddf;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -20px rgba(0, 0, 0, .7);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 30px 60px -24px rgba(0, 0, 0, .8);
  --hero-glow: rgba(255, 174, 96, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
body.no-scroll { overflow: hidden; }
[data-lang="hi"] body, [data-lang="hi"] input, [data-lang="hi"] button, [data-lang="hi"] p, [data-lang="hi"] li { font-family: "Noto Sans Devanagari", var(--font-body); }

img, svg, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 620; line-height: 1.06; letter-spacing: -.025em; }
p { margin: 0; }
ul, ol, dl, dd, dt { margin: 0; padding: 0; }
li { list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container { width: min(1240px, 100% - clamp(32px, 6vw, 88px)); margin-inline: auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  animation: pulse 2.6s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 55% { box-shadow: 0 0 0 7px transparent; } }

.skip-link { position: fixed; top: -100px; left: 18px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 999px; transition: top .2s; }
.skip-link:focus { top: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
html[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .28; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 80;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s;
}
.nav.is-stuck { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); }
.nav-inner { width: min(1320px, 100% - clamp(24px, 4vw, 56px)); margin-inline: auto; height: var(--nav-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 30%, transparent)); }
.brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.brand-word { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.035em; line-height: 1; display: flex; flex-direction: column; gap: 4px; }
.brand-word small { font-family: var(--font-body); font-size: 8.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 30px; margin-left: 18px; flex: 1; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted); position: relative; padding: 6px 0; transition: color .25s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px; background: var(--accent); transition: right .35s var(--ease); }
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.is-active::after { right: 0; }
.nav-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.lang-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; gap: 1px; margin-right: 8px; }
.lang-switch button { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); transition: .25s; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.is-on { background: var(--ink); color: var(--bg); }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background .25s, transform .25s; }
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-btn .ic-moon { display: none; }
html[data-theme="dark"] .theme-btn .ic-sun { display: none; }
html[data-theme="dark"] .theme-btn .ic-moon { display: block; }
.menu-btn { display: none; }
.basket-count { position: absolute; top: 1px; right: -1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid var(--bg); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.eq i { width: 2px; height: 4px; border-radius: 2px; background: var(--accent); animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .18s; } .eq i:nth-child(3) { animation-delay: .36s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 10px; } }
.icon-btn .eq { position: absolute; right: 3px; bottom: 4px; opacity: 0; transition: opacity .3s; }
body.music-on .icon-btn .eq { opacity: 1; }
body.music-off .eq { display: none; }

.sound-pop {
  position: absolute; top: calc(100% + 10px); right: clamp(16px, 4vw, 52px); width: 306px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow-lift); animation: popIn .3s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.sound-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.mini-x { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.mini-x:hover { background: var(--surface-2); color: var(--ink); }
.mini-x svg { width: 14px; height: 14px; }
.sound-track { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.sound-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.sound-row.small { margin-top: 14px; }
.sound-row output, #volLabel { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; width: 34px; text-align: right; }
input[type="range"] { accent-color: var(--accent); }
#volume { flex: 1; height: 4px; }
.switch-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-soft); margin-top: 13px; cursor: pointer; }
.switch-row input { accent-color: var(--accent); width: 15px; height: 15px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; font-size: 12px; font-weight: 600; transition: .25s; }
.pill:hover { border-color: var(--line-strong); background: var(--surface-2); }
.pill.play-btn { background: var(--accent); color: var(--accent-ink); border-color: transparent; min-width: 72px; }
.pill.play-btn:hover { filter: brightness(1.08); }
.pill.ghost { background: transparent; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; overflow: hidden;
  isolation: isolate;
}
#bazaarCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--scene-veil) 0%, color-mix(in srgb, var(--scene-veil) 52%, transparent) 30%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--scene-veil) 42%, transparent) 0%, transparent 26%, transparent 72%, color-mix(in srgb, var(--scene-veil) 38%, transparent) 100%);
  transition: background 1.2s linear;
}
.hero-inner {
  position: relative; z-index: 2; padding-top: clamp(110px, 16vh, 180px); padding-bottom: clamp(28px, 5vh, 54px);
  display: flex; flex-direction: column; justify-content: center; flex: 1;
  pointer-events: none;
}
.hero-inner > * { pointer-events: auto; }
.hero .eyebrow { color: color-mix(in srgb, var(--scene-ink) 72%, transparent); }
.hero-title {
  font-family: var(--font-display); font-size: clamp(54px, 8.4vw, 112px); line-height: .92; letter-spacing: -.045em;
  font-weight: 600; color: var(--scene-ink); max-width: 15ch;
  text-shadow: 0 1px 0 rgba(255,255,255,.06);
}
html[data-lang="hi"] .hero-title { line-height: 1.14; font-size: clamp(42px, 6.6vw, 86px); }
.hero-title em { font-style: italic; font-weight: 400; color: var(--accent); }
.hero-sub { max-width: 56ch; margin-top: 26px; font-size: clamp(14.5px, 1.2vw, 17px); line-height: 1.65; color: color-mix(in srgb, var(--scene-ink) 82%, transparent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  transition: transform .3s var(--ease), background .25s, border-color .25s, box-shadow .3s; border: 1px solid transparent;
}
.btn svg { width: 17px; height: 17px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-solid { background: var(--ink); color: var(--bg); box-shadow: 0 12px 26px -14px rgba(0,0,0,.6); }
.btn-solid:hover { transform: translateY(-2px); background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 42%, transparent); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: var(--surface); transform: translateY(-2px); border-color: var(--ink); }
.hero-cta .btn-ghost { color: var(--scene-ink); border-color: color-mix(in srgb, var(--scene-ink) 32%, transparent); }
.hero-cta .btn-ghost svg { color: var(--accent); }

.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 44px); margin-top: clamp(34px, 5vh, 58px); }
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.hero-stats dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--scene-ink) 62%, transparent); }
.hero-stats dd { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; color: var(--scene-ink); line-height: 1; font-variant-numeric: tabular-nums; }

.scene-panel { position: relative; z-index: 3; margin-bottom: clamp(16px, 3vh, 30px); }
.scene-row {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 34px);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line); border-radius: 18px; padding: 12px clamp(14px, 2vw, 22px);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.scene-now { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; flex-shrink: 0; }
.scene-phase { grid-column: 1/-1; font-size: 9.5px; letter-spacing: .17em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.scene-clock { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.scene-loc { font-size: 10.5px; color: var(--muted); }
.scene-slider-wrap { flex: 1; min-width: 120px; }
.time-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: grab; }
.time-slider:active { cursor: grabbing; }
.time-slider::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, #141023 0%, #3b2b52 14%, #d98a5c 24%, #ffd89b 34%, #a9d9e8 48%, #f3e6c8 62%, #f0a45e 74%, #8d4c68 84%, #2a1c3c 93%, #141023 100%);
  border: 1px solid rgba(0,0,0,.12);
}
.time-slider::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg,#141023,#3b2b52 14%,#d98a5c 24%,#ffd89b 34%,#a9d9e8 48%,#f3e6c8 62%,#f0a45e 74%,#8d4c68 84%,#2a1c3c 93%,#141023); }
.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff5cf, #ffbf59 55%, #e8862f);
  border: 2px solid #fff8e8; box-shadow: 0 0 0 4px rgba(255, 195, 100, .18), 0 4px 14px rgba(0,0,0,.35);
}
.time-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%,#fff5cf,#ffbf59 55%,#e8862f); border: 2px solid #fff8e8; box-shadow: 0 0 0 4px rgba(255,195,100,.18); }
.scene-hint { font-size: 9.5px; letter-spacing: .05em; color: var(--muted); margin-top: 2px; display: flex; justify-content: space-between; }
.scene-actions { display: flex; gap: 7px; flex-shrink: 0; }
.mini-btn {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 13px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; transition: .25s; white-space: nowrap;
}
.mini-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mini-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.mini-btn.is-on { background: var(--accent); border-color: transparent; color: var(--accent-ink); }

/* ---------- ticker ---------- */
.ticker { display: flex; align-items: stretch; background: var(--ink); color: var(--bg); overflow: hidden; position: relative; z-index: 4; }
.ticker-label { display: flex; align-items: center; gap: 8px; padding: 11px 18px 11px clamp(16px, 4vw, 46px); background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.ticker-label .live-dot { background: currentColor; }
.ticker-window { overflow: hidden; flex: 1; display: flex; align-items: center; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-track { display: flex; white-space: nowrap; animation: ticker 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick-group { display: flex; gap: 34px; padding-left: 24px; flex-shrink: 0; }
@keyframes ticker { to { transform: translateX(-50%); } }
.tick { display: inline-flex; align-items: baseline; gap: 8px; font-size: 12px; color: color-mix(in srgb, var(--bg) 82%, transparent); cursor: pointer; }
.tick:hover b { color: var(--accent); }
.tick b { color: var(--bg); font-weight: 600; }
.tick i { font-style: normal; font-size: 10px; color: color-mix(in srgb, var(--bg) 50%, transparent); }
.tick .up { color: #ff9b76; } .tick .down { color: #7fe0b4; }
html[data-theme="dark"] .ticker { background: #f0e7d8; color: #17141b; }
html[data-theme="dark"] .tick { color: #50483d; } html[data-theme="dark"] .tick b { color: #17141b; } html[data-theme="dark"] .tick i { color: #7b7062; }
html[data-theme="dark"] .tick .up { color: #c0391f; } html[data-theme="dark"] .tick .down { color: #1c7a5b; }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 9vw, 128px) 0; position: relative; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 48px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-family: var(--font-display); font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02; letter-spacing: -.035em; font-weight: 600; }
.section-sub { max-width: 46ch; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.section-ink { background: var(--band-bg); color: var(--band-ink); position: relative; overflow: hidden; }
.section-ink .eyebrow { color: color-mix(in srgb, var(--band-ink) 55%, transparent); }
.section-ink .section-sub { color: color-mix(in srgb, var(--band-ink) 62%, transparent); }
.section-ink::before { content: ""; position: absolute; width: 44vw; height: 44vw; right: -10vw; top: -20vw; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%); pointer-events: none; }

/* ---------- market ---------- */
.market-toolbar { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.search-box { flex: 1 1 300px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; height: 48px; transition: border-color .25s, box-shadow .25s; }
.search-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.search-box svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-box input { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; font-size: 14px; }
.search-box input::placeholder { color: var(--muted); }
.search-box kbd, kbd { font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--surface-2); }
.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 14px; top: 50%; transform: translateY(-56%); pointer-events: none; color: var(--muted); font-size: 14px; }
select { appearance: none; -webkit-appearance: none; height: 48px; padding: 0 38px 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; outline: 0; cursor: pointer; max-width: 210px; }
select:hover { border-color: var(--line-strong); }
select:focus-visible { outline: 2px solid var(--accent); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--ink-soft);
  transition: .25s; background: transparent;
}
.chip span.count { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--line-strong); background: var(--surface); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.is-on span.count { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.results-line { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 14px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.link-btn { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); transition: color .2s; }
.link-btn:hover { color: var(--accent); }

.stall-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.5vw, 20px); }
.stall {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 12px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
  overflow: hidden; isolation: isolate; transform-style: preserve-3d;
}
.stall::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--cat, var(--accent)); opacity: .85; }
.stall::after { content: ""; position: absolute; inset: 0; background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--cat, var(--accent)) 9%, transparent), transparent 65%); opacity: 0; transition: opacity .4s; pointer-events: none; z-index: -1; }
.stall:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.stall:hover::after { opacity: 1; }
.stall-top { display: flex; align-items: center; gap: 8px; }
.stall-emoji { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; background: color-mix(in srgb, var(--cat, var(--accent)) 13%, transparent); flex-shrink: 0; }
.stall-place { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.delta { margin-left: auto; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.delta.down { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.delta.flat { background: var(--surface-2); color: var(--muted); }
.stall-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.stall-name small { font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.stall-price { display: flex; align-items: baseline; gap: 3px; margin-top: -2px; }
.stall-price .cur { font-size: 15px; font-weight: 500; color: var(--muted); }
.stall-price .val { font-family: var(--font-display); font-size: clamp(28px, 2.4vw, 34px); font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stall-price .unit { font-size: 11px; color: var(--muted); margin-left: 2px; }
.stall-norm { font-size: 10px; color: var(--muted); letter-spacing: .01em; margin-top: -5px; min-height: 14px; }

/* 3D supermarket shelf on every price card: real cuboid packs on a plank */
.shelf3d {
  position: relative; height: 104px; margin-top: -2px; border-radius: 12px; overflow: hidden;
  perspective: 520px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--cat, var(--accent)) 7%, var(--surface-2)), var(--surface-2));
}
.shelf3d-stack {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(calc((var(--rx, 0)) * 1deg)) rotateY(calc((var(--ry, 0)) * 1deg));
  transition: transform .2s ease-out;
}
.shelf3d-back {
  position: absolute; inset: 0 0 20px; transform: translateZ(-30px) scale(1.07);
  background: repeating-linear-gradient(90deg, transparent 0 17px, rgba(0,0,0,.05) 17px 18px),
    linear-gradient(180deg, color-mix(in srgb, var(--cat, var(--accent)) 16%, transparent), transparent);
}
.shelf3d-row {
  position: absolute; left: 9%; right: 9%; bottom: 21px; height: 50px;
  display: flex; justify-content: space-around; align-items: flex-end; transform-style: preserve-3d;
}
.box3d {
  --w: 30px; --h: 42px; --d: 22px;
  position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d;
  transform: rotateY(-24deg); transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.box3d.b2 { --h: 50px; --w: 34px; transform: rotateY(-14deg); }
.box3d.b3 { --h: 36px; transform: rotateY(-30deg); }
.box3d.b4 { --h: 44px; --w: 26px; transform: rotateY(-18deg); }
.stall:hover .box3d { transform: rotateY(-62deg); }
.stall:hover .box3d.b2 { transform: rotateY(-48deg); }
.box3d .f { position: absolute; display: block; backface-visibility: hidden; }
.box3d .fr { inset: 0; display: grid; place-items: center; font-size: 20px; font-style: normal; transform: translateZ(calc(var(--d) / 2));
  background: linear-gradient(160deg, color-mix(in srgb, var(--cat, var(--accent)) 30%, #fffaf0), color-mix(in srgb, var(--cat, var(--accent)) 62%, #fffaf0));
  border-top: 4px solid var(--cat, var(--accent)); border-radius: 2px; }
.box3d .fr b { font-weight: 400; line-height: 1; }
.box3d .fb { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: color-mix(in srgb, var(--cat, var(--accent)) 50%, #fffaf0); }
.box3d .fl { top: 0; bottom: 0; left: calc(var(--d) / -2); width: var(--d); transform: rotateY(-90deg) translateZ(calc(var(--d) / 2));
  background: color-mix(in srgb, var(--cat, var(--accent)) 58%, #2b1d12); }
.box3d .frt { top: 0; bottom: 0; right: calc(var(--d) / -2); width: var(--d); transform: rotateY(90deg) translateZ(calc(var(--d) / 2));
  background: color-mix(in srgb, var(--cat, var(--accent)) 74%, #2b1d12); }
.box3d .ft { left: 0; right: 0; top: calc(var(--d) / -2); height: var(--d); transform: rotateX(90deg) translateZ(calc(var(--d) / 2));
  background: color-mix(in srgb, var(--cat, var(--accent)) 25%, #fffaf0); }
.shelf3d-plank {
  position: absolute; left: 4%; right: 4%; bottom: 11px; height: 10px; border-radius: 3px; z-index: 4;
  background: linear-gradient(180deg, #e2c295, #a97c50 55%, #7c5636);
  box-shadow: 0 9px 10px -5px rgba(30, 18, 10, .55), inset 0 1px 0 rgba(255, 245, 225, .55);
  transform: translateZ(24px);
}
.shelf3d-tag {
  position: absolute; left: 7%; bottom: 3px; z-index: 5;
  font-size: 9px; font-weight: 700; letter-spacing: .02em; color: #4a3728;
  background: #fff6df; border: 1px solid rgba(90, 62, 34, .2); border-radius: 2px; padding: 1px 6px;
  transform: translateZ(26px); box-shadow: 0 2px 4px rgba(40, 26, 14, .2);
}
@media (prefers-reduced-motion: reduce) { .box3d, .shelf3d-stack { transition: none; } }
@media (max-width: 720px) { .shelf3d { height: 92px; } .box3d { transform: scale(.85) rotateY(-24deg); } }
.spark { width: 100%; height: 40px; overflow: visible; }
.spark path.line { fill: none; stroke: var(--cat, var(--accent)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark path.area { fill: color-mix(in srgb, var(--cat, var(--accent)) 11%, transparent); stroke: none; }
.spark circle { fill: var(--cat, var(--accent)); stroke: var(--surface); stroke-width: 1.5; }
.stall-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: auto; }
.stall-date { font-size: 9.5px; color: var(--muted); letter-spacing: .02em; }
.add-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: .25s; flex-shrink: 0; }
.add-btn svg { width: 14px; height: 14px; }
.add-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(90deg); }
.add-btn.is-added { background: var(--green); border-color: var(--green); color: #fff; }
.empty-state { text-align: center; padding: 60px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.empty-art { font-size: 42px; display: block; margin-bottom: 10px; }
.empty-state h3 { font-family: var(--font-display); font-size: 26px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }

/* ---------- ledger ---------- */
.ledger-chips { margin-bottom: 10px; }
.section-ink .chip { border-color: color-mix(in srgb, var(--band-ink) 22%, transparent); color: color-mix(in srgb, var(--band-ink) 72%, transparent); }
.section-ink .chip:hover { background: color-mix(in srgb, var(--band-ink) 8%, transparent); border-color: color-mix(in srgb, var(--band-ink) 40%, transparent); }
.section-ink .chip.is-on { background: var(--band-ink); color: var(--band-bg); border-color: var(--band-ink); }
.section-ink .chip.is-on span.count { color: color-mix(in srgb, var(--band-bg) 60%, transparent); }
.ledger-list { counter-reset: led; margin-top: 28px; }
.ledger-item { display: grid; grid-template-columns: 110px 1fr; gap: clamp(14px, 3vw, 40px); padding: 26px 0; border-top: 1px solid color-mix(in srgb, var(--band-ink) 14%, transparent); position: relative; animation: rise .5s var(--ease) both; }
.ledger-item:last-child { border-bottom: 1px solid color-mix(in srgb, var(--band-ink) 14%, transparent); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.ledger-date { font-family: var(--font-mono); font-size: 11px; color: color-mix(in srgb, var(--band-ink) 58%, transparent); line-height: 1.5; letter-spacing: .02em; }
.ledger-date b { display: block; font-family: var(--font-display); font-size: 25px; font-weight: 500; color: var(--band-ink); letter-spacing: -.02em; }
.ledger-body { display: flex; flex-direction: column; gap: 7px; }
.ledger-ribbon { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ledger-item-name { font-family: var(--font-display); font-size: 21px; font-weight: 550; letter-spacing: -.01em; }
.place-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--band-ink) 24%, transparent); color: color-mix(in srgb, var(--band-ink) 72%, transparent); }
.ledger-desc { font-size: 13.5px; line-height: 1.6; color: color-mix(in srgb, var(--band-ink) 76%, transparent); max-width: 78ch; }
.ledger-remark { font-size: 12px; font-style: italic; color: var(--gold); display: flex; gap: 6px; align-items: baseline; }
.ledger-remark::before { content: "✎"; font-style: normal; opacity: .7; }
.ledger-more { text-align: center; margin-top: 32px; }
.market-more { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.market-more[hidden] { display: none; }
.market-more-note { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.market-more .btn { min-width: 200px; }
.section-ink .btn-ghost { border-color: color-mix(in srgb, var(--band-ink) 30%, transparent); color: var(--band-ink); }
.section-ink .btn-ghost:hover { background: var(--band-ink); color: var(--band-bg); border-color: var(--band-ink); }

/* ---------- explore ---------- */
.explore-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.5vw, 18px); }
.wonder {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px 20px;
  background: var(--surface); display: flex; flex-direction: column; gap: 10px; min-height: 250px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; overflow: hidden;
}
.wonder::before { content: ""; position: absolute; width: 180px; height: 180px; right: -80px; top: -80px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 24%, transparent), transparent 70%); opacity: 0; transition: opacity .5s; }
.wonder:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.wonder:hover::before { opacity: 1; }
.wonder-num { position: absolute; right: 16px; top: 12px; font-family: var(--font-display); font-size: 40px; font-weight: 300; color: var(--line-strong); letter-spacing: -.04em; line-height: 1; }
.wonder-icon { font-size: 27px; margin-bottom: 6px; }
.wonder h3 { font-family: var(--font-display); font-size: 20px; letter-spacing: -.02em; line-height: 1.15; padding-right: 30px; }
.wonder p { font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.wonder kbd { font-size: 9px; }
.wonder-actions { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.wonder-actions .mini-btn { font-size: 10px; padding: 7px 11px; }

/* ---------- about ---------- */
.about { padding-bottom: clamp(60px, 8vw, 100px); }
.about-grid { display: grid; grid-template-columns: 1.3fr .8fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.about-copy h2 { font-family: var(--font-display); font-size: clamp(32px, 4.2vw, 52px); line-height: 1.04; letter-spacing: -.035em; margin-bottom: 20px; max-width: 18ch; }
.about-copy p { color: var(--muted); font-size: 14.5px; line-height: 1.72; max-width: 60ch; margin-bottom: 14px; }
.about-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.about-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); position: relative; }
.about-card::after { content: ""; position: absolute; inset: auto 14px -7px; height: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; z-index: -1; }
.about-card-top { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 12px; margin-bottom: 6px; }
.about-facts { display: flex; flex-direction: column; }
.about-facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.about-facts li:last-child { border-bottom: 0; }
.about-facts span { color: var(--muted); }
.about-facts strong { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -.01em; text-align: right; }
.about-fine { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 34px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.footer-brand .brand-word { font-size: 18px; }
.footer-brand .brand-mark { width: 30px; height: 30px; }
.footer p { font-size: 11px; color: var(--muted); }
.footer-inner > div:first-child p { margin-top: 8px; }
.footer-links { display: flex; gap: 22px; font-size: 12px; color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-fine { font-size: 10.5px; letter-spacing: .02em; }

/* ---------- basket ---------- */
.basket-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 120; width: min(430px, 94vw);
  background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .5s var(--ease); box-shadow: -30px 0 80px -40px rgba(0,0,0,.5);
}
.basket-panel.is-open { transform: none; }
.basket-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px clamp(18px, 3vw, 26px) 14px; border-bottom: 1px solid var(--line); }
.basket-head h3 { font-family: var(--font-display); font-size: 27px; letter-spacing: -.03em; }
.basket-head .eyebrow { margin-bottom: 6px; }
.basket-body { flex: 1; overflow-y: auto; padding: 8px clamp(18px, 3vw, 26px); }
.basket-empty { text-align: center; padding: 50px 10px; }
.basket-empty span { font-size: 40px; display: block; margin-bottom: 10px; }
.basket-empty h4 { font-family: var(--font-display); font-size: 22px; margin-bottom: 6px; }
.basket-empty p { color: var(--muted); font-size: 12.5px; max-width: 30ch; margin: 0 auto; }
.basket-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 11px; align-items: center; padding: 15px 0; border-bottom: 1px dashed var(--line); animation: rise .4s var(--ease) both; }
.basket-emoji { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); font-size: 17px; }
.basket-info h4 { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.basket-info p { font-size: 10px; color: var(--muted); margin-top: 2px; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; margin-top: 7px; }
.qty button { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.qty button:hover { background: var(--surface-2); }
.qty button svg { width: 10px; height: 10px; }
.qty span { min-width: 18px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600; }
.basket-line { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.basket-line strong { font-family: var(--font-display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.remove-btn { font-size: 9.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.remove-btn:hover { color: var(--red); }
.basket-foot { border-top: 1px solid var(--line); padding: 16px clamp(18px, 3vw, 26px) 22px; background: var(--surface); }
.basket-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.basket-total span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); max-width: 22ch; }
.basket-total strong { font-family: var(--font-display); font-size: 29px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.basket-note { font-size: 10px; color: var(--muted); margin-top: 6px; min-height: 15px; }
.basket-note .up { color: var(--red); } .basket-note .down { color: var(--green); }
.basket-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.basket-actions .btn { width: 100%; }
.basket-actions .link-btn { text-align: center; }
.scrim { position: fixed; inset: 0; z-index: 110; background: rgba(12, 9, 8, .48); backdrop-filter: blur(3px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.mobile-basket { display: none; }

/* ---------- modals ---------- */
.modal {
  border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%;
  color: var(--ink); overflow: visible;
}
.modal::backdrop { background: rgba(12, 9, 8, .52); backdrop-filter: blur(5px); }
.modal[open] { display: grid; place-items: center; padding: clamp(10px, 3vw, 40px); }
.modal-inner {
  position: relative; width: min(760px, 100%); max-height: min(88svh, 900px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lift);
  animation: modalIn .45s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 4; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); }
.item-modal .modal-inner { width: min(880px, 100%); }
.modal-hero { padding: 28px clamp(20px, 4vw, 36px) 22px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.modal-hero::before { content: ""; position: absolute; width: 340px; height: 340px; right: -100px; top: -180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--cat, var(--accent)) 22%, transparent), transparent 70%); }
.modal-item-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.modal-item-top .stall-emoji { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; }
.modal-item-top h3 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 42px); letter-spacing: -.035em; line-height: 1; }
.modal-item-top h3 small { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.modal-price-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 18px; margin-top: 16px; }
.modal-price { display: flex; align-items: baseline; gap: 4px; }
.modal-price .cur { color: var(--muted); font-size: 16px; }
.modal-price .val { font-family: var(--font-display); font-size: clamp(44px, 6vw, 62px); font-weight: 600; letter-spacing: -.045em; line-height: .9; font-variant-numeric: tabular-nums; }
.modal-price .unit { color: var(--muted); font-size: 12px; }
.modal-meta { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.modal-meta b { color: var(--ink); font-weight: 600; }
.modal-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 20px; }
.modal-facts div { background: var(--surface); padding: 11px 13px; }
.modal-facts dt { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.modal-facts dd { font-family: var(--font-display); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-wrap { padding: 20px clamp(20px, 4vw, 36px) 8px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.chart-head h4 { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chart-head span { font-size: 10px; color: var(--muted); }
.chart { width: 100%; height: 170px; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .area { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; cursor: pointer; transition: r .2s; }
.chart .dot:hover { r: 6; }
.chart .axis-label { fill: var(--muted); font-size: 8.5px; font-family: var(--font-body); }
.modal-section { padding: 18px clamp(20px, 4vw, 36px) 8px; }
.modal-section h4 { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.records { display: flex; flex-direction: column; }
.record { display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; padding: 11px 0; border-top: 1px dashed var(--line); font-size: 12px; align-items: baseline; }
.record:first-child { border-top: 0; }
.record time { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.record p { color: var(--ink-soft); line-height: 1.55; }
.record p em { display: block; font-size: 10.5px; color: var(--gold); font-style: italic; margin-top: 2px; }
.record b { font-family: var(--font-display); font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.modal-foot { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 14px clamp(20px, 4vw, 36px); display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.modal-foot .modal-note { flex: 1; font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.modal-foot .btn { flex-shrink: 0; }

/* receipt */
.receipt-modal .modal-inner { width: min(480px, 100%); background: transparent; border: 0; box-shadow: none; overflow-y: auto; overflow-x: hidden; max-height: 90svh; padding: 4px; }
#receiptContent { background: #fdf8ec; color: #221d18; border-radius: 20px; padding: 26px 24px 30px; position: relative; box-shadow: 0 30px 70px -20px rgba(0,0,0,.55); }
#receiptContent::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 12px; background: linear-gradient(-45deg, transparent 7px, #fdf8ec 0) 0 0 / 14px 14px repeat-x, linear-gradient(45deg, transparent 7px, #fdf8ec 0) 0 0 / 14px 14px repeat-x; }
.receipt-top { text-align: center; border-bottom: 2px solid #221d18; padding-bottom: 12px; margin-bottom: 12px; }
.receipt-top h3 { font-family: var(--font-display); font-size: 30px; letter-spacing: -.03em; }
.receipt-top p { font-family: var(--font-mono); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: #7b6a57; margin-top: 4px; }
.receipt-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9.5px; color: #6d5d4b; margin-bottom: 12px; }
.receipt-lines { border-top: 1px dashed #bfae97; border-bottom: 1px dashed #bfae97; padding: 8px 0; }
.receipt-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-family: var(--font-mono); font-size: 11px; padding: 4px 0; }
.receipt-line span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-line small { display: block; font-size: 8.5px; color: #8b7a66; }
.receipt-total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-mono); font-size: 12px; padding-top: 11px; }
.receipt-total strong { font-family: var(--font-display); font-size: 25px; }
.receipt-inflation { font-family: var(--font-mono); font-size: 9px; color: #6d5d4b; margin-top: 6px; }
.receipt-footer { text-align: center; font-family: var(--font-mono); font-size: 8.5px; line-height: 1.7; color: #7b6a57; margin-top: 16px; border-top: 1px dashed #bfae97; padding-top: 12px; }
.receipt-stamp { position: absolute; right: 18px; top: 74px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; color: #c0392b; border: 1.5px solid #c0392b; border-radius: 4px; padding: 4px 7px; transform: rotate(-8deg); opacity: .75; text-transform: uppercase; }
.receipt-actions { display: flex; gap: 10px; margin-top: 26px; justify-content: center; flex-wrap: wrap; }
.receipt-actions .btn-solid { background: #fdf8ec; color: #221d18; }
.receipt-actions .btn-solid:hover { background: var(--accent); color: var(--accent-ink); }
.receipt-actions .btn-ghost { color: #fdf8ec; border-color: rgba(253,248,236,.4); }

/* duel */
.duel-modal .modal-inner { width: min(640px, 100%); padding: 30px clamp(20px, 4vw, 36px) 26px; }
.duel-modal h3 { font-family: var(--font-display); font-size: clamp(25px, 3.4vw, 34px); letter-spacing: -.03em; margin-bottom: 22px; max-width: 22ch; }
.duel-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(10px, 3vw, 24px); align-items: center; margin-bottom: 22px; }
.duel-side { text-align: center; }
.duel-side .duel-emoji { font-size: 34px; display: block; margin-bottom: 6px; }
.duel-side h4 { font-family: var(--font-display); font-size: 23px; letter-spacing: -.02em; }
.duel-side .duel-place { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.duel-bar { height: 100px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.duel-bar i { display: block; width: 26px; border-radius: 6px 6px 0 0; background: var(--cat, var(--accent)); transform-origin: bottom; animation: grow 1.1s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); } }
.duel-side .duel-value { font-family: var(--font-display); font-size: 21px; font-weight: 600; margin-top: 8px; }
.duel-side .duel-value small { font-size: 10px; color: var(--muted); font-family: var(--font-body); font-weight: 400; }
.duel-vs { font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--muted); }
.duel-winner { text-align: center; font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; margin-bottom: 4px; }
.duel-winner b { color: var(--ink); font-weight: 600; }
#duelAgain { margin-top: 16px; }

/* ---------- reveal ---------- */
.will-reveal { opacity: 0; transform: translateY(22px); transition: opacity .75s var(--ease), transform .75s var(--ease); }
.will-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .will-reveal { opacity: 1; transform: none; } }

/* ---------- toast / confetti ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 10px 18px; font-size: 12px; font-weight: 500; box-shadow: var(--shadow-lift); display: flex; align-items: center; gap: 8px; animation: toastIn .4s var(--ease); }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
.toast .emoji { font-size: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.confetti { position: fixed; inset: 0; z-index: 190; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); opacity: .9; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stall-grid { grid-template-columns: repeat(3, 1fr); }
  .explore-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-links { gap: 20px; margin-left: 6px; }
}
@media (max-width: 900px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px clamp(20px, 5vw, 32px) 18px; margin: 0;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow);
  }
  .nav.menu-open .nav-links { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); font-size: 15px; }
  .nav-links a:last-child { border-bottom: 0; }
  .menu-btn { display: grid; }
  .nav-inner { gap: 10px; }
  .lang-switch { margin-right: 2px; }
  .stall-grid { grid-template-columns: repeat(2, 1fr); }
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-card { max-width: 460px; }
  .hero-inner { padding-top: 120px; }
  .ledger-item { grid-template-columns: 78px 1fr; }
  .ledger-date b { font-size: 21px; }
}
@media (max-width: 720px) {
  :root { --radius: 18px; }
  .hero { min-height: 100svh; }
  .hero-title { font-size: clamp(46px, 13vw, 72px); max-width: 12ch; }
  .hero-sub { font-size: 13.5px; margin-top: 18px; }
  .hero-stats { gap: 14px 24px; margin-top: 26px; padding: 12px 16px; border-radius: 16px; width: fit-content; background: color-mix(in srgb, var(--scene-veil) 52%, transparent); border: 1px solid color-mix(in srgb, var(--scene-ink) 10%, transparent); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
  .hero-stats dt { font-size: 8.5px; }
  .hero-stats dd { font-size: 22px; }
  .scene-row { flex-wrap: wrap; gap: 10px 14px; padding: 12px 14px; }
  .scene-now { grid-template-columns: auto auto; }
  .scene-clock { font-size: 19px; }
  .scene-slider-wrap { order: 3; flex-basis: 100%; }
  .scene-actions { margin-left: auto; }
  .scene-actions .mini-btn { padding: 7px 10px; font-size: 10px; }
  .scene-hint { display: none; }
  .ticker-label { padding-inline: 14px; font-size: 9px; }
  .ticker-label span:last-child { display: none; }
  .nav-links { max-height: 70svh; overflow-y: auto; }
  .lang-switch button { padding: 5px 7px; font-size: 10px; }
  .icon-btn { width: 34px; height: 34px; }
  .nav-tools { gap: 0; }
  .brand-word small { display: none; }
  .market-toolbar { gap: 8px; }
  .search-box { flex-basis: 100%; }
  .select-wrap { flex: 1; }
  .select-wrap select { width: 100%; max-width: none; height: 44px; font-size: 12px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .stall { padding: 14px 14px 12px; gap: 9px; }
  .stall-name { font-size: 19px; }
  .stall-price .val { font-size: 27px; }
  .stall-place { font-size: 8.5px; }
  .spark { height: 34px; }
  .stall-grid { gap: 10px; }
  .wonder { min-height: 0; padding: 20px 16px 16px; }
  .wonder h3 { font-size: 18px; }
  .section-head h2 { font-size: clamp(30px, 8vw, 42px); }
  .section-sub { font-size: 13px; }
  .ledger-item { grid-template-columns: 1fr; gap: 8px; padding: 20px 0; }
  .ledger-date { display: flex; align-items: baseline; gap: 8px; }
  .ledger-date b { font-size: 17px; }
  .mobile-basket {
    display: flex; position: fixed; z-index: 70; bottom: 16px; left: 50%; transform: translateX(-50%);
    background: var(--ink); color: var(--bg); border-radius: 999px; padding: 9px 9px 9px 16px; gap: 10px;
    align-items: center; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-lift);
    border: 1px solid color-mix(in srgb, var(--bg) 20%, transparent);
  }
  .mobile-basket svg { width: 17px; height: 17px; }
  .mobile-basket b { background: var(--accent); color: var(--accent-ink); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; }
  body.has-basket .mobile-basket { display: flex; }
  .footer { padding-bottom: 84px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .modal-facts { grid-template-columns: repeat(2, 1fr); }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { width: 100%; }
  .duel-body { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .duel-bar i { width: 16px; }
  .record { grid-template-columns: 72px 1fr; }
  .record b { grid-column: 2; }
  .basket-panel { width: 100vw; }
  .sound-pop { right: 8px; left: 8px; width: auto; }
  .hero-cta .btn { padding: 12px 18px; font-size: 12px; }
}
@media (max-width: 420px) {
  .stall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stall-name { font-size: 17px; }
  .stall-name small { display: none; }
  .stall-price .val { font-size: 24px; }
  .hero-title { font-size: clamp(40px, 14vw, 58px); }
  .nav-inner { gap: 12px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-word { font-size: 19px; }
  .nav-tools { gap: 2px; }
  .lang-switch { margin-right: 2px; padding: 2px; }
  .lang-switch button { padding: 4px 6px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn svg { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .ticker-track { animation: none; }
}

/* View transition for theme */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }


/* small refinements */
.stall:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.scroll-lock { overflow: hidden; }

html.flat .hero { min-height: 950px; }


/* ============================================================
   3D bazaar world
   ============================================================ */
.wonder-world { position: relative; }
.world-badge {
  position: absolute; top: 16px; left: 60px; z-index: 2;
  font-size: 9px; font-weight: 800; letter-spacing: .16em; color: var(--accent-ink);
  background: var(--accent); border-radius: 999px; padding: 4px 8px;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5);
}
body.world-open { overflow: hidden; }
.world {
  position: fixed; inset: 0; z-index: 200; overflow: hidden;
  background: #0b0a12; color: #f7efe3;
  opacity: 0; transition: opacity .45s ease;
}
.world[hidden] { display: none; }
.world.is-open { opacity: 1; }
.world canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.world canvas.is-dragging { cursor: grabbing; }
.world-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 160px 40px rgba(8, 6, 12, .55);
  background: linear-gradient(180deg, rgba(10, 8, 16, .38), transparent 22%, transparent 74%, rgba(10, 8, 16, .5));
}
.world-bar {
  position: absolute; inset: 0 0 auto; z-index: 6; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px clamp(16px, 3.4vw, 40px); pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 7, 14, .66), transparent);
}
.world-title { display: flex; align-items: center; gap: 12px; }
.world-dot { width: 9px; height: 9px; border-radius: 50%; background: #ffb15d; box-shadow: 0 0 0 5px rgba(255, 177, 93, .16); animation: worldPulse 2.4s infinite; }
@keyframes worldPulse { 50% { box-shadow: 0 0 0 9px rgba(255, 177, 93, 0); } }
.world-title .eyebrow { color: #ffca8b; font-size: 9.5px; margin-bottom: 3px; }
.world-title h2 { font-family: var(--font-display); font-size: clamp(19px, 2vw, 26px); font-weight: 600; letter-spacing: -.02em; color: #fff7ea; line-height: 1; }
.world-tools { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.world-chip, .world-round, .world-exit {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  border: 1px solid rgba(255, 240, 220, .18); border-radius: 999px;
  background: rgba(20, 15, 24, .55); color: #f8efdf; backdrop-filter: blur(14px);
  font-size: 12px; font-weight: 600; letter-spacing: .01em; transition: .25s;
}
.world-chip { padding: 8px 12px; }
.world-round { width: 40px; justify-content: center; font-size: 15px; }
.world-exit { padding: 8px 14px; }
.world-chip svg, .world-exit svg { width: 16px; height: 16px; }
.world-chip b { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff4e4; font-size: 9.5px; display: grid; place-items: center; }
.world-chip.is-on { background: var(--accent); border-color: transparent; color: #fff6e8; }
.world-chip.is-on b { background: #fff3df; color: #a2320d; }
.world-chip:hover, .world-round:hover, .world-exit:hover { background: rgba(255, 246, 230, .16); border-color: rgba(255, 240, 220, .34); transform: translateY(-1px); }
.world-exit svg { transition: transform .3s; }
.world-exit:hover svg { transform: rotate(90deg); }
.world-hint, .world-touch-hint {
  position: absolute; z-index: 5; left: 50%; top: 92px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 244, 228, .72);
  background: rgba(16, 12, 20, .44); border: 1px solid rgba(255, 240, 220, .12); border-radius: 999px;
  padding: 7px 13px; backdrop-filter: blur(10px); white-space: nowrap; pointer-events: none;
}
.world-touch-hint { display: none; }
.world-tip {
  position: absolute; z-index: 7; top: 70px; right: clamp(16px, 3.4vw, 40px); width: 300px;
  padding: 14px 16px; border-radius: 16px; background: rgba(18, 14, 24, .9);
  border: 1px solid rgba(255, 240, 220, .16); box-shadow: 0 20px 50px -20px #000;
  font-size: 12px; line-height: 1.55; color: rgba(255, 244, 228, .82); backdrop-filter: blur(16px);
}
.world-tip[hidden] { display: none; }
.world-tip-keys { margin-top: 9px; font-size: 10px; color: rgba(255, 244, 228, .58); display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.world-tip kbd, .world-tip-keys kbd { font-family: var(--font-body); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 4px; padding: 1px 5px; font-size: 9.5px; }
.world-reticle {
  position: absolute; z-index: 4; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: rgba(255, 246, 230, .85); box-shadow: 0 0 0 5px rgba(255, 246, 230, .12);
  pointer-events: none; opacity: .55; transition: opacity .3s, transform .3s;
}
.world:has(.world-shelf:not([hidden])) .world-reticle { opacity: 0; }
.world-prompt {
  position: absolute; z-index: 6; left: 50%; bottom: clamp(26px, 6vh, 64px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; padding: 10px 10px 10px 20px;
  background: rgba(18, 13, 22, .82); border: 1px solid rgba(255, 240, 220, .16); border-radius: 999px;
  box-shadow: 0 24px 50px -22px #000; backdrop-filter: blur(16px);
}
.world-prompt[hidden] { display: none; }
.world-prompt p { display: flex; flex-direction: column; gap: 1px; min-width: 120px; }
.world-prompt b { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: #fff6e8; white-space: nowrap; }
.world-prompt small { font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 244, 228, .5); }
.world-prompt .btn { padding: 10px 16px; font-size: 12px; background: var(--accent); color: #fff8ec; }
.world-prompt .btn svg { width: 14px; height: 14px; }
.world-shelf {
  position: absolute; z-index: 8; top: 92px; right: clamp(16px, 3vw, 36px); width: min(384px, calc(100vw - 32px));
  max-height: calc(100% - 130px); overflow: auto; padding: 20px;
  background: rgba(17, 13, 22, .9); border: 1px solid rgba(255, 240, 220, .16); border-radius: 22px;
  box-shadow: 0 30px 70px -30px #000; backdrop-filter: blur(20px);
  animation: worldShelfIn .35s var(--ease);
}
.world-shelf[hidden] { display: none; }
@keyframes worldShelfIn { from { opacity: 0; transform: translateX(18px) scale(.98); } }
.world-shelf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.world-shelf-head .eyebrow { color: #ffca8b; font-size: 9px; margin-bottom: 4px; }
.world-shelf-head h3 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: #fff6e8; }
.world-shelf-head .icon-btn { color: rgba(255, 246, 232, .7); }
.world-shelf-head .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.ws-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed rgba(255, 240, 220, .13); }
.ws-row:last-of-type { border-bottom: 0; }
.ws-emoji { width: 44px; height: 44px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; font-size: 23px; background: rgba(255, 246, 230, .08); border: 1px solid rgba(255, 240, 220, .1); }
.ws-info { flex: 1; min-width: 0; }
.ws-info h4 { font-size: 13px; font-weight: 600; color: #fff6e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-info p { font-size: 10.5px; color: rgba(255, 244, 228, .58); margin-top: 2px; }
.ws-add {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 246, 230, .1); border: 1px solid rgba(255, 240, 220, .16); color: #fff6e8; transition: .2s;
}
.ws-add svg { width: 15px; height: 15px; }
.ws-add:hover { background: var(--accent); border-color: transparent; transform: scale(1.06); }
.ws-add.is-added { background: #2f9e6e; border-color: transparent; }
.world-shelf-foot { margin-top: 14px; font-size: 10px; color: rgba(255, 244, 228, .45); line-height: 1.5; }
.world-loading {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: #0b0a12; transition: opacity .5s;
}
.world-loading.is-done { opacity: 0; pointer-events: none; }
.world-loading p { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 244, 228, .55); }
.world-loader { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255, 240, 220, .16); border-top-color: #ffb15d; animation: worldSpin .9s linear infinite; }
@keyframes worldSpin { to { transform: rotate(360deg); } }
.world-pad {
  position: absolute; z-index: 6; left: clamp(18px, 4vw, 40px); bottom: clamp(20px, 5vh, 46px);
  width: 104px; height: 104px; border-radius: 50%; display: none; place-items: center;
  background: rgba(18, 13, 22, .5); border: 1px solid rgba(255, 240, 220, .18); backdrop-filter: blur(10px);
  touch-action: none;
}
.world-pad i { width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 246, 230, .3); border: 1px solid rgba(255, 246, 230, .45); transition: transform .08s linear; }
.world-pad.is-live { background: rgba(255, 177, 93, .18); }
.world :focus-visible { outline: 2px solid #ffb15d; outline-offset: 3px; }

@media (max-width: 900px) {
  .world-bar { padding: 12px 14px; align-items: flex-start; }
  .world-title .eyebrow { display: none; }
  .world-title h2 { font-size: 18px; }
  .world-chip span, .world-exit span { display: none; }
  .world-chip { padding: 8px 10px; }
  .world-exit { padding: 8px 10px; }
  .world-hint { display: none; }
  .world-touch-hint { display: block; top: auto; bottom: 142px; font-size: 8.5px; padding: 6px 10px; }
  .world-pad { display: grid; }
  .world-prompt { bottom: 160px; padding: 8px 8px 8px 15px; gap: 12px; }
  .world-prompt b { font-size: 14px; }
  .world-prompt small { display: none; }
  .world-shelf { top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-height: 62%; border-radius: 22px 22px 0 0; border-bottom: 0; padding: 18px 18px 26px; animation: worldShelfUp .35s var(--ease); }
  @keyframes worldShelfUp { from { transform: translateY(30px); opacity: .6; } }
  .world-tip { left: 14px; right: 14px; width: auto; top: 62px; }
}
@media (max-width: 420px) {
  .world-title h2 { font-size: 16px; }
  .world-round { width: 36px; min-height: 36px; }
  .world-chip, .world-exit { min-height: 36px; }
  .world-prompt { width: calc(100% - 28px); justify-content: space-between; }
  .world-prompt p { min-width: 0; }
}
@media (hover: none) {
  .world-pad { display: grid; }
  .world-hint { display: none; }
  .world-touch-hint { display: block; top: auto; bottom: 142px; }
}

/* ============================================================
   Bouncy Indian-bazaar layer: toran bunting, rangoli, springy motion
   ============================================================ */
:root { --spring: cubic-bezier(.34, 1.7, .5, 1); --marigold: #f4a300; --pink: #d6336c; --peacock: #0f8b8d; }

/* toran: marigold & mango-leaf bunting that sways under the nav */
.toran {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 79; display: flex; justify-content: space-around; height: 26px;
  pointer-events: none; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #000), transparent 3px);
}
.toran i {
  width: 22px; height: 26px; flex: none; transform-origin: 50% 0; animation: swing 2.6s ease-in-out infinite;
  background: var(--marigold); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.toran i:nth-child(3n+2) { background: var(--pink); animation-delay: -.7s; }
.toran i:nth-child(3n) { background: var(--peacock); animation-delay: -1.4s; }
.toran i:nth-child(even) { height: 20px; animation-duration: 3.1s; }
@keyframes swing { 0%, 100% { transform: rotate(7deg); } 50% { transform: rotate(-7deg); } }
@media (max-width: 720px) { .toran i:nth-child(n+16) { display: none; } .toran { height: 20px; } .toran i { height: 20px; } }

/* rangoli-ish dotted rule under section heads */
.section-head h2::after {
  content: ""; display: block; height: 10px; width: 120px; margin-top: 14px;
  background: radial-gradient(circle, var(--accent) 2.4px, transparent 3px) 0 50% / 20px 10px repeat-x,
              radial-gradient(circle, var(--marigold) 1.6px, transparent 2px) 10px 50% / 20px 10px repeat-x;
  animation: dotsRun 3s linear infinite;
}
@keyframes dotsRun { to { background-position: 20px 50%, 30px 50%; } }

/* springy interactions */
.btn, .chip, .mini-btn, .icon-btn, .pill { transition-timing-function: var(--spring); }
.btn:active, .chip:active, .mini-btn:active, .icon-btn:active { transform: scale(.92); }
.btn-solid:hover, .btn-ghost:hover { transform: translateY(-3px) scale(1.04); }
.chip:hover { transform: translateY(-2px) rotate(-2deg) scale(1.06); }
.stall, .wonder { transition: transform .5s var(--spring), box-shadow .4s var(--ease), border-color .3s; }
.stall:hover { transform: translateY(-8px) rotate(-.8deg) scale(1.02); }
.wonder:hover { transform: translateY(-8px) rotate(.8deg) scale(1.02); }
.wonder:hover .wonder-icon { animation: wobble .7s var(--spring); }
.wonder-icon { display: inline-block; animation: bob 3.4s ease-in-out infinite; }
.stall-emoji { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes wobble { 0% { transform: rotate(0) scale(1); } 25% { transform: rotate(-16deg) scale(1.25); } 55% { transform: rotate(12deg) scale(1.15); } 100% { transform: rotate(0) scale(1); } }
.brand-mark { animation: bob 2.8s ease-in-out infinite; }
.brand:hover .brand-mark { animation: wobble .7s var(--spring); }
.hero-title em { display: inline-block; animation: hop 2.6s var(--spring) infinite; transform-origin: 50% 100%; }
@keyframes hop { 0%, 55%, 100% { transform: translateY(0) scale(1, 1); } 62% { transform: translateY(0) scale(1.05, .93); } 74% { transform: translateY(-14px) scale(.97, 1.04); } 88% { transform: translateY(0) scale(1.03, .96); } }
.hero-stats dd { display: inline-block; transition: transform .4s var(--spring); }
.hero-stats > div:hover dd { transform: scale(1.25) rotate(-4deg); }
.mobile-basket { animation: popIn .6s var(--spring) both; }
@keyframes popIn { from { transform: translateX(-50%) scale(.3); opacity: 0; } }

/* reveal with a bounce, staggered */
.will-reveal { transform: translateY(40px) scale(.94); transition: opacity .6s var(--ease), transform .9s var(--spring); }
.will-reveal.in { transform: none; }

/* ticker band gets a festive trim */
.ticker, .ticker-label { position: relative; }
.ticker-label { animation: pulseLabel 2.4s ease-in-out infinite; }
@keyframes pulseLabel { 50% { filter: brightness(1.2); } }

/* the 3D world chrome bounces too */
.world-chip, .world-exit, .world-round { transition: transform .35s var(--spring), background .2s; }
.world-chip:hover, .world-exit:hover, .world-round:hover { transform: scale(1.08); }
.world-prompt { animation: popUp .5s var(--spring) both; }
@keyframes popUp { from { transform: translate(-50%, 24px) scale(.8); opacity: 0; } }
#worldCartCount { transition: transform .3s var(--spring); }

/* ---------- mobile polish ---------- */
@media (max-width: 720px) {
  body { -webkit-tap-highlight-color: transparent; }
  .btn, .chip, .mini-btn { min-height: 44px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1 1 100%; min-height: 48px; }
  .nav-inner { padding-inline: 12px; }
  .stall:hover, .wonder:hover { transform: none; }
  .stall:active, .wonder:active { transform: scale(.97); }
  .explore-grid { grid-template-columns: 1fr; }
  .about-actions { flex-direction: column; align-items: stretch; }
  .about-actions .btn { width: 100%; }
  .mobile-basket { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .modal-inner { max-height: 92svh; overflow-y: auto; border-radius: 22px 22px 0 0; }
  .world-bar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .world-pad { bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
  .section-head h2::after { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .toran i, .hero-title em, .brand-mark, .wonder-icon, .stall-emoji, .section-head h2::after { animation: none !important; }
}

html, body { overflow-x: clip; }

/* mobile: keep the shops visible beneath the headline instead of hiding behind it */
@media (max-width: 720px) {
  .hero-inner { flex: 0 0 auto; padding-bottom: 0; }
  .hero-stats { margin-bottom: 0; }
  .hero::after { content: ""; display: block; flex: 1 0 auto; min-height: min(46svh, 380px); order: 2; }
  .scene-panel { order: 3; margin-top: 0; }
  .hero-veil {
    background: linear-gradient(180deg, color-mix(in srgb, var(--scene-veil) 55%, transparent) 0%, color-mix(in srgb, var(--scene-veil) 35%, transparent) 55%, transparent 70%);
  }
  .hero-inner { background: none; }
}

@media (max-width: 720px) { .hero-stats { display: none; } }

/* 3D world: day/night, sound panel, shopkeeper chat */
.world-chip .wd-moon { display: none; }
body.world-night .world-chip .wd-sun { display: none; }
body.world-night .world-chip .wd-moon { display: block; }
.world-sound {
  position: absolute; z-index: 9; top: 70px; right: clamp(16px, 3.4vw, 40px); width: 260px; padding: 14px 16px;
  border-radius: 16px; background: rgba(18, 14, 24, .92); border: 1px solid rgba(255, 240, 220, .16);
  box-shadow: 0 20px 50px -20px #000; backdrop-filter: blur(16px); color: #f8efdf; font-size: 12px;
  display: grid; gap: 12px; animation: popUp .4s var(--spring) both; transform-origin: top right;
}
.world-sound[hidden] { display: none; }
.ws-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ws-line input[type=range] { flex: 1; accent-color: var(--accent); }
.ws-line b { min-width: 34px; text-align: right; font-weight: 600; }
.ws-line input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.ws-keeper { margin: 8px 0 4px; padding: 12px; border-radius: 16px; background: rgba(255, 240, 220, .07); border: 1px solid rgba(255, 240, 220, .12); }
.ws-bubble { color: #fff1dc; font-size: 13px; line-height: 1.5; margin-bottom: 10px; animation: popUp .35s var(--spring) both; }
.ws-bubble::before { content: "\1F9D1\200D\1F33E  "; }
.ws-keeper-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-keeper-actions .mini-btn { background: rgba(255, 246, 230, .1); color: #fff6e8; border-color: rgba(255, 240, 220, .22); min-height: 36px; }
.ws-keeper-actions .mini-btn:hover { background: var(--accent); }
.ws-row.is-deal .ws-info p { color: #8ee6bd; }
@media (max-width: 900px) { .world-sound { left: 14px; right: 14px; width: auto; } }

.world-round svg { width: 18px; height: 18px; flex: none; }
.world-round[aria-expanded="true"] { background: var(--accent); border-color: transparent; }

/* ---------- Sabzi Ninja game ---------- */
.game-hud { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 14px; align-items: stretch; }
.game-hud > div { flex: 1 1 110px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.game-hud small { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.game-hud b { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.game-lives { flex-direction: row !important; align-items: center; justify-content: center; gap: 6px !important; font-size: 24px; }
.game-lives i { font-style: normal; filter: grayscale(1) opacity(.3); transition: transform .4s var(--spring), filter .3s; }
.game-lives i.on { filter: none; animation: bob 2.6s ease-in-out infinite; }
.game-stage {
  position: relative; height: clamp(380px, 62vh, 620px); border-radius: 26px; overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow-lift);
  cursor: crosshair; user-select: none; -webkit-user-select: none;
}
.game-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.game-overlay {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px; text-align: center; color: #fff7ea;
  background: radial-gradient(circle at 50% 40%, rgba(40, 12, 8, .55), rgba(20, 6, 10, .82)); backdrop-filter: blur(3px);
  animation: popUp .5s var(--spring) both;
}
.game-overlay[hidden] { display: none; }
.game-overlay h3 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); letter-spacing: -.03em; }
.game-overlay p { max-width: 44ch; line-height: 1.6; font-size: 14px; color: rgba(255, 247, 234, .85); }
.game-overlay .btn-solid { background: var(--marigold); color: #2a1604; margin-top: 6px; }
.game-emoji { font-size: 44px !important; letter-spacing: 6px; animation: bob 2.4s ease-in-out infinite; }
.game-best { color: #ffd77a; font-weight: 700; }
.game-stage.is-playing .game-overlay { display: none; }
@media (max-width: 720px) { .game-stage { height: 68svh; min-height: 400px; } .game-hud b { font-size: 21px; } .game-hud > div { padding: 8px 12px; } }

.wonder-game .world-badge { background: var(--pink); }
.wonder-game { background: linear-gradient(160deg, color-mix(in srgb, var(--marigold) 14%, var(--surface)), var(--surface)); }

/* ---------- game tabs + Thela Rush ---------- */
.game-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.game-tab { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 600; font-size: 13px; background: var(--surface); transition: transform .3s var(--spring), background .2s; min-height: 44px; }
.game-tab.is-on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.game-tab:hover { transform: translateY(-2px) scale(1.04); }
.game-panel[hidden] { display: none; }
.thela-stage { cursor: pointer; }
.tl-list-bar { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px 14px; margin-bottom: 12px; border: 1px dashed var(--line-strong); border-radius: 14px; background: color-mix(in srgb, var(--marigold) 10%, var(--surface)); }
.tl-list-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tl-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 700; transition: transform .3s var(--spring), background .2s; }
.tl-chip b { font-size: 20px; font-weight: 400; }
.tl-chip small { font-size: 10px; font-weight: 500; color: var(--muted); }
.tl-chip.is-done { background: color-mix(in srgb, var(--green) 20%, var(--surface)); transform: scale(1.06); }
.tl-timer { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.tl-timer::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--t, 1)); background: linear-gradient(90deg, var(--red), var(--gold), var(--green)); }
.tl-controls { position: absolute; z-index: 1; left: 0; right: 0; bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 12px; pointer-events: none; }
.tl-controls button { pointer-events: auto; min-width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255, 240, 220, .35); background: rgba(24, 12, 16, .55); color: #fff6e8; backdrop-filter: blur(8px); font-size: 18px; transition: transform .25s var(--spring); }
.tl-controls button:active { transform: scale(.88); }
.tl-controls .tl-horn { border-radius: 999px; padding: 0 18px; font-size: 14px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; background: conic-gradient(rgba(255, 177, 93, .9) calc(var(--c, 1) * 360deg), rgba(24, 12, 16, .55) 0); }
.tl-controls .tl-horn::before { content: ""; position: absolute; }
.tl-controls .tl-horn.is-cool { opacity: .75; }
.game-stage.is-playing .tl-controls { display: flex; }
.thela-stage:not(.is-playing) .tl-controls { display: none; }
.game-keys { font-size: 12px !important; opacity: .8; }
.game-keys kbd { font-family: var(--font-body); padding: 1px 7px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); }
@media (min-width: 900px) { .tl-controls { opacity: .55; } }

/* ---------- 3D world: missions + photo mode ---------- */
.world-mission {
  position: absolute; z-index: 7; left: clamp(14px, 3vw, 36px); top: 84px; width: min(330px, calc(100vw - 28px));
  padding: 16px; border-radius: 20px; color: #f8efdf; background: rgba(20, 14, 18, .88); border: 1px solid rgba(255, 240, 220, .16);
  box-shadow: 0 24px 60px -24px #000; backdrop-filter: blur(16px); animation: popUp .45s var(--spring) both; transform-origin: top left;
}
.world-mission[hidden] { display: none; }
.wm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.wm-head .eyebrow { color: #ffca8b; font-size: 9px; margin-bottom: 3px; }
.wm-head h3 { font-family: var(--font-display); font-size: 21px; color: #fff6e8; }
.wm-head .icon-btn { color: rgba(255, 246, 232, .7); }
.wm-say { font-size: 12.5px; line-height: 1.5; margin: 8px 0 10px; color: rgba(255, 244, 228, .85); }
.wm-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.wm-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 240, 220, .07); font-size: 12.5px; transition: background .3s; }
.wm-list li b { font-size: 21px; font-weight: 400; }
.wm-list li span { flex: 1; line-height: 1.3; }
.wm-list li small { display: block; color: rgba(255, 244, 228, .55); font-size: 10.5px; }
.wm-list li em { font-style: normal; font-weight: 700; color: #8ee6bd; }
.wm-list li.is-got { background: rgba(80, 200, 150, .2); }
.wm-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.wm-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8ee6bd, #ffd77a); transition: width .5s var(--ease), background .3s; }
.wm-bar i.is-over { background: #ff7a6a; }
.wm-budget { font-size: 12px; margin: 6px 0 0; color: rgba(255, 244, 228, .8); }
.wm-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.wm-actions .mini-btn { background: rgba(255, 246, 230, .1); color: #fff6e8; border-color: rgba(255, 240, 220, .22); }
.wm-stamps { font-weight: 700; font-size: 13px; color: #ffd77a; }
.world-mission.is-done { box-shadow: 0 0 0 2px #8ee6bd, 0 24px 60px -24px #000; }
.ws-haggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 240, 220, .22); background: rgba(255, 246, 230, .08); font-size: 15px; transition: transform .3s var(--spring); }
.ws-haggle:hover { transform: scale(1.15) rotate(-8deg); background: var(--accent); }
.ws-row .ws-add { margin-left: 4px; }
.ws-row .ws-info { flex: 1; min-width: 0; }
.ws-need { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: #ffd77a; font-weight: 700; }
.world-flash { position: absolute; inset: 0; z-index: 20; background: #fff; opacity: 0; pointer-events: none; }
.world-flash.is-on { animation: shutter .5s ease-out; }
@keyframes shutter { 0% { opacity: .95; } 100% { opacity: 0; } }
.world-photo { position: absolute; inset: 0; z-index: 21; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px; background: rgba(12, 8, 14, .88); backdrop-filter: blur(10px); animation: popUp .4s var(--spring) both; }
.world-photo[hidden] { display: none; }
.world-photo figure { margin: 0; max-width: min(92vw, 860px); max-height: 66vh; display: flex; flex-direction: column; align-items: center; gap: 10px; transform: rotate(-1.2deg); }
.world-photo img { max-width: 100%; max-height: 60vh; border-radius: 6px; box-shadow: 0 30px 70px -20px #000; }
.world-photo figcaption { color: rgba(255, 244, 228, .75); font-size: 12px; }
.wp-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.world-round { font-size: 17px; }
@media (max-width: 900px) { .world-mission { top: 62px; left: 14px; right: 14px; width: auto; max-height: 52%; overflow: auto; } #worldMissionLabel { display: none; } }

/* 3D world controls: one consistent glass icon style, tidy right-hand rail on phones */
.world-round, .world-chip { position: relative; }
.world-round svg, .world-chip svg { width: 20px; height: 20px; flex: none; }
.world-chip b { margin-left: 2px; }
@media (max-width: 900px) {
  .world-bar { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; align-items: center; }
  .world-tools { gap: 8px; }
  .world-chip, .world-round, .world-exit { min-height: 44px; min-width: 44px; padding: 0; justify-content: center; border-radius: 50%; background: rgba(22, 15, 26, .62); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .7); }
  .world-chip span, .world-exit span { display: none !important; }
  #worldCartBtn { width: auto; min-width: 44px; padding: 0 12px 0 10px; border-radius: 999px; gap: 6px; }
  #worldCartBtn b { margin: 0; }
  .world-exit svg { width: 18px; height: 18px; }
  /* secondary controls stack in a rail down the right edge, away from the walk pad */
  #worldMissionBtn, #worldPhotoBtn, #worldDayBtn, #worldSoundBtn, #worldHelpBtn { position: fixed; right: 12px; z-index: 6; }
  #worldMissionBtn { top: calc(68px + env(safe-area-inset-top, 0px)); }
  #worldPhotoBtn { top: calc(120px + env(safe-area-inset-top, 0px)); }
  #worldDayBtn { top: calc(172px + env(safe-area-inset-top, 0px)); }
  #worldSoundBtn { top: calc(224px + env(safe-area-inset-top, 0px)); }
  #worldHelpBtn { top: calc(276px + env(safe-area-inset-top, 0px)); }
  .world-chip.is-on, .world-chip[aria-pressed="true"] { background: var(--accent); border-color: transparent; }
  .world-mission { top: calc(68px + env(safe-area-inset-top, 0px)); right: 68px; left: 12px; width: auto; }
  .world-sound { top: calc(224px + env(safe-area-inset-top, 0px)); right: 68px; left: auto; width: min(260px, calc(100vw - 80px)); }
  .world-tip { right: 68px; left: 12px; width: auto; top: calc(276px + env(safe-area-inset-top, 0px)); }
}
