/* Namma Meter: hand-painted auto / truck art style */
@font-face { font-family: 'Bungee'; src: url('fonts/bungee-latin-400-normal.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Bungee Shade'; src: url('fonts/bungee-shade-latin-400-normal.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Bungee Inline'; src: url('fonts/bungee-inline-latin-400-normal.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Baloo'; font-weight: 400; src: url('fonts/baloo-2-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Baloo'; font-weight: 700; src: url('fonts/baloo-2-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Baloo'; font-weight: 800; src: url('fonts/baloo-2-latin-800-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Baloo Kn'; font-weight: 700; src: url('fonts/baloo-tamma-2-kannada-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Baloo Kn'; font-weight: 800; src: url('fonts/baloo-tamma-2-kannada-800-normal.woff2') format('woff2'); font-display: swap; }

:root {
  color-scheme: only light; /* stop browsers that force a dark theme from repainting the game */
  --yellow: #FFC914; --green: #0B7A3B; --leaf: #35A04A; --pink: #E8308C; --red: #E23D28;
  --blue: #0E5FA8; --teal: #12A4A0; --cream: #FFF3D6; --ink: #1B1320; --orange: #FF8A00;
  --display: 'Bungee', 'Arial Black', Impact, sans-serif;
  --body: 'Baloo', 'Baloo Kn', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--body); color: var(--ink); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  background:
    repeating-linear-gradient(45deg, rgba(255,201,20,.06) 0 14px, transparent 14px 28px),
    repeating-linear-gradient(-45deg, rgba(232,48,140,.06) 0 14px, transparent 14px 28px), var(--ink);
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
#app { position: relative; width: 100%; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--ink); }
@media (min-width: 520px) { #app { box-shadow: 0 0 0 6px var(--yellow), 0 0 0 12px var(--pink), 0 0 60px #000; } }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.screen.on { display: flex; }

.ic { display: inline-flex; width: 1.2em; height: 1.2em; vertical-align: -0.22em; }
.ic svg { width: 100%; height: 100%; display: block; }

/* ---------- shared painted pieces ---------- */
.sunburst { /* drawn small, then scaled and spun on the GPU: light on memory, no dark corners */
  position: absolute; z-index: 0; left: 50%; top: 46%; width: 110vh; height: 110vh; margin: -55vh 0 0 -55vh;
  background: repeating-conic-gradient(from 0deg at 50% 50%, var(--orange) 0 10deg, var(--yellow) 10deg 20deg);
  animation: spin 90s linear infinite; will-change: transform;
}
@supports (height: 100dvh) { .sunburst { width: 110dvh; height: 110dvh; margin: -55dvh 0 0 -55dvh; } }
@keyframes spin { from { transform: scale(1.8) rotate(0deg); } to { transform: scale(1.8) rotate(360deg); } }
.bunting { position: absolute; left: 0; right: 0; height: 26px; z-index: 2; background-color: var(--ink);
  background-image: linear-gradient(135deg, var(--pink) 25%, transparent 25%), linear-gradient(225deg, var(--pink) 25%, transparent 25%),
    linear-gradient(135deg, var(--teal) 25%, transparent 25%), linear-gradient(225deg, var(--teal) 25%, transparent 25%);
  background-size: 44px 44px; background-position: 0 0, 0 0, 22px 0, 22px 0; }
.bunting.top { top: 0; height: calc(26px + var(--safe-t)); background-position: 0 var(--safe-t), 0 var(--safe-t), 22px var(--safe-t), 22px var(--safe-t); }
.bunting.bottom { bottom: 0; transform: scaleY(-1); }

.board-btn {
  position: relative; font-family: var(--display); font-size: 19px; letter-spacing: .5px; color: var(--ink);
  background: var(--yellow); padding: 15px 22px 13px; border-radius: 14px; border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--red), 0 6px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.board-btn:active { transform: translateY(4px); box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--red), 0 2px 0 var(--ink); }
.board-btn.go { background: var(--pink); color: #fff; text-shadow: 2px 2px 0 var(--ink);
  box-shadow: inset 0 0 0 3px var(--yellow), inset 0 0 0 6px var(--ink), 0 6px 0 var(--ink); }
.board-btn.go:active { box-shadow: inset 0 0 0 3px var(--yellow), inset 0 0 0 6px var(--ink), 0 2px 0 var(--ink); }

/* ---------- title ---------- */
.title-wrap { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(34px + var(--safe-t)) 18px calc(34px + var(--safe-b)); gap: 6px; }
.kn-title { font-family: 'Baloo Kn', var(--body); font-weight: 800; font-size: 30px; color: var(--ink); background: var(--cream);
  padding: 2px 18px 0; border: 3px solid var(--ink); border-radius: 30px; box-shadow: 0 4px 0 var(--ink); transform: rotate(-2deg); }
.big-title { margin: 8px 0 0; display: flex; flex-direction: column; align-items: center; line-height: .95; font-weight: 400;
  font-family: var(--display); font-size: clamp(52px, 16.5vw, 78px); color: var(--yellow); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 var(--pink), 8px 8px 0 var(--ink), 9px 9px 0 var(--ink); transform: rotate(-3deg); }
.big-title span:first-child { color: #fff; }
.big-title span:last-child { color: var(--yellow); transform: translateX(10px); }
.ribbon { margin-top: 10px; font-family: var(--display); font-size: 12.5px; letter-spacing: .6px; color: var(--yellow); background: var(--ink);
  padding: 8px 16px 6px; border-radius: 4px; transform: rotate(-2deg); box-shadow: 0 0 0 3px var(--pink); white-space: nowrap; }
#title-auto { width: min(74vw, 300px); width: min(74vw, 300px, 36dvh); margin: 4px 0 2px; animation: putter .22s steps(2) infinite; }
#title-auto svg, #end-auto svg { width: 100%; height: auto; display: block; }
@keyframes putter { 50% { transform: translateY(-1.5px) rotate(.25deg); } }
.how { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; }
.how span { font-weight: 700; font-size: 13px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 20px; padding: 3px 10px 1px; white-space: nowrap; }

/* ---------- status bar ---------- */
.status { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: none; align-items: center; justify-content: space-between;
  padding: calc(8px + var(--safe-t)) 58px 12px 12px; background: var(--ink); color: var(--yellow);
  font-family: var(--display); font-size: 17px; }
.status.on { display: flex; }
.status::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(135deg, var(--ink) 50%, transparent 50%) 0 0/14px 10px, linear-gradient(225deg, var(--ink) 50%, transparent 50%) 0 0/14px 10px; }
.st { display: flex; align-items: center; gap: 5px; }
.st small { font-family: var(--body); font-weight: 700; font-size: 12px; color: var(--cream); opacity: .75; }
.st.hearts { gap: 2px; }
.st.hearts .ic { width: 19px; height: 19px; }
.st.hearts .off { opacity: .28; filter: grayscale(1); }
.st b.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.45); color: #fff; } }
.sound { position: absolute; z-index: 9; top: calc(6px + var(--safe-t)); right: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--yellow); border: 3px solid var(--ink); display: grid; place-items: center; font-size: 19px; box-shadow: 0 3px 0 rgba(0,0,0,.5); }
.sound.off { background: #9a8f86; }

/* ---------- story scene ---------- */
.scene-bg { position: absolute; inset: 0; background: var(--scene, var(--teal));
  background-image: radial-gradient(circle at 50% 34%, rgba(255,255,255,.22), transparent 55%),
    repeating-linear-gradient(0deg, rgba(27,19,32,.07) 0 2px, transparent 2px 22px), repeating-linear-gradient(90deg, rgba(27,19,32,.07) 0 2px, transparent 2px 22px); }
#s-scene, #s-result { padding: calc(64px + var(--safe-t)) 14px calc(14px + var(--safe-b)); gap: 10px; }
.place { position: relative; z-index: 1; align-self: center; text-align: center; transform: rotate(-1.5deg); }
.place-time { display: inline-block; font-family: var(--display); font-size: 12px; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink);
  border-radius: 14px; padding: 3px 12px 1px; margin-bottom: -6px; position: relative; z-index: 1; }
.place-name { font-family: var(--display); font-size: clamp(21px, 6.4vw, 28px); line-height: 1.05; color: var(--cream); background: var(--red); padding: 12px 20px 8px;
  border: 4px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 3px var(--yellow), 0 5px 0 var(--ink); text-shadow: 2px 2px 0 var(--ink); }
.art { position: relative; z-index: 1; flex: 1 1 0; min-height: 0; display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.art .frame { height: 100%; max-height: 340px; max-width: 48%; aspect-ratio: 200 / 240; position: relative; animation: pop .45s cubic-bezier(.2,1.5,.4,1) both; }
.art .frame:only-child { max-width: 100%; }
.art .frame:not(:only-child) { height: calc(min(100%, 300px) - 14px); width: 46%; max-width: 46%; margin-bottom: 14px; aspect-ratio: auto; }
.art .frame:nth-child(2) { animation-delay: .12s; }
.art .frame svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 0 rgba(27,19,32,.85)); }
.art .frame.dim { filter: saturate(.3) brightness(.75); transform: scale(.94); transition: .25s; }
.art .frame .tag { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%) rotate(-2deg); white-space: nowrap; font-family: var(--display); font-size: 11px;
  background: var(--ink); color: var(--yellow); padding: 4px 10px 2px; border-radius: 4px; }
.art .wide { height: min(100%, 240px); width: 100%; display: flex; justify-content: center; align-self: center; animation: pop .45s cubic-bezier(.2,1.5,.4,1) both; }
.art .wide svg { height: 100%; width: auto; max-width: 80%; display: block; }
@keyframes pop { from { transform: scale(.7) translateY(30px); opacity: 0; } }

.talk { position: relative; z-index: 1; background: var(--cream); border: 4px solid var(--ink); border-radius: 16px; padding: 20px 16px 14px; min-height: 118px;
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 5.5px var(--teal), 0 6px 0 var(--ink); cursor: pointer; }
.talk p { margin: 0; font-size: 18.5px; line-height: 1.32; font-weight: 700; }
.talk.narr p { font-weight: 400; font-style: italic; }
.who { position: absolute; top: -15px; left: 14px; font-family: var(--display); font-size: 13px; color: var(--yellow); background: var(--green);
  border: 3px solid var(--ink); border-radius: 6px; padding: 4px 10px 2px; transform: rotate(-2deg); }
.who:empty { display: none; }
.more { position: absolute; right: 12px; bottom: 6px; width: 0; height: 0; border: 8px solid transparent; border-top: 11px solid var(--pink); border-bottom: 0; animation: bob .7s ease-in-out infinite alternate; }
.more.hide { display: none; }
@keyframes bob { to { transform: translateY(5px); } }
.choices { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.choice { text-align: left; background: var(--yellow); border: 4px solid var(--ink); border-radius: 12px; padding: 10px 14px 8px; box-shadow: 0 5px 0 var(--ink);
  animation: slide .3s both; transition: transform .08s, box-shadow .08s; }
.choice:nth-child(2) { animation-delay: .07s; background: #fff; }
.choice:nth-child(3) { animation-delay: .14s; background: #9fe3d6; }
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.choice b { display: block; font-family: var(--display); font-weight: 400; font-size: 14.5px; line-height: 1.2; }
.choice small { display: block; font-size: 13.5px; font-weight: 700; color: #6a2a55; line-height: 1.2; margin-top: 2px; }
.choice[disabled] { opacity: .45; }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }

/* ---------- drive ---------- */
#s-drive { background: #3b3340; }
#road { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.dhud { position: absolute; z-index: 3; top: 0; left: 0; right: 0; padding: calc(8px + var(--safe-t)) 56px 8px 10px; background: var(--ink); }
.dhud::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(135deg, var(--ink) 50%, transparent 50%) 0 0/14px 10px, linear-gradient(225deg, var(--ink) 50%, transparent 50%) 0 0/14px 10px; }
.dhud-row { display: flex; align-items: center; gap: 10px; }
.mood { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.mood-face { width: 44px; height: 44px; flex: none; border-radius: 50%; overflow: hidden; border: 3px solid var(--yellow); background: var(--teal); }
.mood-face svg { width: 100%; height: 125%; display: block; margin-top: -4px; }
.mood-face.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translate(-4px, 2px) rotate(-8deg); } 50% { transform: translate(4px, -2px) rotate(8deg); } 80% { transform: translate(-2px, 1px); } }
.mood-col { flex: 1; min-width: 0; }
.mood-label { font-family: var(--display); font-size: 11px; color: var(--cream); letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mood-bar { height: 14px; border-radius: 8px; background: #40304a; border: 2.5px solid var(--cream); overflow: hidden; }
#mood-fill { height: 100%; width: 100%; background: var(--leaf); border-radius: 0 6px 6px 0; transition: width .2s, background .3s; }
.meter { flex: none; background: #120a0a; border: 3px solid var(--yellow); border-radius: 8px; padding: 3px 10px 1px; text-align: right; min-width: 92px; }
.meter small { display: block; font-family: var(--display); font-size: 9px; color: var(--yellow); letter-spacing: 1px; }
.meter b { font-family: 'Bungee Inline', var(--display); font-weight: 400; font-size: 22px; line-height: 1.05; color: #ff4a3a; text-shadow: 0 0 10px rgba(255,60,40,.8); }
.route { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-family: var(--display); font-size: 9.5px; color: var(--cream); letter-spacing: .3px; }
.route span { max-width: 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-track { flex: 1; height: 6px; background: #40304a; border-radius: 4px; position: relative; }
.route-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--yellow); border-radius: 4px; }
.route-auto { position: absolute; top: 50%; left: 0; width: 20px; height: 20px; transform: translate(-50%, -50%); }
.route-auto svg { width: 100%; height: 100%; display: block; }

.banter { position: absolute; z-index: 3; left: 10px; right: 10px; top: calc(112px + var(--safe-t)); display: flex; align-items: center; gap: 8px;
  background: var(--cream); border: 3.5px solid var(--ink); border-radius: 14px; padding: 7px 12px 5px 7px; box-shadow: 0 4px 0 var(--ink);
  transform: translateY(-16px) scale(.9); opacity: 0; transition: transform .25s cubic-bezier(.2,1.5,.4,1), opacity .2s; pointer-events: none; }
.banter.on { transform: none; opacity: 1; }
.banter-face { width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden; border: 2.5px solid var(--ink); background: var(--teal); }
.banter-face svg { width: 100%; height: 125%; display: block; margin-top: -3px; }
.banter p { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.2; }
.postcard { position: absolute; z-index: 3; left: 0; top: calc(172px + var(--safe-t)); display: flex; align-items: center; gap: 8px; background: var(--yellow);
  border: 3.5px solid var(--ink); border-left: 0; border-radius: 0 12px 12px 0; padding: 6px 14px 4px 8px; box-shadow: 0 4px 0 var(--ink);
  transform: translateX(-110%); transition: transform .4s cubic-bezier(.2,1.3,.4,1); pointer-events: none; }
.postcard.on { transform: none; }
#postcard-art { width: 62px; height: 46px; background: #bfe9f5; border: 2.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
#postcard-art svg { width: 100%; height: 100%; display: block; }
.postcard small { display: block; font-family: var(--display); font-size: 8.5px; color: var(--red); letter-spacing: .8px; }
.postcard b { font-family: var(--display); font-weight: 400; font-size: 14px; line-height: 1.1; }

.ready { position: absolute; inset: 0; z-index: 4; display: none; align-items: center; justify-content: center; background: rgba(27,19,32,.45); }
.ready.on { display: flex; }
.ready-card { width: 82%; text-align: center; background: var(--cream); border: 4px solid var(--ink); border-radius: 18px; padding: 18px 16px 14px;
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--pink), 0 8px 0 var(--ink); animation: pop .4s cubic-bezier(.2,1.5,.4,1) both; }
.ready-card small { font-family: var(--display); font-size: 11px; color: var(--green); }
.ready-to { font-family: var(--display); font-size: 25px; line-height: 1.05; color: var(--red); text-shadow: 2px 2px 0 var(--yellow); margin: 2px 0 8px; }
.ready-card p { margin: 0 0 6px; font-weight: 700; font-size: 15px; line-height: 1.25; }
.ready-go { font-family: 'Bungee Shade', var(--display); font-size: 58px; line-height: 1; color: var(--pink); }

.pad { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; align-items: stretch; gap: 10px; padding: 10px 12px calc(14px + var(--safe-b)); }
.pad-btn { flex: 1; height: 86px; border-radius: 18px; background: var(--yellow); border: 4px solid var(--ink); font-size: 42px; display: grid; place-items: center;
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--green), 0 6px 0 var(--ink); opacity: .96; }
.pad-btn.horn { flex: .8; background: var(--pink); color: #fff; font-size: 30px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0;
  box-shadow: inset 0 0 0 3px var(--yellow), inset 0 0 0 6px var(--ink), 0 6px 0 var(--ink); }
.pad-btn.horn span { font-family: var(--display); font-size: 12px; text-shadow: 1.5px 1.5px 0 var(--ink); }
.pad-btn.down, .pad-btn:active { transform: translateY(4px); box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--green), 0 2px 0 var(--ink); }
.pad-btn.horn.cool { filter: saturate(.35) brightness(.8); }

/* ---------- trip slip ---------- */
#s-result { justify-content: center; gap: 22px; }
.slip { position: relative; z-index: 1; background: var(--cream); border: 4px solid var(--ink); border-radius: 14px; padding: 16px 18px 16px;
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--yellow), 0 7px 0 var(--ink); animation: pop .45s cubic-bezier(.2,1.4,.4,1) both; }
.slip-head { text-align: center; padding-top: 14px; border-bottom: 3px dashed var(--ink); padding-bottom: 10px; }
.slip-head small { font-family: var(--display); font-size: 11px; color: var(--green); letter-spacing: 1px; }
#slip-route { font-family: var(--display); font-size: 18px; line-height: 1.15; color: var(--ink); }
.stamp { position: absolute; top: -20px; right: -8px; z-index: 2; font-family: var(--display); font-size: 15px; color: var(--red); border: 4px solid var(--red); border-radius: 8px;
  padding: 5px 10px 2px; transform: rotate(9deg); background: rgba(255,243,214,.92); animation: stamp .35s .45s cubic-bezier(.3,1.6,.5,1) both; }
.stamp.good { color: var(--green); border-color: var(--green); }
@keyframes stamp { from { transform: rotate(9deg) scale(2.6); opacity: 0; } }
.slip-rows { padding: 12px 0 4px; margin-top: 16px; }
.slip-rows div { display: flex; justify-content: space-between; font-weight: 700; font-size: 17px; padding: 2px 0; }
.slip-rows div b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.slip-rows div.neg b { color: var(--red); }
.slip-total { display: flex; justify-content: space-between; align-items: center; border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); padding: 8px 0 4px;
  font-family: var(--display); font-size: 16px; }
.slip-total b { font-size: 30px; font-weight: 400; color: var(--green); }
.slip-note { margin: 12px 0 0; font-size: 17px; line-height: 1.32; font-style: italic; }
.slip-gw { margin-top: 10px; font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.slip-gw.up { color: var(--green); } .slip-gw.down { color: var(--red); }
.slip-gw:empty { display: none; }
.slip-face { position: absolute; top: -40px; left: 14px; width: 68px; height: 68px; border-radius: 50%; overflow: hidden; border: 4px solid var(--ink); background: var(--teal); box-shadow: 0 4px 0 var(--ink); }
.slip-face svg { width: 100%; height: 125%; display: block; margin-top: -5px; }
#s-result .board-btn, #s-end .board-btn { position: relative; z-index: 1; align-self: center; }

/* ---------- ending ---------- */
.end-wrap { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: calc(40px + var(--safe-t)) 16px calc(36px + var(--safe-b)); }
.end-kicker { font-family: var(--display); font-size: 12px; background: var(--ink); color: var(--yellow); padding: 6px 12px 4px; border-radius: 4px; transform: rotate(-2deg); }
.big-title.end { font-size: clamp(38px, 12.5vw, 60px); color: #fff; text-align: center; transform: rotate(-2deg); display: block; }
.end-gloss { font-weight: 800; font-size: 14px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 20px; padding: 2px 12px 0; }
.end-gloss:empty { display: none; }
#end-auto { width: min(46vw, 180px); width: min(46vw, 180px, 22dvh); }
.end-card { background: var(--cream); border: 4px solid var(--ink); border-radius: 14px; padding: 14px 16px 12px; margin-bottom: 12px;
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--teal), 0 6px 0 var(--ink); }
.end-card p { margin: 0 0 10px; font-size: 16.5px; line-height: 1.34; }
.end-stats { display: flex; justify-content: space-between; gap: 8px; border-top: 3px dashed var(--ink); padding-top: 8px; text-align: center; }
.end-stats small { display: block; font-family: var(--display); font-size: 9.5px; color: var(--green); letter-spacing: .6px; }
.end-stats b { font-family: var(--display); font-weight: 400; font-size: 19px; }

/* ---------- shutter transition ---------- */
.shutter { position: absolute; inset: 0; z-index: 8; transform: translateY(-103%); pointer-events: none; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(180deg, #1f8a70 0 14px, #19715c 14px 17px, #2aa587 17px 20px); border-bottom: 14px solid var(--ink);
  transition: transform .42s cubic-bezier(.6,0,.3,1); }
.shutter.down { transform: none; pointer-events: auto; }
.shutter-sign { font-family: var(--display); font-size: 22px; color: var(--yellow); text-align: center; line-height: 1.1; padding: 14px 22px 10px; background: var(--red);
  border: 4px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 3px var(--yellow), 0 6px 0 var(--ink); text-shadow: 2px 2px 0 var(--ink); transform: rotate(-3deg); max-width: 84%; }
.shutter-sign:empty { display: none; }
.shutter-sign small { display: block; font-size: 12px; color: var(--cream); }

@media (max-height: 700px) {
  .talk p { font-size: 16.5px; } .talk { min-height: 100px; padding-top: 17px; }
  .choice b { font-size: 13.5px; } .how { display: none; }
  .pad-btn { height: 70px; }
}

/* rain on story screens */
.rainy .scene-bg::after { content: ''; position: absolute; inset: -40px; pointer-events: none;
  background: repeating-linear-gradient(100deg, transparent 0 22px, rgba(220,235,255,.35) 22px 23.5px, transparent 23.5px 47px); background-size: 100% 80px; animation: rain .35s linear infinite; }
@keyframes rain { to { transform: translate(-14px, 80px); } }

/* ---------- title extras ---------- */
.title-row { display: flex; gap: 10px; margin-top: 16px; }
.mini-btn { font-family: var(--display); font-size: 12.5px; color: var(--ink); background: var(--cream); border: 3px solid var(--ink); border-radius: 10px; padding: 9px 14px 7px; box-shadow: 0 4px 0 var(--ink); }
.mini-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.how { margin-top: 12px; }

/* ---------- overlays: pause, settings, checkpoints, police ---------- */
.overlay { position: absolute; inset: 0; z-index: 7; display: none; align-items: center; justify-content: center; background: rgba(27,19,32,.72); padding: calc(56px + var(--safe-t)) 14px calc(14px + var(--safe-b)); }
.overlay.on { display: flex; }
.sheet { width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 12px; background: var(--cream); border: 4px solid var(--ink); border-radius: 18px; padding: 20px 18px 18px;
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--pink), 0 8px 0 var(--ink); animation: pop .3s cubic-bezier(.2,1.4,.4,1) both; }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--red); text-shadow: 2px 2px 0 var(--yellow); text-align: center; }
.sheet .sub { margin: -8px 0 4px; text-align: center; font-weight: 700; font-size: 15px; }
.sheet .board-btn { font-size: 16px; padding: 12px 18px 10px; }
.board-btn.plain { background: var(--cream); box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px #b9b0a6, 0 6px 0 var(--ink); }
.sheet.tall { height: 100%; padding: 14px 10px 10px; gap: 8px; box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--teal), 0 8px 0 var(--ink); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; border-bottom: 3px dashed var(--ink); }
.sheet-head h2 { text-align: left; font-size: 22px; flex: 1; }
.sheet-head .count { font-family: var(--display); font-size: 13px; background: var(--ink); color: var(--yellow); padding: 4px 9px 2px; border-radius: 12px; }
.x { width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); display: grid; place-items: center; box-shadow: 0 3px 0 var(--ink); flex: none; }
.x svg { width: 18px; height: 18px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 12px; }
.set-row b { display: block; font-family: var(--display); font-weight: 400; font-size: 14px; }
.set-row small { display: block; font-size: 13.5px; font-weight: 700; color: #6a2a55; line-height: 1.2; margin: 1px 0 5px; }
.seg { display: flex; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { flex: 1; font-family: var(--display); font-size: 12px; padding: 9px 2px 7px; border-right: 3px solid var(--ink); color: var(--ink); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--green); color: var(--yellow); }
.set-note { font-size: 12.5px; font-weight: 700; color: var(--red); margin-top: 3px; display: none; }
.set-note.on { display: block; }
.set-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px; padding: 10px 12px 8px; box-shadow: 0 4px 0 var(--ink); }
.set-link b { font-family: var(--display); font-weight: 400; font-size: 14px; display: block; }
.set-link small { font-weight: 700; font-size: 13px; }
.set-link .ic { font-size: 22px; flex: none; }
.set-reset { align-self: center; font-weight: 800; font-size: 13px; text-decoration: underline; color: #6a2a55; padding: 6px; }
.cp { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 8px; box-shadow: 0 3px 0 var(--ink); }
.cp-art { width: 92px; height: 69px; flex: none; border: 2.5px solid var(--ink); border-radius: 8px; overflow: hidden; background: #bfe9f5; position: relative; }
.cp-art svg { width: 100%; height: 100%; display: block; }
.cp b { display: block; font-family: var(--display); font-weight: 400; font-size: 14px; line-height: 1.15; }
.cp em { display: block; font-style: normal; font-weight: 800; font-size: 12.5px; color: var(--green); line-height: 1.2; margin: 1px 0 3px; }
.cp p { margin: 0; font-size: 13.5px; line-height: 1.28; }
.cp.locked { background: #ece5d6; }
.cp.locked .cp-art svg { filter: grayscale(1) brightness(.55) contrast(.8); }
.cp.locked .cp-art::after { content: ''; position: absolute; inset: 0; background: rgba(27,19,32,.35); }
.cp.locked .cp-lock { position: absolute; z-index: 1; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 50%; padding: 4px; }
.cp.locked em, .cp.locked p { color: #7a7068; }

.overlay#ov-police { align-items: flex-end; background: rgba(27,19,32,.5); }
.sheet.police { box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--blue), 0 8px 0 var(--ink); padding-top: 16px; animation: rise .35s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes rise { from { transform: translateY(60%); opacity: 0; } }
.cop-row { display: flex; align-items: center; gap: 12px; }
.cop-face { width: 84px; flex: none; }
.cop-face svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 0 rgba(27,19,32,.85)); }
.cop-kicker { font-family: var(--display); font-size: 12px; color: #fff; background: var(--blue); display: inline-block; padding: 4px 9px 2px; border-radius: 4px; transform: rotate(-2deg); }
.cop-name { font-family: var(--display); font-size: 21px; color: var(--ink); margin-top: 3px; }
.sheet.police p { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; }
.sheet.police .fine { font-family: var(--display); font-size: 15px; color: var(--red); }
.sheet.police .fine.ok { color: var(--green); }

/* ---------- ratings ---------- */
.slip-rating { text-align: center; margin-top: 12px; }
.slip-rating.off { display: none; }
.slip-stars { display: flex; justify-content: center; gap: 4px; }
.slip-stars .ic { width: 34px; height: 34px; animation: starpop .35s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.slip-rate { margin-top: 2px; font-family: var(--display); font-size: 17px; color: var(--pink); text-shadow: 1.5px 1.5px 0 var(--ink); }
.slip-rate small { font-family: var(--body); font-weight: 800; font-size: 13px; color: #6a2a55; text-shadow: none; margin-left: 6px; }
.slip-rows { margin-top: 4px; padding-top: 8px; }
.slip-fine { margin-top: 6px; font-weight: 800; font-size: 14px; color: var(--blue); }
.slip-fine:empty { display: none; }
.end-rating { font-family: var(--display); font-size: 13px; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 8px; padding: 6px 12px 4px; margin-top: 4px; transform: rotate(1.5deg); box-shadow: 0 3px 0 var(--ink); display: flex; align-items: center; gap: 6px; }
.end-rating:empty { display: none; }
.end-rating .ic { width: 18px; height: 18px; }
.postcard em { display: block; font-style: normal; font-weight: 800; font-size: 12px; line-height: 1.15; color: #6a2a55; max-width: 190px; }

/* ---------- fit every phone: scroll as a safety net, shrink on short screens ---------- */
.title-wrap, .end-wrap { overflow-y: auto; justify-content: flex-start; }
.title-wrap > *, .end-wrap > * { flex: none; max-width: 100%; }
.title-wrap > :first-child, .end-wrap > :first-child { margin-top: auto; }
.title-wrap > :last-child, .end-wrap > :last-child { margin-bottom: auto; }
#s-result { justify-content: flex-start; overflow-y: auto; padding-top: calc(104px + var(--safe-t));
  background: radial-gradient(circle at 50% 34%, rgba(255,255,255,.22), transparent 55%), repeating-linear-gradient(0deg, rgba(27,19,32,.07) 0 2px, transparent 2px 22px), repeating-linear-gradient(90deg, rgba(27,19,32,.07) 0 2px, transparent 2px 22px), var(--scene, var(--teal)); }
#s-result .scene-bg { display: none; }
#s-result .slip { margin-top: auto; flex: none; }
#s-result .board-btn { margin-bottom: auto; flex: none; }
#btn-continue[hidden] { display: none; }
#btn-continue + #btn-start.second { background: var(--yellow); color: var(--ink); text-shadow: none; font-size: 15px; padding: 10px 16px 8px; margin-top: 8px;
  box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--red), 0 5px 0 var(--ink); }
.title-row { flex-wrap: wrap; justify-content: center; }
.mini-btn { padding: 9px 11px 7px; }

@media (max-height: 760px) { .how { display: none; } }
@media (max-height: 820px) {
  .end-wrap { padding-top: calc(34px + var(--safe-t)); padding-bottom: calc(30px + var(--safe-b)); gap: 5px; }
  .big-title.end { font-size: clamp(24px, 8.4vw, 40px); white-space: nowrap; }
  #end-auto { width: min(34vw, 15dvh); }
  #s-result { gap: 12px; padding-top: calc(84px + var(--safe-t)); }
  .slip-face { top: -30px; width: 60px; height: 60px; } .slip-rating { margin-top: 6px; } .slip-rows { padding-top: 4px; } .slip-rows div { font-size: 16px; padding: 1px 0; } .slip-note { margin-top: 8px; font-size: 16px; }
  .end-card { margin-bottom: 8px; padding: 12px 14px 10px; } .end-card p { font-size: 15.5px; line-height: 1.3; margin-bottom: 8px; }
}
@media (max-height: 620px) {
  .kn-title { font-size: 23px; } .big-title { font-size: clamp(42px, 13.5vw, 58px); } .ribbon { margin-top: 6px; font-size: 11.5px; padding: 6px 12px 4px; }
  #title-auto { width: min(56vw, 27dvh); } .title-row { margin-top: 10px; } .title-wrap .board-btn { font-size: 17px; padding: 12px 18px 10px; }
  .title-wrap { padding-top: calc(30px + var(--safe-t)); padding-bottom: calc(30px + var(--safe-b)); gap: 4px; }
  #s-scene { gap: 7px; padding-bottom: calc(10px + var(--safe-b)); }
  .place-name { font-size: 18px; padding: 9px 14px 6px; } .place-time { font-size: 11px; }
  .talk { min-height: 84px; padding: 15px 12px 10px; } .talk p { font-size: 15.5px; line-height: 1.26; }
  .choices { gap: 7px; } .choice { padding: 7px 11px 5px; box-shadow: 0 4px 0 var(--ink); } .choice b { font-size: 12.5px; } .choice small { font-size: 12.5px; }
  .pad { padding-top: 6px; padding-bottom: calc(10px + var(--safe-b)); } .pad-btn { height: 58px; font-size: 32px; } .pad-btn.horn { font-size: 22px; } .pad-btn.horn span { font-size: 10px; }
  .ready-go { font-size: 44px; } .ready-to { font-size: 21px; }
  #s-result { gap: 10px; padding-top: calc(76px + var(--safe-t)); }
  .slip { padding: 12px 14px; } .slip-head { padding-top: 10px; padding-bottom: 6px; } .slip-rating { margin-top: 8px; } .slip-stars .ic { width: 28px; height: 28px; }
  .slip-rows div { font-size: 14.5px; } .slip-rows div b { font-size: 14px; } .slip-total { padding: 5px 0 2px; } .slip-total b { font-size: 23px; } .slip-note { font-size: 14.5px; margin-top: 6px; } .slip-gw { margin-top: 6px; font-size: 14px; } #s-result .board-btn { font-size: 16px; padding: 11px 18px 9px; }
  .end-kicker { font-size: 11px; } #end-auto { display: none; }
  .end-card p { font-size: 14.5px; }
  .sheet .board-btn { font-size: 14.5px; padding: 10px 16px 8px; } .sheet h2 { font-size: 22px; }
  .cop-face { width: 64px; } .sheet.police p { font-size: 15.5px; } .cop-name { font-size: 18px; }
}

/* ---------- album ---------- */
.rec { display: flex; gap: 8px; }
.rec div { flex: 1; text-align: center; background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px; padding: 7px 4px 4px; box-shadow: 0 3px 0 var(--ink); }
.rec small { display: block; font-family: var(--display); font-size: 9px; letter-spacing: .5px; color: var(--green); }
.rec b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.rider { display: flex; gap: 10px; align-items: center; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 8px; box-shadow: 0 3px 0 var(--ink); }
.rider-face { width: 62px; flex: none; }
.rider-face svg { width: 100%; height: auto; display: block; }
.rider b { display: block; font-family: var(--display); font-weight: 400; font-size: 14px; line-height: 1.15; }
.rider p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.25; }
.rider .st5 { display: flex; gap: 1px; margin-top: 2px; } .rider .st5 .ic { width: 15px; height: 15px; }
.rider.locked { background: #ece5d6; } .rider.locked .rider-face svg { filter: grayscale(1) brightness(.4) contrast(.6); } .rider.locked p { color: #7a7068; }
.set-reset.sure { color: var(--red); font-size: 14px; }

/* ---------- landscape phones ---------- */
.rotate { position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; text-align: center; background: var(--ink); color: var(--yellow); padding: 20px; }
.rotate b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; }
.rotate span { font-weight: 700; font-size: 15px; color: var(--cream); }
@media (orientation: landscape) and (max-height: 480px) and (pointer: coarse) { .rotate { display: flex; } }

/* ---------- menu ---------- */
.sheet.menu { gap: 9px; max-height: 100%; overflow-y: auto; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-grid .mini-btn { font-size: 12.5px; padding: 11px 6px 9px; background: #fff; }
#pz-save[hidden], #pz-quit[hidden], #guide-go[hidden] { display: none; }
#pz-quit.sure { color: var(--red); }
.sheet .sub:empty { display: none; }

/* ---------- guide, music room, about ---------- */
.pg { gap: 10px; }
.pg p { margin: 0; font-size: 14.5px; line-height: 1.32; }
.pg h3 { margin: 6px 0 -4px; font-family: var(--display); font-weight: 400; font-size: 14px; color: var(--green); }
.gd { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 9px 10px 7px; box-shadow: 0 3px 0 var(--ink); }
.gd-ic { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 20px; }
.gd b { display: block; font-family: var(--display); font-weight: 400; font-size: 13.5px; }
.gd-tip { font-weight: 800; font-style: italic; text-align: center; color: #6a2a55; }
#ov-guide .board-btn { align-self: center; font-size: 15px; margin: 2px 0 4px; }
.kflag { width: 64px; flex: none; }
.kflag-cloth { transform-origin: 10px 22px; animation: flag 1.4s ease-in-out infinite alternate; }
@keyframes flag { from { transform: skewY(-4deg) scaleX(1); } to { transform: skewY(4deg) scaleX(.94); } }
.ab-head { display: flex; align-items: center; gap: 12px; }
.ab-head b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--red); text-shadow: 1.5px 1.5px 0 var(--yellow); }
.ab-head span { font-weight: 800; font-size: 14px; }
.ab-grid { display: flex; gap: 8px; }
.ab-grid div { flex: 1; text-align: center; background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 2px 4px; box-shadow: 0 3px 0 var(--ink); }
.ab-grid b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; }
.ab-grid small { font-family: var(--display); font-size: 9px; color: var(--green); }
.pg .ab-small { font-size: 12.5px; color: #6a5a50; }
.mu-intro { font-weight: 700; }
.legend { background: #fff7e0; border: 3px dashed var(--ink); border-radius: 12px; padding: 9px 11px 8px; display: flex; flex-direction: column; gap: 6px; }
.legend b { font-family: var(--display); font-weight: 400; font-size: 13px; color: var(--green); }
.pg code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; font-weight: 700; background: #fff; border: 1.5px solid var(--ink); border-radius: 5px; padding: 0 4px; }
.raga { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 10px 11px 9px; box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; gap: 7px; }
.raga-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.raga-head b { font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--red); margin-right: 6px; }
.raga-head .kn { font-family: 'Baloo Kn', var(--body); font-weight: 800; font-size: 16px; }
.raga-head em { display: block; font-style: normal; font-weight: 800; font-size: 12.5px; color: var(--green); }
.rplay { font-family: var(--display); font-size: 13px; color: #fff; background: var(--pink); border: 3px solid var(--ink); border-radius: 10px; padding: 9px 14px 7px; box-shadow: 0 3px 0 var(--ink); text-shadow: 1px 1px 0 var(--ink); flex: none; }
.rplay.on { background: var(--green); color: var(--yellow); }
.scale { background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 10px; padding: 5px 9px 3px; }
.scale small { display: block; font-family: var(--display); font-size: 9px; color: var(--green); }
.scale b { font-family: var(--display); font-weight: 400; font-size: 16px; letter-spacing: 1px; }
.scale span { display: block; font-size: 12.5px; font-weight: 700; }
.raga summary { font-family: var(--display); font-size: 12px; cursor: pointer; padding: 5px 0 3px; color: var(--blue); }
.ph { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.ph code { flex: 1; background: none; border: 0; font-size: 12.5px; line-height: 1.3; word-break: break-word; }
.ph.mine code { color: var(--pink); }
.ph-play, .ph-del { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 15px; }
.ph-del { background: #fff; font-size: 12px; }
.cmp { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.cmp-out { min-height: 40px; background: #fff7e0; border: 2.5px solid var(--ink); border-radius: 8px; padding: 7px 9px 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 14px; line-height: 1.35; word-break: break-word; }
.cmp-out span { font-family: var(--body); font-weight: 700; color: #8a7f76; }
.keys { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.keys small { font-family: var(--display); font-size: 9px; color: var(--green); width: 48px; }
.k { flex: 1; min-width: 40px; font-family: var(--display); font-size: 15px; color: var(--ink); background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 9px; padding: 10px 2px 8px; box-shadow: 0 3px 0 var(--ink); }
.k:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.keys.small .k { font-size: 11px; padding: 7px 2px 5px; background: #fff; }
.keys.small .k.on { background: var(--green); color: var(--yellow); }
.keys.act .k { font-size: 11px; padding: 9px 2px 7px; background: #9fe3d6; }
.pg .cmp-note { font-size: 12.5px; color: #6a5a50; }
.k[data-note="-"] { font-size: 11px; }
@media (max-height: 720px) { #title-auto { width: min(62vw, 27dvh); } .title-row { margin-top: 10px; } }
.raga-head .by { display: inline-block; font-family: var(--display); font-size: 10.5px; color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); border-radius: 10px; padding: 3px 8px 1px; margin: 2px 0; }

/* ---------- explore Bengaluru: map and list ---------- */
.mini-btn.hot { background: var(--yellow); }
.menu-grid .mini-btn:last-child:nth-child(odd) { grid-column: span 2; }
.ex-tools { display: flex; gap: 6px; }
.ex-tools .k { font-size: 11px; padding: 8px 2px 6px; background: #fff; }
.ex-tools .k.on { background: var(--green); color: var(--yellow); }
.ex-map { height: min(46dvh, 340px); min-height: 200px; flex: none; overflow: auto; -webkit-overflow-scrolling: touch; border: 3px solid var(--ink); border-radius: 12px; background: #f6e7c4; box-shadow: 0 3px 0 var(--ink); }
.ex-map svg { display: block; }
.ex-map svg.fit { height: auto; }
.pin { cursor: pointer; }
.pin .hit { fill: transparent; transform-box: fill-box; transform-origin: center; transform: scale(calc(1 / var(--z, 1))); }
.pin .dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 2.2; transform-box: fill-box; transform-origin: center; transform: scale(calc(1 / var(--z, 1))); transition: transform .15s; }
.pin.ok .dot { fill: var(--pink); }
.pin.far .dot { fill: #fff; }
.pin text { font-family: var(--body); font-weight: 800; font-size: calc(12.5px / var(--z, 1)); fill: var(--ink); stroke: #fff9e6; stroke-width: calc(3.6px / var(--z, 1)); paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.pin.nolabel text { display: none; }
.pin.sel .dot { transform: scale(calc(1.75 / var(--z, 1))); fill: var(--red); }
.pin.sel text { display: block; font-size: calc(15.5px / var(--z, 1)); fill: var(--red); }
.ex-wrap { position: relative; flex: none; }
.ex-north { position: absolute; top: 9px; right: 11px; width: 30px; height: 30px; border-radius: 50%; background: var(--cream); border: 2.5px solid var(--ink); font-family: var(--display); font-size: 11px; display: grid; place-items: end center; padding-bottom: 2px; pointer-events: none; }
.ex-north i { position: absolute; top: 3px; left: 50%; margin-left: -4px; border: 4px solid transparent; border-bottom: 8px solid var(--red); border-top: 0; }
.ex-scale { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 5px; background: rgba(255,243,214,.9); border: 2px solid var(--ink); border-radius: 8px; padding: 3px 7px 2px; font-family: var(--display); font-size: 9.5px; pointer-events: none; }
.ex-scale i { display: block; height: 5px; background: var(--ink); border-radius: 2px; }
.ex-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; font-weight: 800; }
.ex-legend i { display: inline-block; width: 16px; height: 6px; border: 1.5px solid var(--ink); border-radius: 3px; margin-right: 4px; vertical-align: 1px; }
.ex-card { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 8px; box-shadow: 0 3px 0 var(--ink); flex: none; }
.ex-card b { display: block; font-family: var(--display); font-weight: 400; font-size: 14.5px; line-height: 1.15; }
.ex-card em { display: block; font-style: normal; font-weight: 800; font-size: 12.5px; color: var(--green); margin: 1px 0 3px; }
.ex-card small { display: block; margin-top: 4px; font-weight: 800; font-size: 12px; color: #6a2a55; }
.ex-list { display: flex; flex-direction: column; gap: 6px; }
.ex-row { display: flex; align-items: center; gap: 8px; text-align: left; background: #fff; border: 2.5px solid var(--ink); border-radius: 10px; padding: 6px 9px 4px; }
.ex-row .ic { flex: none; font-size: 17px; }
.ex-row span { flex: 1; min-width: 0; }
.ex-row b { display: block; font-family: var(--display); font-weight: 400; font-size: 12.5px; }
.ex-row small { display: block; font-size: 12.5px; font-weight: 700; color: #6a5a50; line-height: 1.2; }
.ex-row em { font-style: normal; font-family: var(--display); font-size: 9px; color: #fff; background: var(--pink); border: 2px solid var(--ink); border-radius: 8px; padding: 3px 6px 1px; flex: none; }
/* the route shown before a ride */
.ready-map { height: 104px; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; margin: 0 0 8px; background: #f6e7c4; }
.ready-map:empty { display: none; }
.ready-map svg { width: 100%; height: 100%; display: block; }
@media (max-height: 620px) { .ready-map { height: 78px; margin-bottom: 5px; } .ex-map { height: 40dvh; } }
.ex-kn { align-self: center; font-family: 'Baloo Kn', var(--body); font-weight: 800; font-size: 24px; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 26px; padding: 1px 16px 0; box-shadow: 0 3px 0 var(--ink); transform: rotate(-1.5deg); flex: none; }
.slip-rate .kn { display: block; font-family: 'Baloo Kn', var(--body); font-weight: 800; font-size: 19px; color: var(--ink); text-shadow: none; line-height: 1.1; }
.end-gloss .kn { font-family: 'Baloo Kn', var(--body); font-weight: 800; font-size: 16px; margin-right: 4px; }

/* ---------- credit ---------- */
.credit { margin-top: 10px; font-family: var(--display); font-size: 10.5px; letter-spacing: .3px; color: var(--ink); background: var(--cream); border: 2.5px solid var(--ink); border-radius: 20px; padding: 5px 12px 3px; white-space: nowrap; }
.credit .ic { width: 14px; height: 14px; vertical-align: -3px; margin: 0 1px; }
.pg .credit.about { align-self: center; margin: 4px 0 0; font-size: 13px; padding: 8px 16px 6px; background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.credit.about .ic { width: 17px; height: 17px; }
.credit a { color: var(--red); text-decoration: underline; }
@media (max-height: 620px) { .title-wrap .credit { margin-top: 6px; font-size: 9.5px; padding: 3px 10px 2px; } }
.credit.title { position: absolute; z-index: 3; left: 50%; bottom: calc(3px + var(--safe-b)); transform: translateX(-50%); margin: 0; font-size: 9.5px; padding: 3px 11px 1px; border-width: 2px; }
.credit.title .ic { width: 12px; height: 12px; vertical-align: -2px; }

/* ---------- very narrow and very small phones (folded phones, older Androids) ---------- */
.raga-head > div { flex: 1; min-width: 0; }
.raga-head b, .raga-head .kn { overflow-wrap: anywhere; }
@media (max-width: 345px) {
  #s-scene, #s-result { padding-left: 9px; padding-right: 9px; }
  .title-wrap, .end-wrap { padding-left: 10px; padding-right: 10px; }
  .big-title { font-size: 15.5vw; } .ribbon { font-size: 10px; padding: 6px 9px 4px; letter-spacing: 0; }
  .mini-btn { font-size: 11px; padding: 8px 8px 6px; } .title-row { gap: 6px; }
  .board-btn { font-size: 16px; padding: 12px 14px 10px; }
  .status { font-size: 14px; padding-left: 8px; padding-right: 50px; } .st small { display: none; } .st.hearts .ic { width: 15px; height: 15px; }
  .dhud { padding-left: 7px; padding-right: 50px; } .meter { min-width: 74px; padding: 2px 6px 0; } .meter b { font-size: 18px; } .mood-face { width: 36px; height: 36px; }
  .pad { gap: 6px; padding-left: 7px; padding-right: 7px; }
  .rplay { padding: 8px 9px 6px; font-size: 12px; } .raga-head b { font-size: 15px; } .raga { padding: 9px 8px 8px; }
  .k { min-width: 32px; font-size: 13px; } .keys small { width: 100%; }
  .overlay { padding-left: 8px; padding-right: 8px; } .sheet { padding-left: 12px; padding-right: 12px; }
  .choice b { font-size: 12.5px; } .talk p { font-size: 15.5px; }
  .end-stats b { font-size: 16px; } .slip-rows div { font-size: 15px; }
  .credit.title { font-size: 8.5px; padding: 3px 8px 1px; }
}
@media (max-height: 540px) {
  .kn-title { font-size: 20px; } .big-title { font-size: clamp(36px, 12vw, 50px); } #title-auto { width: min(46vw, 22dvh); }
  .title-wrap { padding-top: calc(28px + var(--safe-t)); gap: 3px; } .title-row { margin-top: 7px; }
  .end-wrap { padding-top: calc(30px + var(--safe-t)); gap: 3px; } .end-card p { font-size: 13.5px; line-height: 1.25; } .end-gloss { font-size: 12px; } .end-rating { font-size: 11px; padding: 4px 9px 2px; }
}

/* ---------- tablets and laptops: a slightly wider, taller stage ---------- */
@media (min-width: 700px) and (min-height: 800px) {
  #app { max-width: 560px; }
  .art .frame { max-height: 420px; } .art .wide { height: min(100%, 300px); }
  .talk p { font-size: 20px; } .choice b { font-size: 15.5px; } .choice small { font-size: 14.5px; }
  .ex-map { height: min(46dvh, 440px); }
}
.pg a { color: var(--blue); font-weight: 800; }
