@font-face { font-family: 'Lilita One'; src: url('../fonts/lilita-one.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../fonts/fredoka-500.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../fonts/fredoka-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../fonts/fredoka-700.woff2') format('woff2'); font-weight: 700 900; font-display: swap; }

:root {
  /* Campaign palette — from the Nature Ndio Form lock-up */
  --olive: #57662f;
  --olive-dark: #3f4b20;
  --forest: #2c3517;
  --cream: #f4f3e6;
  --sand: #e7dcc0;
  --gold: #f2b33d;
  --gold-dark: #c98a17;
  --sunset: #e8553b;
  --ink: #26300b;
  --shadow: 0 6px 0 rgba(38, 48, 11, .25), 0 14px 30px rgba(38, 48, 11, .18);
  --display: 'Lilita One', 'Arial Rounded MT Bold', Impact, sans-serif;
  --body: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f6e2b3; color: var(--ink); font-family: var(--body); }
body { overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; }
.hidden { display: none !important; }

/* ---------- Sticker type (matches the Nature Ndio Form lock-up: white letters, thick olive outline) ---------- */
.sticker {
  font-family: var(--display); color: #fff; letter-spacing: .5px; line-height: .92;
  text-shadow: 0.060em 0.000em 0 var(--olive), 0.055em 0.023em 0 var(--olive), 0.042em 0.042em 0 var(--olive), 0.023em 0.055em 0 var(--olive), 0.000em 0.060em 0 var(--olive), -0.023em 0.055em 0 var(--olive), -0.042em 0.042em 0 var(--olive), -0.055em 0.023em 0 var(--olive), -0.060em 0.000em 0 var(--olive), -0.055em -0.023em 0 var(--olive), -0.042em -0.042em 0 var(--olive), -0.023em -0.055em 0 var(--olive), -0.000em -0.060em 0 var(--olive), 0.023em -0.055em 0 var(--olive), 0.042em -0.042em 0 var(--olive), 0.055em -0.023em 0 var(--olive), 0.110em 0.000em 0 var(--olive), 0.102em 0.042em 0 var(--olive), 0.078em 0.078em 0 var(--olive), 0.042em 0.102em 0 var(--olive), 0.000em 0.110em 0 var(--olive), -0.042em 0.102em 0 var(--olive), -0.078em 0.078em 0 var(--olive), -0.102em 0.042em 0 var(--olive), -0.110em 0.000em 0 var(--olive), -0.102em -0.042em 0 var(--olive), -0.078em -0.078em 0 var(--olive), -0.042em -0.102em 0 var(--olive), -0.000em -0.110em 0 var(--olive), 0.042em -0.102em 0 var(--olive), 0.078em -0.078em 0 var(--olive), 0.102em -0.042em 0 var(--olive), 0 .17em 0 rgba(38,48,11,.28);
}
.sticker.gold { color: var(--gold); text-shadow: 0.060em 0.000em 0 var(--forest), 0.055em 0.023em 0 var(--forest), 0.042em 0.042em 0 var(--forest), 0.023em 0.055em 0 var(--forest), 0.000em 0.060em 0 var(--forest), -0.023em 0.055em 0 var(--forest), -0.042em 0.042em 0 var(--forest), -0.055em 0.023em 0 var(--forest), -0.060em 0.000em 0 var(--forest), -0.055em -0.023em 0 var(--forest), -0.042em -0.042em 0 var(--forest), -0.023em -0.055em 0 var(--forest), -0.000em -0.060em 0 var(--forest), 0.023em -0.055em 0 var(--forest), 0.042em -0.042em 0 var(--forest), 0.055em -0.023em 0 var(--forest), 0.100em 0.000em 0 var(--forest), 0.092em 0.038em 0 var(--forest), 0.071em 0.071em 0 var(--forest), 0.038em 0.092em 0 var(--forest), 0.000em 0.100em 0 var(--forest), -0.038em 0.092em 0 var(--forest), -0.071em 0.071em 0 var(--forest), -0.092em 0.038em 0 var(--forest), -0.100em 0.000em 0 var(--forest), -0.092em -0.038em 0 var(--forest), -0.071em -0.071em 0 var(--forest), -0.038em -0.092em 0 var(--forest), -0.000em -0.100em 0 var(--forest), 0.038em -0.092em 0 var(--forest), 0.071em -0.071em 0 var(--forest), 0.092em -0.038em 0 var(--forest), 0 .16em 0 rgba(0,0,0,.25); }
/* bouncy, hand-lettered feel like the campaign logo: each letter tilts a little */
.bouncy i { display: inline-block; font-style: normal; }
.bouncy i:nth-child(4n+1) { transform: rotate(-5deg) translateY(.02em); }
.bouncy i:nth-child(4n+2) { transform: rotate(4deg) translateY(-.05em); }
.bouncy i:nth-child(4n+3) { transform: rotate(-2deg) translateY(.04em); }
.bouncy i:nth-child(4n)   { transform: rotate(6deg) translateY(-.02em); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--display); font-size: 20px; letter-spacing: .5px; text-transform: uppercase;
  padding: 14px 26px; border-radius: 999px; background: var(--olive); color: var(--cream);
  box-shadow: 0 5px 0 var(--forest), 0 10px 20px rgba(38,48,11,.25);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--forest); }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { filter: grayscale(.7) opacity(.6); pointer-events: none; }
