/* TRANCA HOVER — UI design system
   Poster DNA: cream paper, ink outlines, hard sticker shadows, soft-serif display, pastel only. */

@font-face { font-family: 'Fraunces'; src: url(../assets/fonts/fraunces-latin.woff2) format('woff2'); font-weight: 600 900; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(../assets/fonts/rubik-latin.woff2) format('woff2'); font-weight: 500 900; font-display: swap; }

:root {
  --ink: #1d1a1f; --ink-60: rgba(29, 26, 31, .62); --ink-30: rgba(29, 26, 31, .3);
  --cream: #f4efe3; --cream-2: #ebe3d2; --paper: #fbf8f1;
  --pink: #f6b8c8; --pink-2: #ee98b2; --yellow: #fbe7a1; --yellow-2: #f6d672; --blue: #a9d8f0; --blue-2: #7ec2e6;
  --mint: #bfe8d2; --mint-2: #8fd4b1; --lilac: #d9c8f2; --lilac-2: #b9a2e8; --peach: #f9cdb3;
  --sh: 0 4px 0 var(--ink); --sh-sm: 0 3px 0 var(--ink); --sh-lg: 0 6px 0 var(--ink);
  --display: 'Fraunces', 'Cooper Black', Georgia, serif; --ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --pop: cubic-bezier(.34, 1.56, .64, 1); --out: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--cream); color: var(--ink); font-family: var(--ui); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
.display, h2, .card-title, .title-hover, .big-score, .btn-xl, .btn-play, .callout, .world-card h3, .countdown {
  font-family: var(--display); font-weight: 900; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144;
}
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }

#app { position: fixed; inset: 0; overflow: hidden; }
#game { position: absolute; inset: 0; display: block; touch-action: none; }

/* ---------- film grain + vignette (airbrushed 90s TV feel) ---------- */
#fx-grain { position: absolute; inset: -80px; z-index: 5; pointer-events: none; opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .45 0 0 0 .9 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(5) infinite; }
#fx-grain::after { content: ''; position: absolute; inset: 80px; box-shadow: inset 0 0 140px rgba(90, 50, 110, .55); }
@keyframes grain { 0% { transform: translate(0, 0) } 20% { transform: translate(-26px, 14px) } 40% { transform: translate(18px, -22px) } 60% { transform: translate(-10px, -8px) } 80% { transform: translate(22px, 18px) } 100% { transform: translate(0, 0) } }

/* ---------- shared atoms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border: 2.5px solid var(--ink); border-radius: 999px;
  background: var(--paper); box-shadow: var(--sh-sm); font: 800 15px/1 var(--ui); letter-spacing: .05em; text-transform: uppercase; transition: transform .08s ease, box-shadow .08s ease, background .2s; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--pink); }
.btn-yellow { background: var(--yellow); }
.btn-mint { background: var(--mint); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--ink-30); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost.danger { color: #b8476a; border-color: rgba(184, 71, 106, .4); }
.btn-xl { min-height: 64px; font-size: 26px; letter-spacing: .04em; text-transform: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); box-shadow: var(--sh-sm); display: grid; place-items: center; padding: 0; transition: transform .08s, box-shadow .08s; }
.icon-btn svg { width: 22px; height: 22px; fill: var(--ink); color: var(--ink); }
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 10px; border-radius: 999px; border: 2.5px solid var(--ink); background: var(--paper); box-shadow: var(--sh-sm); font: 800 16px var(--ui); font-variant-numeric: tabular-nums; }
.ico-bone { width: 28px; height: 18px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); font: 800 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.chip.time { background: var(--yellow); } .chip.prize { background: var(--mint); } .chip.lock { background: var(--lilac); }
.sticker { display: inline-block; padding: 8px 16px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--yellow); box-shadow: var(--sh-sm); font: 900 16px var(--ui); text-transform: uppercase; letter-spacing: .04em; transform: rotate(-5deg); }
.sticker.sm { font-size: 12px; padding: 6px 11px; } .sticker.mint { background: var(--mint); } .sticker.yellow { background: var(--yellow); }
.muted { color: var(--ink-60); font-weight: 500; line-height: 1.45; }
.center { text-align: center; }
.legal { font-size: 11px; line-height: 1.4; color: var(--ink-60); text-align: center; margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.row > .btn { flex: 1 1 140px; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 20; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(14px);
  transition: opacity .32s var(--out), transform .45s var(--out), visibility 0s .32s; }
.screen.show { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .32s var(--out), transform .45s var(--out); }

/* loading */
.loading { background: radial-gradient(120% 80% at 50% 40%, #fff7fa 0%, var(--cream) 60%); display: grid; place-items: center; z-index: 60; }
.load-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; width: min(320px, 80vw); }
.logo { fill: var(--pink-2); stroke: var(--ink); stroke-width: 14px; paint-order: stroke; overflow: visible; filter: drop-shadow(0 5px 0 var(--ink)); }
.logo-load { width: 230px; height: 46px; }
.load-dog { width: 150px; height: auto; animation: hoverbob 1.1s ease-in-out infinite; filter: drop-shadow(0 18px 10px rgba(110, 60, 120, .18)); }
.bar { width: 100%; height: 18px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; box-shadow: var(--sh-sm); }
.bar i { display: block; height: 100%; width: 0; border-right: 2.5px solid var(--ink); transition: width .25s var(--out);
  background: repeating-linear-gradient(-45deg, var(--pink) 0 10px, var(--yellow) 10px 20px); background-size: 28px 28px; animation: stripes .6s linear infinite; }
.load-line { font: 700 14px var(--ui); color: var(--ink-60); min-height: 20px; text-align: center; }
@keyframes stripes { to { background-position: 28px 0; } }
@keyframes hoverbob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }

/* home */
.home { display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--sat) + 12px) calc(var(--sar) + 16px) calc(var(--sab) + 96px) calc(var(--sal) + 16px);
  background: linear-gradient(to bottom, rgba(244, 239, 227, .94) 0%, rgba(244, 239, 227, .55) 20%, rgba(244, 239, 227, 0) 36%, rgba(244, 239, 227, 0) 54%, rgba(244, 239, 227, .82) 72%, rgba(244, 239, 227, .97) 100%); }
.topbar { display: flex; justify-content: space-between; align-items: center; }
.topbar-r { display: flex; gap: 10px; }
.hero { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 2vh; }
.title { display: flex; flex-direction: column; align-items: center; gap: 0; }
.title .logo { width: min(74vw, 360px); height: calc(min(74vw, 360px) * .19); }
.title-hover { font-size: clamp(38px, 12vw, 70px); letter-spacing: .14em; line-height: 1; margin-top: 10px; margin-right: -.14em; color: var(--ink);
  text-shadow: 3px 3px 0 var(--yellow-2), 6px 6px 0 var(--ink); }
.tagline { margin-top: 14px; background: var(--mint); animation: wobble 3.2s ease-in-out infinite; }
.spark, .flower { position: absolute; width: 34px; height: 34px; animation: twinkle 2.4s ease-in-out infinite; }
.spark.s1 { left: 4%; top: 6%; } .spark.s2 { right: 6%; top: 52%; width: 26px; height: 26px; animation-delay: -1.2s; }
.flower { left: 9%; top: 72%; width: 30px; height: 30px; fill: var(--pink); animation: spin 9s linear infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(.7) rotate(20deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(-2deg) translateY(-2px); } }

.home-dock { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn-play { width: min(100%, 360px); min-height: 76px; justify-content: space-between; padding: 0 10px 0 32px; font-size: 38px; letter-spacing: .06em; text-transform: none;
  background: var(--pink); box-shadow: var(--sh-lg); animation: breathe 2.4s ease-in-out infinite; }
.btn-play svg { width: 54px; height: 54px; padding: 13px; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); fill: var(--ink); }
.btn-play:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); animation: none; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.home-meta { display: flex; align-items: center; gap: 8px; font: 700 14px var(--ui); color: var(--ink-60); }
.home-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-word { display: inline-flex; gap: 3px; }
.mini-word i { width: 18px; height: 20px; border-radius: 5px; border: 2px solid var(--ink); display: grid; place-items: center; font: 900 11px var(--display); font-style: normal; color: var(--ink-30); background: rgba(255, 255, 255, .5); }
.mini-word i.on { background: var(--pink); color: var(--ink); }