.btn.big { font-size: 30px; padding: 18px 46px; }
.btn.gold { background: var(--gold); color: var(--forest); box-shadow: 0 5px 0 var(--gold-dark), 0 10px 20px rgba(38,48,11,.25); }
.btn.cream { background: var(--cream); color: var(--olive); box-shadow: 0 5px 0 #cbc6a6, 0 10px 20px rgba(38,48,11,.18); }
.btn.ghost { background: transparent; color: var(--olive); box-shadow: none; text-decoration: underline; text-underline-offset: 4px; font-family: var(--body); font-weight: 600; text-transform: none; font-size: 16px; padding: 8px 12px; }
.btn.sm { font-size: 16px; padding: 10px 18px; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; font-size: 24px;
  background: var(--cream); box-shadow: 0 4px 0 #cbc6a6, 0 8px 16px rgba(38,48,11,.18); color: var(--olive);
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #cbc6a6; }
.icon-btn svg { width: 26px; height: 26px; }

/* ---------- Layout ---------- */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; animation: fadeIn .25s ease; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(.6) rotate(-6deg); opacity: 0; } 70% { transform: scale(1.06) rotate(-3deg); opacity: 1; } 100% { transform: scale(1) rotate(-3deg); } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.card {
  background: var(--cream); border-radius: 28px; box-shadow: var(--shadow); padding: 22px;
  border: 3px solid #fff; position: relative;
}
.sheet {
  margin-top: auto; width: 100%; max-width: 520px; align-self: center; flex: none;
  border-radius: 30px 30px 0 0; padding: 24px 22px calc(22px + var(--safe-bottom)); animation: slideUp .3s ease;
}
@media (min-width: 760px) and (min-height: 560px) { .sheet { margin: auto; border-radius: 30px; } .screen { padding: 24px 0; } }
.sheet h2 { font-family: var(--display); font-size: 34px; margin: 0 0 6px; color: var(--olive); font-weight: 400; }
.sheet p.lead { margin: 0 0 16px; font-size: 17px; color: #4b5320; }
.close-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; background: #e9e5cf; color: var(--olive); display: grid; place-items: center; }
.close-x svg { width: 20px; height: 20px; }
.backdrop-dim { background: rgba(38, 48, 11, .35); }

/* ---------- Loading ---------- */
#loading { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #fdf3d7, #f0dcae); transition: opacity .4s; }
#loading .inner { text-align: center; }
#loading img.campaign { width: 190px; animation: bob 1s ease-in-out infinite; }
#loading img.kws { width: 64px; display: block; margin: 14px auto 0; opacity: .85; }
#loading .bar { width: 200px; height: 12px; border-radius: 99px; background: #e2d6b3; margin: 18px auto 10px; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 10%; background: var(--olive); border-radius: inherit; transition: width .3s; }
#loading .tip { font-weight: 600; color: var(--olive); }

/* ---------- Title ---------- */
.title { align-items: center; justify-content: space-between; padding: calc(16px + var(--safe-top)) 16px calc(22px + var(--safe-bottom)); }
.topbar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kws-pill { background: var(--cream); border-radius: 18px; padding: 8px 14px; box-shadow: 0 4px 0 #cbc6a6; display: flex; align-items: center; }
.kws-pill img { height: 40px; display: block; }
.coin-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--cream); border-radius: 99px; padding: 6px 14px 6px 6px; font-family: var(--display); font-size: 22px; color: var(--forest); box-shadow: 0 4px 0 #cbc6a6; }
.coin { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2a8, var(--gold) 55%, var(--gold-dark)); border: 2px solid #e0a52b; display: inline-grid; place-items: center; flex: none; }
.coin::after { content: ''; width: 14px; height: 11px; background: url('../assets/kws-mark.svg') center/contain no-repeat; opacity: .7; }
.logo-block { position: relative; text-align: center; margin-top: 3vh; animation: popIn .6s ease both; transform: rotate(-6deg); }
.logo-block .campaign { position: absolute; right: -8%; bottom: -18%; width: clamp(110px, 31vw, 170px); transform: rotate(10deg); filter: drop-shadow(0 4px 0 rgba(38,48,11,.25)); pointer-events: none; }
.logo-block .game-title { font-size: clamp(64px, 17vw, 120px); display: block; }
.logo-block .game-title span { display: block; }
.logo-block .tag { display: inline-block; margin: 14px 28% 0 0; background: var(--sunset); color: #fff; font-family: var(--display); font-size: clamp(18px, 4.6vw, 26px); padding: 6px 16px; border-radius: 12px; transform: rotate(2deg); box-shadow: 0 4px 0 #a5331e; }
.title .bottom { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.title .row { display: flex; gap: 12px; }
.greet { background: rgba(244,243,230,.92); padding: 8px 16px; border-radius: 99px; font-weight: 600; color: var(--olive); box-shadow: 0 3px 0 #cbc6a6; }
.offline-badge { background: #fff3cd; color: #7a5a00; border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 13px; }

/* ---------- Creator ---------- */
.creator { justify-content: flex-start; }
.creator .sheet { margin-top: max(42vh, 260px); }
@media (min-width: 900px) { .creator { justify-content: center; align-items: flex-end; padding-right: 4vw; } .creator .sheet { max-height: 90vh; overflow: auto; width: 440px; margin: auto 0; border-radius: 30px; align-self: flex-end; } }
.field-label { font-family: var(--display); color: var(--olive); font-size: 18px; margin: 16px 0 8px; display: block; letter-spacing: .3px; }
.name-row { display: flex; gap: 10px; }
.name-input {
  flex: 1; min-width: 0; font-family: var(--display); font-size: 26px; color: var(--forest); padding: 10px 16px;
  border-radius: 18px; border: 3px solid #d9d3b5; background: #fff; outline: none;
}
.name-input:focus { border-color: var(--olive); }
.dice { width: 56px; height: 56px; border-radius: 18px; background: var(--gold); box-shadow: 0 4px 0 var(--gold-dark); color: var(--forest); display: grid; place-items: center; flex: none; }
.dice svg { width: 30px; height: 30px; }
.dice:active { transform: translateY(3px) rotate(20deg); box-shadow: 0 1px 0 var(--gold-dark); }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chips.two { grid-template-columns: 1fr 1fr; }
.chips.animals { grid-template-columns: repeat(3, 1fr); }
.chips.four { grid-template-columns: repeat(4, 1fr); }
.chips.four .chip { font-size: 13px; padding: 9px 4px; }
.chip { background: #fff; border: 3px solid #e2dcc0; border-radius: 16px; padding: 10px 6px; font-weight: 600; text-align: center; font-size: 15px; color: var(--olive); }
.chip small { display: block; font-weight: 500; font-size: 11px; color: #6b7140; margin-top: 2px; line-height: 1.2; }
.chip.on { border-color: var(--olive); background: #eef1d9; box-shadow: inset 0 0 0 2px var(--olive); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #d9d3b5; }
.swatch.on { box-shadow: 0 0 0 3px var(--olive); transform: scale(1.1); }
.err { color: #b3261e; font-weight: 600; min-height: 1.2em; margin: 8px 2px 0; font-size: 14px; }

/* ---------- Story ---------- */
.story { justify-content: flex-end; align-items: center; padding: 16px 16px calc(24px + var(--safe-bottom)); }
.story-card { max-width: 560px; width: 100%; animation: slideUp .35s ease; }
.story-card .who { font-family: var(--display); color: var(--sunset); font-size: 16px; letter-spacing: 1px; text-transform: uppercase; }
.story-card .text { font-family: var(--display); font-size: clamp(24px, 6vw, 32px); line-height: 1.12; color: var(--forest); margin: 6px 0 16px; }
.story-card .text em { font-style: normal; color: var(--olive); background: linear-gradient(transparent 60%, #f2d47a 60%); }
.story-card .foot { display: flex; align-items: center; justify-content: space-between; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #d9d3b5; }
.dots i.on { background: var(--olive); width: 26px; border-radius: 99px; }
.skip { position: absolute; top: calc(16px + var(--safe-top)); right: 16px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 4; padding: calc(12px + var(--safe-top)) 14px calc(14px + var(--safe-bottom)); }
#hud .row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dist { font-family: var(--display); font-size: 34px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 0 12px rgba(0,0,0,.15); line-height: 1; }
.dist small { font-size: 18px; }
.best { font-weight: 700; color: #fff; font-size: 13px; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.hud-right { display: flex; gap: 10px; align-items: center; pointer-events: auto; }
.hud-coins { font-size: 24px; }
.hud-coins.bump { animation: bump .18s ease; }
@keyframes bump { 50% { transform: scale(1.12); } }
.park-chip { position: absolute; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%); background: rgba(38,48,11,.55); color: var(--cream); padding: 5px 14px 5px 10px; border-radius: 99px; font-weight: 600; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.park-chip svg { width: 16px; height: 16px; color: var(--gold); }
.perk-bar { position: absolute; left: 14px; bottom: calc(18px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 8px; width: min(240px, 62vw); }
.perk-card { display: flex; align-items: center; gap: 10px; background: rgba(244,243,230,.94); border-radius: 18px; padding: 7px 12px 7px 7px; box-shadow: 0 4px 0 rgba(38,48,11,.18), 0 8px 18px rgba(0,0,0,.15); animation: slideUp .25s ease; }
.perk-card.ending { animation: blink .35s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
.perk-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; }
.perk-ico svg { width: 26px; height: 26px; }
.perk-info { flex: 1; min-width: 0; }
.perk-name { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 13px; color: var(--forest); }
.perk-name b { font-family: var(--display); font-weight: 400; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perk-name .secs { font-weight: 700; font-variant-numeric: tabular-nums; }
.perk-track { height: 10px; margin-top: 4px; border-radius: 99px; background: rgba(38,48,11,.15); overflow: hidden; }
.perk-track i { display: block; height: 100%; width: 100%; background: var(--c); border-radius: inherit; transition: width .1s linear; }
.banner { position: absolute; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; }
.banner .big { font-size: clamp(40px, 11vw, 74px); display: inline-block; animation: popIn .5s ease both; }
.banner .small { display: block; margin-top: 12px; font-weight: 700; color: #fff; font-size: 18px; text-shadow: 0 2px 0 rgba(0,0,0,.35); animation: fadeIn .6s .2s both; }
.banner.out { transition: opacity .5s, transform .5s; opacity: 0; transform: translateY(-20px); }
.float-coin { position: absolute; font-family: var(--display); color: var(--gold); font-size: 22px; text-shadow: 0 2px 0 var(--forest); animation: floatUp .7s ease forwards; }
@keyframes floatUp { to { transform: translateY(-40px); opacity: 0; } }

/* Tutorial hint */
.hint { position: absolute; left: 50%; bottom: 20%; transform: translateX(-50%); width: min(92vw, 520px); text-align: center; pointer-events: none; }
.hint .bubble { display: inline-block; background: var(--cream); color: var(--forest); font-family: var(--display); font-size: clamp(20px, 5.4vw, 28px); padding: 14px 22px; border-radius: 22px; box-shadow: var(--shadow); animation: slideUp .25s ease; line-height: 1.1; }
.hint .bubble.good { background: var(--olive); color: var(--cream); }
.gesture { height: 110px; position: relative; margin-bottom: 10px; }
.gesture .hand { position: absolute; left: 50%; top: 34px; width: 48px; height: 48px; color: #fff; transform: translateX(-50%); filter: drop-shadow(0 3px 0 rgba(0,0,0,.3)); }
.gesture .hand svg { width: 100%; height: 100%; }
.gesture .trail { position: absolute; left: 50%; top: 56px; width: 140px; height: 10px; margin-left: -70px; border-radius: 99px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent); }
.gesture.swipe-lr .hand { animation: swipeLR 1.1s ease-in-out infinite; }
.gesture.swipe-up .hand { animation: swipeUp 1s ease-in-out infinite; }
.gesture.swipe-up .trail, .gesture.swipe-down .trail { width: 10px; height: 100px; top: 6px; margin-left: -5px; background: linear-gradient(180deg, transparent, rgba(255,255,255,.95), transparent); }
.gesture.swipe-down .hand { animation: swipeDown 1s ease-in-out infinite; }
@keyframes swipeLR { 0%,100% { transform: translateX(-110%); } 50% { transform: translateX(10%); } }
@keyframes swipeUp { 0% { transform: translate(-50%, 30px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -40px); opacity: 0; } }
@keyframes swipeDown { 0% { transform: translate(-50%, -40px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, 30px); opacity: 0; } }
.keys { display: inline-flex; gap: 6px; margin-bottom: 10px; }
.key { min-width: 46px; height: 46px; padding: 0 10px; border-radius: 10px; background: #fff; border: 2px solid #cfc9ac; box-shadow: 0 4px 0 #cfc9ac; display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: var(--forest); animation: keypress 1s infinite; }
@keyframes keypress { 0%, 60%, 100% { transform: none; box-shadow: 0 4px 0 #cfc9ac; } 70% { transform: translateY(3px); box-shadow: 0 1px 0 #cfc9ac; } }

/* ---------- Results ---------- */
.results-head { text-align: center; margin: -4px 0 10px; }
.results-head .sticker { font-size: 44px; display: inline-block; transform: rotate(-4deg); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.stat { background: #fff; border-radius: 18px; padding: 12px; text-align: center; border: 2px solid #ebe6cc; }
.stat b { display: block; font-family: var(--display); font-size: 32px; color: var(--forest); font-weight: 400; }
.stat span { font-size: 13px; font-weight: 600; color: #6b7140; text-transform: uppercase; letter-spacing: .5px; }
.stat.gold { background: #fff5d8; border-color: #f2d47a; }
.newbest { display: inline-block; background: var(--sunset); color: #fff; font-family: var(--display); padding: 3px 10px; border-radius: 8px; font-size: 14px; margin-left: 6px; transform: rotate(-4deg); vertical-align: middle; }
.save-card { background: linear-gradient(135deg, var(--olive), #6b7f22); color: var(--cream); border-radius: 22px; padding: 16px; margin: 12px 0; display: flex; gap: 12px; align-items: center; }
.save-card b { font-family: var(--display); font-size: 21px; font-weight: 400; display: block; }
.save-card p { margin: 2px 0 0; font-size: 14px; opacity: .9; }
.save-card .btn { flex: none; }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.note { font-size: 13px; color: #6b7140; text-align: center; margin: 8px 0 0; }

/* Tips & park facts (results) */
.tip-card { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 2px solid #ebe6cc; border-radius: 20px; padding: 14px; margin: 12px 0 4px; cursor: pointer; text-align: left; }
.tip-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff1c9; color: var(--gold-dark); }
.tip-ico svg { width: 24px; height: 24px; }
.tip-card.fact .tip-ico { background: #e3ebc7; color: var(--olive); }
.tip-body { flex: 1; min-width: 0; }
.tip-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--sunset); }
.tip-card.fact .tip-label { color: var(--olive); }
.tip-text { margin: 4px 0 8px; font-size: 15.5px; line-height: 1.35; color: var(--forest); font-weight: 500; min-height: 2.7em; animation: fadeIn .4s ease; }
.tip-dots { display: flex; gap: 4px; }
.tip-dots i { width: 6px; height: 6px; border-radius: 50%; background: #e2dcc0; }
.tip-dots i.on { background: var(--olive); width: 16px; border-radius: 99px; }

/* ---------- Forms ---------- */
.input { width: 100%; padding: 13px 16px; border-radius: 16px; border: 3px solid #d9d3b5; background: #fff; font-size: 18px; color: var(--forest); outline: none; font-weight: 500; }
.input:focus { border-color: var(--olive); }
.seg { display: flex; background: #e9e5cf; border-radius: 99px; padding: 4px; margin-bottom: 4px; }
.seg button { flex: 1; padding: 9px; border-radius: 99px; font-weight: 600; color: var(--olive); }
.seg button.on { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.phone { display: flex; gap: 8px; }
.phone .cc { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 16px; background: #e9e5cf; font-weight: 700; color: var(--olive); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #4b5320; margin: 14px 0 4px; }
.check input { width: 22px; height: 22px; accent-color: var(--olive); flex: none; margin: 0; }
.otp { display: flex; gap: 8px; justify-content: center; margin: 16px 0 6px; }
.otp input { width: 46px; height: 58px; text-align: center; font-family: var(--display); font-size: 28px; border-radius: 14px; border: 3px solid #d9d3b5; color: var(--forest); outline: none; }
.otp input:focus { border-color: var(--olive); }
.dev-code { background: #fff3cd; color: #6b4d00; border-radius: 12px; padding: 8px 12px; font-size: 14px; text-align: center; }

/* ---------- Wallet ---------- */
.balance { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 16px; }
.balance .coin { width: 48px; height: 48px; }
.balance .coin::after { width: 24px; height: 18px; }
.balance b { font-family: var(--display); font-size: 52px; color: var(--forest); font-weight: 400; }
.tier { background: #fff; border-radius: 20px; padding: 14px; margin-bottom: 10px; border: 2px solid #ebe6cc; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.tier h3 { margin: 0; font-family: var(--display); font-weight: 400; color: var(--olive); font-size: 20px; }
.tier p { margin: 0; font-size: 13px; color: #6b7140; }
.tier .cost { font-family: var(--display); color: var(--gold-dark); font-size: 18px; display: flex; align-items: center; gap: 6px; }
.tier .cost .coin { width: 20px; height: 20px; }
.tier .cost .coin::after { width: 10px; height: 8px; }
.progress { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: #eee9d2; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #f6cf6a); border-radius: inherit; }
.code-card { background: #fff; border-radius: 22px; padding: 16px; margin-bottom: 12px; border: 3px dashed var(--olive); text-align: center; }
.code-card .qr { width: 170px; height: 170px; margin: 6px auto; }
.code-card .qr svg { width: 100%; height: 100%; }
.code-card .code { font-family: var(--display); font-size: 28px; letter-spacing: 2px; color: var(--forest); }
.code-card.used { border-style: solid; border-color: #d9d3b5; opacity: .7; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #e9e5cf; color: var(--olive); text-transform: uppercase; letter-spacing: .5px; }
.pill.ok { background: #dbe8b5; } .pill.warn { background: #fde2c8; color: #8a3b0e; }
.section-title { font-family: var(--display); color: var(--olive); font-size: 22px; margin: 18px 0 10px; font-weight: 400; }

/* Leaderboard */
.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; font-weight: 600; }
.lb li:nth-child(odd) { background: #fff; }
.lb .rank { width: 30px; font-family: var(--display); color: var(--olive); font-size: 20px; }
.lb .nm { flex: 1; } .lb .m { font-family: var(--display); color: var(--forest); }
.lb li.me { outline: 3px solid var(--gold); }
.lb .nm small { display: block; font-weight: 500; font-size: 12px; color: #6b7140; }
.lb li.top1 .rank { color: #c98a17; } .lb li.top2 .rank { color: #8a8f99; } .lb li.top3 .rank { color: #a0643a; }
.lb-sheet .lb { max-height: 46vh; overflow-y: auto; margin-top: 8px; }
.lb-me { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 8px; border-radius: 14px; background: #fff7df; outline: 3px solid var(--gold); font-weight: 600; }
.lb-me b { font-family: var(--display); font-weight: 400; color: var(--olive); font-size: 20px; } .lb-me span:last-child { margin-left: auto; }
.rank-banner { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 2px; padding: 10px 14px; border-radius: 16px; background: #fff7df; border: 2px solid var(--gold); color: var(--forest); font-weight: 600; text-align: left; }
.rank-banner svg { width: 26px; height: 26px; color: #c98a17; flex: none; }
.rank-banner b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--olive); margin-right: 2px; }
.rank-banner small { color: #6b7140; font-weight: 500; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* Pause */
.pause-wrap { align-items: center; justify-content: center; background: rgba(38,48,11,.45); backdrop-filter: blur(3px); }
.pause-wrap .card { width: min(90vw, 360px); text-align: center; display: flex; flex-direction: column; gap: 12px; }

/* Toast */
#toast { pointer-events: none; position: fixed; left: 50%; top: calc(16px + var(--safe-top)); transform: translateX(-50%) translateY(calc(-100% - 40px)); z-index: 30; visibility: hidden; background: var(--forest); color: var(--cream); padding: 12px 18px; border-radius: 16px; font-weight: 600; transition: transform .3s; max-width: 92vw; text-align: center; box-shadow: var(--shadow); }
#toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }

.rotate-hint { position: absolute; bottom: 8px; width: 100%; text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* Flat Kenya flag (CSS only, no emoji) */
.flag-ke { width: 24px; height: 16px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  background: linear-gradient(#111 0 30%, #fff 30% 35%, #bb1f2a 35% 65%, #fff 65% 70%, #1f7a3a 70%); }