.ev-strip { width: 100%; max-width: 720px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; scrollbar-width: none; touch-action: pan-x; }
.ev-strip::-webkit-scrollbar { display: none; }
.ev-mini { flex: 0 0 min(78%, 280px); scroll-snap-align: start; display: flex; gap: 10px; align-items: stretch; text-align: left; padding: 8px; border: 2.5px solid var(--ink); border-radius: 20px; background: var(--paper); box-shadow: var(--sh-sm); }
.ev-mini:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ev-mini .thumb { width: 74px; flex: none; border-radius: 13px; border: 2px solid var(--ink); background-size: cover; background-position: center; }
.ev-mini .meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 2px 0; }
.ev-mini .k { font: 800 10px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-60); }
.ev-mini .t { font: 900 18px/1.05 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.ev-mini .chip { align-self: flex-start; height: 22px; font-size: 10px; }

/* tab bar */
.tabbar { position: absolute; z-index: 25; left: 50%; bottom: calc(var(--sab) + 10px); transform: translateX(-50%); width: min(calc(100% - 20px), 480px);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; gap: 4px; border: 2.5px solid var(--ink); border-radius: 999px; background: rgba(251, 248, 241, .96); box-shadow: var(--sh);
  transition: transform .35s var(--out), opacity .25s; }
.tabbar.hide { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.tabbar button { position: relative; border: 0; background: transparent; border-radius: 999px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 800 10.5px var(--ui); letter-spacing: .04em; color: var(--ink-60); transition: background .2s, color .2s; }
.tabbar button svg { width: 22px; height: 22px; fill: currentColor; }
.tabbar button.on { background: var(--pink); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--yellow-2); border: 2px solid var(--ink); font: 900 10px/14px var(--ui); color: var(--ink); font-style: normal; }

/* pages */
.page { background: var(--cream); overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: calc(var(--sat) + 22px) calc(var(--sar) + 16px) calc(var(--sab) + 120px) calc(var(--sal) + 16px); }
.page > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.page-head { margin-bottom: 18px; }
.kicker { font: 800 12px var(--ui); letter-spacing: .16em; text-transform: uppercase; color: #c9688a; margin-bottom: 4px; }
.page h2 { font-size: clamp(34px, 9.5vw, 52px); line-height: .98; letter-spacing: -.01em; }
.lead { margin-top: 8px; font: 500 15px/1.45 var(--ui); color: var(--ink-60); max-width: 520px; }

/* events list */
.ev-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ev-card { border: 2.5px solid var(--ink); border-radius: 24px; background: var(--paper); box-shadow: var(--sh); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; }
.ev-card .art { aspect-ratio: 16 / 7.5; background-size: cover; background-position: center 60%; border-bottom: 2.5px solid var(--ink); position: relative; }
.ev-card .art .chip { position: absolute; left: 10px; top: 10px; }
.ev-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.ev-card h3 { font: 900 26px/1 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.ev-card p { font: 500 14px/1.4 var(--ui); color: var(--ink-60); }
.ev-card .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-card.locked .art { filter: saturate(.5) brightness(1.04); }
.ev-card:active { transform: translateY(2px); box-shadow: var(--sh-sm); }

/* wallet + tickets */
.how-to { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.how { border: 2px dashed var(--ink-30); border-radius: 16px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.how p { font: 700 12px/1.25 var(--ui); color: var(--ink-60); }
.wallet { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.empty { text-align: center; padding: 26px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty img { width: 150px; opacity: .9; animation: hoverbob 1.6s ease-in-out infinite; }
.empty h4 { font: 900 22px var(--display); }

.ticket { --t-bg: var(--pink); position: relative; display: flex; min-height: 122px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--t-bg); box-shadow: var(--sh); text-align: left; padding: 0; width: 100%; }
.ticket::before, .ticket::after { content: ''; position: absolute; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; background: var(--cream); border: 2.5px solid var(--ink); }
.ticket::before { left: -14px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -14px; clip-path: inset(0 50% 0 0); }
.card .ticket::before, .card .ticket::after { background: var(--paper); }
.ticket.b-heineken { --t-bg: #c4ead0; } .ticket.b-hellmanns { --t-bg: #d3def6; } .ticket.b-tranca { --t-bg: var(--pink); }
.t-main { flex: 1; padding: 14px 10px 14px 20px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-brand { font: 800 11px var(--ui); letter-spacing: .14em; text-transform: uppercase; }
.t-title { font: 900 30px/1 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; margin-top: 2px; }
.t-detail { font: 600 13px/1.3 var(--ui); }
.t-how { font: 600 11px var(--ui); color: var(--ink-60); margin-top: auto; padding-top: 6px; }
.t-stub { width: 42%; max-width: 172px; flex: none; border-left: 2.5px dashed var(--ink); padding: 12px 18px 12px 12px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.t-code { font: 800 12px var(--ui); letter-spacing: .02em; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: 7px 4px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-exp { font: 700 10.5px var(--ui); color: var(--ink-60); text-align: center; }
.ticket .stamp { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.ticket .stamp span { font: 900 26px var(--display); color: #b8476a; border: 3px solid #b8476a; border-radius: 10px; padding: 2px 12px; transform: rotate(-12deg); background: rgba(255, 255, 255, .6); }
.ticket.dim { opacity: .55; }
.ticket.new { animation: ticketIn .7s var(--pop) both; }
.ticket .new-burst { position: absolute; top: -12px; right: 16px; background: var(--yellow-2); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font: 900 11px var(--ui); transform: rotate(6deg); }
@keyframes ticketIn { from { transform: rotateX(70deg) translateY(-20px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* coupon full view */
.coupon-view .ticket { margin-top: 8px; overflow: hidden; }
.coupon-view .ticket .shine { position: absolute; inset: 0; border-radius: 16px; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%); background-size: 260% 100%; animation: shine 2.4s linear infinite; pointer-events: none; }
.coupon-view .t-code { font-size: 11px; letter-spacing: 0; }
.big-code { margin: 16px auto 6px; font: 900 clamp(26px, 8vw, 36px) var(--ui); letter-spacing: .08em; text-align: center; font-variant-numeric: tabular-nums; }
#cvWhere a { color: var(--ink); font-weight: 800; text-underline-offset: 2px; }
.live { display: flex; justify-content: center; gap: 8px; align-items: center; font: 800 12px var(--ui); color: var(--ink-60); margin-bottom: 6px; }
.live::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #6fcf97; box-shadow: 0 0 0 0 rgba(111, 207, 151, .6); animation: ping 1.4s infinite; }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(111, 207, 151, .7); } 100% { box-shadow: 0 0 0 10px rgba(111, 207, 151, 0); } }

/* dogs */
.dogs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
.dog { border: 2.5px solid var(--ink); border-radius: 22px; background: var(--paper); box-shadow: var(--sh); padding: 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.dog .pic { aspect-ratio: 1.15; border-radius: 16px; border: 2px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.dog .pic img { width: 92%; height: auto; transition: transform .3s var(--pop); }
.dog.sel .pic img { animation: hoverbob 1.3s ease-in-out infinite; }
.dog h4 { font: 900 20px/1.05 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.dog p { font: 500 12.5px/1.35 var(--ui); color: var(--ink-60); flex: 1; }
.dog .btn { min-height: 42px; font-size: 13px; }
.dog.sel { background: #fff3f7; }

/* ---------- modals ---------- */
.modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: calc(var(--sat) + 14px) 14px calc(var(--sab) + 14px);
  background: rgba(46, 28, 62, .34); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .2s ease both; overflow-y: auto; }
.card { position: relative; width: min(100%, 430px); max-height: 100%; overflow-y: auto; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 28px; box-shadow: var(--sh-lg);
  padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 12px; animation: popIn .42s var(--pop) both; touch-action: pan-y; }
.card > .btn { width: 100%; }
.card > .sticker { align-self: center; }
.card-title { font-size: clamp(26px, 7.4vw, 34px); line-height: 1.02; text-align: center; }
.card-title.left { text-align: left; }
.card .close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; z-index: 2; }
.modal.sheet { align-items: end; }
.modal.sheet .card { animation: sheetUp .45s var(--out) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(.86) translateY(10px); opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } }

.over { align-items: stretch; text-align: center; }
.card > .col { display: flex; flex-direction: column; gap: 12px; }
.card > .col > .btn { width: 100%; }
.card > .col > .sticker { align-self: center; }
.over-badge { align-self: center; background: var(--yellow-2); margin-bottom: -4px; animation: wobble 1.4s ease-in-out infinite; }
.big-score { font-size: clamp(52px, 16vw, 76px); line-height: .9; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { border: 2px solid var(--ink); border-radius: 14px; padding: 7px 4px; background: var(--cream); }
.stat b { display: block; font: 900 18px var(--display); font-variant-numeric: tabular-nums; }
.stat span { font: 700 10px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-60); }
.over-coupons { display: grid; gap: 12px; }
.over-coupons:empty, .over-progress:empty { display: none; }
.over-progress { border: 2px dashed var(--ink-30); border-radius: 16px; padding: 10px 12px; font: 700 13px/1.35 var(--ui); color: var(--ink-60); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.over-progress .mini-word i { width: 26px; height: 28px; font-size: 15px; border-width: 2.5px; border-radius: 8px; }

.ev-detail { padding: 0; gap: 0; }
.ev-hero { aspect-ratio: 16 / 8; background-size: cover; background-position: center 65%; border-bottom: 2.5px solid var(--ink); border-radius: 25px 25px 0 0; flex: none; }
.ev-detail-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.ev-detail-body > .chip { align-self: flex-start; }
.ev-detail-body p { font: 500 15px/1.45 var(--ui); color: var(--ink-60); }
.prize { display: flex; align-items: center; gap: 12px; border: 2.5px solid var(--ink); border-radius: 18px; padding: 10px 14px; background: var(--yellow); }
.prize b { font: 900 24px/1 var(--display); }
.prize small { display: block; font: 700 12px var(--ui); color: var(--ink-60); }
.rules { margin: 0; padding-left: 20px; font: 500 14px/1.5 var(--ui); }
.time-note { font: 800 12px var(--ui) !important; letter-spacing: .06em; text-transform: uppercase; color: #c9688a !important; }

.toggles { display: grid; gap: 8px; }
.toggles.compact { grid-template-columns: 1fr 1fr; }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 16px; background: var(--cream); font: 700 14px var(--ui); text-align: left; }
.tg .sw { width: 46px; height: 28px; border-radius: 999px; border: 2px solid var(--ink); background: var(--cream-2); position: relative; flex: none; transition: background .2s; }
.tg .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); transition: transform .25s var(--pop); }
.tg[aria-pressed='true'] .sw { background: var(--mint-2); }
.tg[aria-pressed='true'] .sw::after { transform: translateX(18px); }
.howplay { border: 2px dashed var(--ink-30); border-radius: 16px; padding: 12px 14px; }
.howplay h4 { font: 900 18px var(--display); margin-bottom: 6px; }
.howplay ul { margin: 0; padding-left: 18px; font: 500 13.5px/1.5 var(--ui); }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; z-index: 10; pointer-events: none; padding: calc(var(--sat) + 10px) calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px); }
.hud-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; }
.hud-l { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hud-r { justify-self: end; display: flex; gap: 8px; align-items: center; }
.hud-c { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hearts { display: flex; gap: 3px; }
.hearts svg { width: 28px; height: 28px; fill: var(--pink-2); filter: drop-shadow(0 2px 0 var(--ink)); transition: transform .3s var(--pop); }
.hearts svg.off { fill: rgba(255, 255, 255, .55); filter: none; transform: scale(.85); }
.hearts.hurt { animation: shake .4s; }
.hearts svg.gain { animation: pop .5s var(--pop); }
.score-pill { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: rgba(251, 248, 241, .94); box-shadow: var(--sh-sm); font: 800 19px var(--ui); font-variant-numeric: tabular-nums; min-width: 92px; }
.mult { background: var(--yellow-2); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 7px; font-size: 13px; transform: rotate(-7deg); }
.mult.bump { animation: pop .45s var(--pop); }
.bone-pill { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 8px; border: 2.5px solid var(--ink); border-radius: 999px; background: rgba(251, 248, 241, .94); box-shadow: var(--sh-sm); font: 800 17px var(--ui); font-variant-numeric: tabular-nums; }
.bone-pill .ico-bone { width: 25px; height: 16px; }
.bone-pill.bump { animation: pop .32s var(--pop); }
#btnPause { pointer-events: auto; width: 44px; height: 44px; }
#btnPause svg { width: 18px; height: 18px; }
.word { display: flex; gap: 4px; }
.word span { width: 30px; height: 34px; border: 2.5px solid var(--ink); border-radius: 10px; background: rgba(251, 248, 241, .55); display: grid; place-items: center;
  font: 900 18px var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; color: rgba(29, 26, 31, .28); }
.word span.on { background: var(--pink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.word span.pop { animation: pop .6s var(--pop); }
.word.done span { background: var(--yellow-2); }
.ev-goal { display: flex; gap: 6px; align-items: center; }
.ev-timer { height: 38px; min-width: 70px; padding: 0 12px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--yellow); box-shadow: var(--sh-sm); display: grid; place-items: center; font: 900 19px var(--ui); font-variant-numeric: tabular-nums; }
.ev-timer.low { background: var(--pink); animation: pop .5s infinite; }
.ev-progress { height: 38px; padding: 0 12px; border: 2.5px solid var(--ink); border-radius: 999px; background: rgba(251, 248, 241, .94); box-shadow: var(--sh-sm); display: flex; align-items: center; gap: 6px; font: 900 17px var(--ui); font-variant-numeric: tabular-nums; }
.ev-progress .star { width: 22px; height: 22px; }
.recipe { display: flex; align-items: center; gap: 3px; }
.recipe img { width: 24px; height: 24px; object-fit: contain; opacity: .35; transition: opacity .2s, transform .3s var(--pop); }
.recipe img.done { opacity: 1; filter: grayscale(.2); }
.recipe img.next { opacity: 1; transform: scale(1.3); filter: drop-shadow(0 0 4px #fff) drop-shadow(0 2px 0 var(--ink)); }
.recipe .cnt { margin-left: 6px; }
.powers { display: flex; gap: 6px; margin-top: 8px; }
.power { --p: 1; --c: var(--pink); width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; box-shadow: var(--sh-sm);
  background: conic-gradient(var(--c) calc(var(--p) * 1turn), rgba(251, 248, 241, .85) 0); font: 900 12px var(--ui); animation: pop .4s var(--pop); }
.power i { width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); display: grid; place-items: center; font-style: normal; font-size: 14px; }

/* callouts */
.callouts { position: absolute; left: 0; right: 0; top: calc(var(--sat) + 24%); z-index: 12; display: grid; place-items: center; pointer-events: none; }
.callout { grid-area: 1 / 1; position: relative; padding: 22px 34px; font-size: clamp(26px, 8vw, 50px); line-height: 1; color: var(--ink); white-space: nowrap; animation: callout 1.25s var(--out) forwards; }
.callout .bg { position: absolute; inset: 0; background: var(--ink); z-index: -2; }
.callout .bg2 { position: absolute; inset: 4px; background: var(--yellow); z-index: -1; }
.callout.c1 .bg2 { background: var(--pink); } .callout.c2 .bg2 { background: var(--mint); } .callout.c3 .bg2 { background: var(--blue); } .callout.c4 .bg2 { background: var(--lilac); }
@keyframes callout { 0% { transform: scale(.2) rotate(-14deg); opacity: 0; } 16% { transform: scale(1.12) rotate(-4deg); opacity: 1; } 26% { transform: scale(1) rotate(-6deg); } 78% { transform: scale(1) rotate(-6deg); opacity: 1; } 100% { transform: scale(.9) translateY(-30px) rotate(-6deg); opacity: 0; } }

/* world title card (time-warp) */
.world-card { position: absolute; z-index: 12; left: calc(var(--sal) + 16px); top: calc(var(--sat) + 34%); pointer-events: none; opacity: 0; }
.world-card.show { animation: wcard 3.4s var(--out) forwards; }
.world-card .k { display: inline-block; font: 900 13px var(--ui); letter-spacing: .18em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 5px 10px; border-radius: 8px; }
.world-card h3 { font-size: clamp(36px, 10vw, 64px); line-height: .95; margin-top: 8px; color: var(--paper); -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); }
.world-card .tag { display: inline-block; margin-top: 10px; font: 800 14px var(--ui); background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 5px 12px; box-shadow: var(--sh-sm); transform: rotate(-3deg); }
.world-card .lap { display: inline-block; margin-left: 8px; background: var(--yellow-2); }
@keyframes wcard { 0% { opacity: 0; transform: translateX(-60px) skewX(-8deg); } 12% { opacity: 1; transform: none; } 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(40px); } }

/* tutorial hint */
.hint { position: absolute; z-index: 14; left: 50%; bottom: calc(var(--sab) + 9%); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 12px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 24px; box-shadow: var(--sh); font: 800 18px/1.15 var(--ui); pointer-events: none; white-space: nowrap; animation: hintIn .4s var(--pop) both; }
.hint small { display: block; font: 600 12px var(--ui); color: var(--ink-60); }
.gest { position: relative; width: 56px; height: 56px; border-radius: 16px; background: var(--yellow); border: 2.5px solid var(--ink); flex: none; overflow: hidden; }
.gest::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--pink-2); border: 2.5px solid var(--ink); left: 16px; top: 16px; }
.gest.tap::after { animation: tapG 1s ease-in-out infinite; }
.gest.up::after { animation: upG 1s ease-in-out infinite; }
.gest.down::after { animation: upG 1s ease-in-out infinite reverse; }
.gest.right::after { animation: rightG 1s ease-in-out infinite; }
@keyframes tapG { 0%, 100% { transform: scale(1); } 40% { transform: scale(.6); box-shadow: 0 0 0 10px rgba(238, 152, 178, .35); } }
@keyframes upG { 0% { transform: translateY(14px); opacity: 0; } 20% { opacity: 1; } 80% { transform: translateY(-14px); opacity: 1; } 100% { opacity: 0; } }
@keyframes rightG { 0% { transform: translateX(-14px); opacity: 0; } 20% { opacity: 1; } 80% { transform: translateX(16px); opacity: 1; } 100% { opacity: 0; } }
@keyframes hintIn { from { transform: translate(-50%, 30px) scale(.9); opacity: 0; } }

/* toasts */
.toasts { position: absolute; z-index: 50; left: 50%; top: calc(var(--sat) + 96px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; background: var(--mint); border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: var(--sh); font: 800 14px/1.2 var(--ui); animation: toastIn .5s var(--pop) both, toastOut .4s ease 3.4s forwards; }
.toast .tk { width: 40px; height: 40px; border-radius: 12px; background: var(--yellow-2); border: 2px solid var(--ink); display: grid; place-items: center; flex: none; }
.toast .tk svg { width: 22px; height: 22px; fill: var(--ink); }
.toast small { display: block; font: 600 12px var(--ui); color: var(--ink-60); }
@keyframes toastIn { from { transform: translateY(-20px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-14px); opacity: 0; } }

.countdown { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; pointer-events: none; }
.countdown span { font-size: 120px; color: var(--paper); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); animation: cd .9s var(--pop) both; }
@keyframes cd { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* ---------- shop (real Tranca merch, links out to trancaenuna.com) ---------- */
.shop-cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 12px; touch-action: pan-x; }
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cats .chip { height: 36px; padding: 0 16px; font-size: 12px; flex: none; }
.chip.on { background: var(--ink); color: var(--paper); }
.shop-coupon { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--yellow); box-shadow: var(--sh-sm); font: 600 13px/1.35 var(--ui); }
.shop-coupon .sticker { transform: rotate(-4deg); flex: none; }
.shop-coupon .btn { flex: none; margin-left: auto; }
.shop-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
.prod { border: 2.5px solid var(--ink); border-radius: 22px; background: var(--paper); box-shadow: var(--sh); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.prod.woolly { background: #fff3f7; background-image: repeating-linear-gradient(90deg, rgba(238, 152, 178, .08) 0 7px, rgba(255, 255, 255, 0) 7px 14px); }
.pimg { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 15px; border: 2px solid var(--ink); overflow: hidden; background: #fff; }
.pimg img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--out); }
.prod:hover .pimg img { transform: scale(1.04); }
.pnote { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 5px 8px; border-radius: 10px; border: 2px solid var(--ink); background: var(--mint); color: var(--ink); font: 800 10.5px/1.2 var(--ui); }
.prod h4 { font: 900 16px/1.1 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; margin-top: 2px; }
.price { font: 800 15px var(--ui); font-variant-numeric: tabular-nums; }
.prod .btn { margin-top: auto; text-decoration: none; color: var(--ink); }
a.btn { text-decoration: none; color: var(--ink); }
.btn > svg { flex: none; }

.merch-mini { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mm { min-width: 0; }
.merch-mini:empty { display: none; }
.mm { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 7px; border: 2.5px solid var(--ink); border-radius: 18px; background: #fff3f7; box-shadow: var(--sh-sm); text-decoration: none; color: var(--ink); text-align: left;
  background-image: repeating-linear-gradient(90deg, rgba(238, 152, 178, .1) 0 6px, rgba(255, 255, 255, 0) 6px 12px); }
.mm:active { transform: translateY(2px); box-shadow: none; }
.mm img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; border: 2px solid var(--ink); flex: none; background: #fff; }
.mm-t { display: flex; flex-direction: column; min-width: 0; flex: 1; font: 800 13px/1.2 var(--ui); }
.mm-t small { font: 700 10px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-60); }
.mm-t b { font: 900 15px/1.1 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-cta { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--pink); font: 800 12px var(--ui); text-transform: uppercase; flex: none; }
.mm-cta svg { width: 14px; height: 14px; }
.real-link { display: inline-flex; align-items: center; gap: 4px; font: 700 11.5px/1.3 var(--ui); color: #b04f74; text-decoration: underline; text-underline-offset: 2px; }
.real-link svg { width: 12px; height: 12px; flex: none; }

/* woolly passage title card: knitted label look */
.world-card.lana .k { background: var(--pink-2); color: var(--ink); border: 2px solid var(--ink); }
.world-card .tag.prod { display: flex; align-items: center; gap: 8px; margin-top: 8px; transform: rotate(-2deg); background: #fff3f7; width: max-content; max-width: 86vw; }
.world-card .tag.prod img { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--ink); object-fit: cover; }
.ev-mini.woolly { background: #fff3f7; }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .hud-row { grid-template-columns: 1fr auto; }
  .hud-c { grid-column: 1 / -1; grid-row: 2; margin-top: -2px; }
  .word span { width: 28px; height: 32px; font-size: 17px; }
}
.feat-ev { display: none; }
@media (orientation: landscape) and (max-height: 540px) {
  /* home: left column for brand + CTA, the live hover-dog owns the right side, tabs become a right rail */
  .home { padding: calc(var(--sat) + 10px) calc(var(--sar) + 92px) calc(var(--sab) + 12px) calc(var(--sal) + 18px);
    background: linear-gradient(to right, rgba(244, 239, 227, .96) 0%, rgba(244, 239, 227, .78) 32%, rgba(244, 239, 227, 0) 52%); }
  .topbar { margin-right: -76px; }
  .hero { align-items: flex-start; margin-top: 0; }
  .title { align-items: flex-start; }
  .title .logo { width: min(34vw, 290px); height: calc(min(34vw, 290px) * .19); }
  .title-hover { font-size: clamp(28px, 6vw, 52px); margin-top: 6px; }
  .tagline { margin-top: 8px; font-size: 13px; padding: 6px 12px; }
  .home-dock { align-items: flex-start; gap: 8px; }
  .btn-play { width: 300px; min-height: 62px; font-size: 32px; }
  .btn-play svg { width: 44px; height: 44px; padding: 10px; }
  .ev-strip { display: none; }
  .feat-ev { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper); box-shadow: var(--sh-sm); font: 800 12px var(--ui); max-width: 300px; }
  .feat-ev .chip { height: 24px; font-size: 10px; background: var(--mint); }
  .feat-ev span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .spark.s2, .flower { display: none; }
  .tabbar { left: auto; right: calc(var(--sar) + 12px); top: 50%; bottom: auto; transform: translateY(-50%); width: 74px; grid-template-columns: 1fr; border-radius: 37px; padding: 6px; }
  .tabbar.hide { transform: translate(140%, -50%); }
  .tabbar button { height: 50px; }
  .tabbar button span { font-size: 9.5px; }
  .over .merch-mini .mm img { width: 42px; height: 42px; }
  .badge { right: 4px; }
  .page { padding-right: calc(var(--sar) + 96px); padding-bottom: calc(var(--sab) + 24px); }
  .callouts { top: 16%; }
  .world-card { top: 22%; }
  .hint { bottom: calc(var(--sab) + 5%); }
  /* modals: go wide, two columns, primary action always above the fold */
  .modal, .modal.sheet { align-items: center; padding-top: calc(var(--sat) + 10px); padding-bottom: calc(var(--sab) + 10px); }
  .card { max-height: calc(100vh - 20px); }
  .card.over, .card.coupon-view { width: min(100%, 780px); flex-direction: row; align-items: flex-start; gap: 20px; padding-top: 18px; padding-bottom: 16px; }
  .card.over > .col, .card.coupon-view > .col { flex: 1 1 0; min-width: 0; margin-block: auto; gap: 10px; }
  .over .over-progress { padding: 8px 10px; }
  .over .stats { grid-template-columns: repeat(2, 1fr); }
  .over .big-score { font-size: 56px; }
  .over .btn-xl { min-height: 56px; }
  .coupon-view .big-code { font-size: 24px; white-space: nowrap; }
  .coupon-view .row { flex-direction: column; }
  .coupon-view .row > .btn { flex: none; width: 100%; }
  .ev-detail { flex-direction: row; width: min(100%, 800px); }
  .ev-hero { aspect-ratio: auto; width: 42%; border-bottom: 0; border-right: 2.5px solid var(--ink); border-radius: 25px 0 0 25px; }
  .ev-detail-body { overflow-y: auto; flex: 1; }
}
@media (min-width: 900px) and (min-height: 600px) {
  .home { padding-bottom: calc(var(--sab) + 110px); }
}
@media (hover: hover) {
  .btn:hover, .icon-btn:hover, .ev-mini:hover, .ev-card:hover { filter: brightness(1.03); }
  .tabbar button:hover:not(.on) { background: var(--cream-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #fx-grain { animation: none; }
}
html.reduced #fx-grain { animation: none; }
html.reduced .btn-play, html.reduced .tagline, html.reduced .spark, html.reduced .flower { animation: none; }
