@import url('card.css');
@import url('mounts.css');
@import url('swim.css');
@import url('ufo.css');
:root {
  --pink: #ff4f8b; --yellow: #ffd23f; --blue: #3ec1ff; --green: #5fd38a; --purple: #a98bff; --orange: #ff8c42;
  --ink: #1b1535; --ink2: #2d2556; --paper: #fff9f2; --glass: rgba(27, 21, 53, .62); --glass2: rgba(27, 21, 53, .82);
  --line: rgba(255, 255, 255, .16); --txt: #fff; --muted: rgba(255, 255, 255, .72);
  --r: 22px; --script: 'Fredoka',; --display: var(--script) 'Fredoka', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif; --body: var(--script) 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background: #8cc7ff; color: var(--txt); font-family: var(--body); -webkit-font-smoothing: antialiased; }
canvas#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; height: 1.9em; padding: 0 .45em; border-radius: .6em; background: linear-gradient(#fff, #e9e3ff); color: var(--ink); font: 700 .78rem/1 var(--display); box-shadow: 0 3px 0 #b7a9ff, 0 4px 10px rgba(0, 0, 0, .25); margin-right: .5em; }

/* glossy balloon buttons */
.btn { --c: #ffffff; --c2: #e8e2ff; position: relative; border: 0; cursor: pointer; padding: .8em 1.4em; border-radius: 999px; font: 600 1rem/1 var(--display); letter-spacing: .01em; color: var(--ink); background: radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 38%), linear-gradient(180deg, var(--c), var(--c2)); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 6px 18px rgba(0, 0, 0, .22); transition: transform .15s cubic-bezier(.3, 1.8, .5, 1), filter .15s; display: inline-flex; align-items: center; gap: .55em; justify-content: center; white-space: nowrap; }
.btn:hover { transform: translateY(-2px) scale(1.03); filter: saturate(1.2); }
.btn:active { transform: scale(.96); }
.btn.primary { --c: #ff6fa1; --c2: #ff2f73; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.btn.blue { --c: #69d2ff; --c2: #1aa2e8; color: #fff; }
.btn.yellow { --c: #ffe278; --c2: #ffbf1f; }
.btn.green { --c: #7fe3a4; --c2: #2fbf6a; color: #fff; }
.btn.purple { --c: #c2adff; --c2: #7f5dff; color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); }
.btn.big { font-size: 1.25rem; padding: .95em 1.8em; }
.btn.sm { font-size: .85rem; padding: .55em 1em; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ico { width: 1.25em; height: 1.25em; display: inline-block; }

/* ------------ landing ------------ */
#landing { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: flex; flex-direction: column; }
#landing.hide { display: none; }
#landing > * { pointer-events: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 26px; gap: 12px; pointer-events: auto; }
.brand { font: 700 1.15rem var(--display); letter-spacing: .06em; display: flex; align-items: center; gap: .5em; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.brand .dot { width: 14px; height: 18px; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--pink) 40%); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.brand small { font: 500 .8rem var(--body); opacity: .8; letter-spacing: 0; }
.toplinks { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hero { flex: 1; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 26px 26px; gap: 24px; pointer-events: none; }
.hero > * { pointer-events: auto; }
.tagline { max-width: 460px; align-self: flex-end; margin-bottom: 6px; }
.tagline h1 { font: 700 clamp(1.6rem, 3.4vw, 2.6rem)/1.05 var(--display); margin: 0 0 .35em; text-shadow: 0 3px 18px rgba(20, 10, 60, .35); }
.tagline p { font-size: 1.05rem; line-height: 1.45; margin: 0; color: #fff; text-shadow: 0 2px 10px rgba(20, 10, 60, .45); }
.gamestrip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip { font: 600 .78rem var(--display); padding: .45em .8em; border-radius: 999px; background: rgba(255, 255, 255, .2); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .35); }
.panel { width: min(430px, 100%); background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); border: 1px solid var(--line); border-radius: 28px; padding: 22px; box-shadow: 0 30px 60px rgba(20, 10, 60, .35); }
.panel h2 { font: 700 1.35rem var(--display); margin: 0 0 4px; }
.panel .sub { color: var(--muted); margin: 0 0 16px; font-size: .92rem; line-height: 1.4; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack .btn { width: 100%; justify-content: flex-start; padding-left: 1.2em; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 6px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.addr { display: flex; gap: 8px; }
.addr input { flex: 1; min-width: 0; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); border-radius: 999px; padding: .7em 1em; color: #fff; font: 500 .9rem var(--body); outline: none; }
.addr input:focus { border-color: var(--blue); }
.note { font-size: .78rem; color: var(--muted); line-height: 1.4; margin-top: 12px; }
.note a { color: var(--yellow); }
.who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; background: rgba(255, 255, 255, .08); border-radius: 16px; font-size: .9rem; }
.who b { font-family: var(--display); }
.who .x { margin-left: auto; cursor: pointer; opacity: .7; background: none; border: 0; }
.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; max-height: min(42vh, 360px); overflow: auto; padding: 2px; margin: 4px -2px 14px; }
.nudo { position: relative; border-radius: 18px; background: rgba(255, 255, 255, .08); border: 2px solid transparent; padding: 8px; cursor: pointer; text-align: left; transition: transform .15s, border-color .15s; min-width: 0; }
.nudo:hover { transform: translateY(-2px); }
.nudo.on { border-color: var(--yellow); background: rgba(255, 210, 63, .14); }
.nudo .th { aspect-ratio: 1; border-radius: 12px; background: radial-gradient(circle at 40% 30%, #fff5, transparent 60%), linear-gradient(160deg, #6a4cff, #ff4f8b); display: grid; place-items: center; overflow: hidden; font: 700 1.8rem var(--display); }
.nudo .th img { width: 100%; height: 100%; object-fit: cover; }
.nudo .nm { font: 600 .78rem/1.2 var(--display); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nudo .tg { font-size: .66rem; color: var(--muted); }
.nudo .badge { position: absolute; top: 12px; left: 12px; font: 700 .6rem var(--display); background: var(--yellow); color: var(--ink); padding: .25em .55em; border-radius: 999px; }
.enter { width: 100%; }
.status { font-size: .85rem; color: var(--muted); min-height: 1.2em; margin: 8px 0 0; }
.spin { width: 16px; height: 16px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: sp 0.8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ------------ HUD ------------ */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--body); }
#ui.modal-open { z-index: 30; } /* a modal opened from the landing page (age gate, import) sits above it */
#ui * { pointer-events: none; }
#ui .modal, #ui .modal *, #ui .interactive, #ui .interactive *, #ui .touchbtns, #ui .touchbtns * { pointer-events: auto; }
#hud { position: absolute; inset: 0; }
.hudbox { position: absolute; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; font: 600 .95rem var(--display); box-shadow: 0 10px 30px rgba(20, 10, 60, .25); }
.tl { top: 16px; left: 16px; } .tr { top: 16px; right: 16px; } .bl { bottom: 16px; left: 16px; } .br { bottom: 16px; right: 16px; } .tc { top: 16px; left: 50%; transform: translateX(-50%); } .bc { bottom: 16px; left: 50%; transform: translateX(-50%); }
.bignum { font: 700 2.4rem/1 var(--display); text-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.bignum small { font-size: .45em; opacity: .8; }
.bar { width: 220px; margin: 4px 0; }
.bar label { display: flex; justify-content: space-between; font: 600 .78rem var(--display); margin-bottom: 3px; opacity: .92; }
.bar .track { height: 14px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35); }
.bar .fill { height: 100%; width: 50%; border-radius: 999px; background: linear-gradient(180deg, #ffe278, #ff9f1f); transition: width .12s; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45); }
.bar.pink .fill { background: linear-gradient(180deg, #ff8ab3, #ff2f73); } .bar.blue .fill { background: linear-gradient(180deg, #8fe0ff, #1aa2e8); } .bar.green .fill { background: linear-gradient(180deg, #9ff0bd, #2fbf6a); } .bar.purple .fill { background: linear-gradient(180deg, #d5c6ff, #7f5dff); }
#banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.6); opacity: 0; text-align: center; transition: transform .35s cubic-bezier(.2, 1.8, .4, 1), opacity .2s; }
#banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
#banner .b1 { font: 700 clamp(3rem, 9vw, 7rem)/1 var(--display); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 rgba(27, 21, 53, .35), 0 0 40px rgba(255, 79, 139, .6); letter-spacing: .02em; white-space: nowrap; }
#banner .b2 { font: 600 clamp(1rem, 2.4vw, 1.5rem) var(--display); margin-top: .4em; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
#banner.count .b1 { font-size: clamp(5rem, 16vw, 11rem); color: var(--yellow); }
#banner.go .b1 { color: var(--green); }
#banner.gold .b1 { color: var(--yellow); } #banner.bad .b1 { color: #ff6b6b; }
#prompt { position: absolute; left: 50%; bottom: 120px; transform: translate(-50%, 20px); opacity: 0; transition: .25s cubic-bezier(.2, 1.6, .4, 1); background: var(--glass2); border: 1px solid var(--line); padding: 10px 18px 10px 12px; border-radius: 999px; font: 600 1rem var(--display); display: flex; align-items: center; }
#prompt.show { opacity: 1; transform: translate(-50%, 0); }
#hints { position: absolute; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; font: 500 .8rem var(--display); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
#hints > div { display: flex; align-items: center; }
#toast { position: absolute; top: 22px; left: 50%; transform: translate(-50%, -30px); opacity: 0; background: var(--glass2); padding: 10px 18px; border-radius: 999px; font: 600 .95rem var(--display); transition: .3s; border: 1px solid var(--line); max-width: 90vw; text-align: center; z-index: 5; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20, 12, 50, .35); backdrop-filter: blur(4px); pointer-events: auto; }
#overlay.show { display: flex; }
.modal { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: var(--glass2); border: 1px solid var(--line); border-radius: 28px; padding: 24px; box-shadow: 0 40px 80px rgba(0, 0, 0, .4); animation: pop .4s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.modal h2 { font: 700 1.8rem var(--display); margin: 0 0 4px; text-align: center; }
.modal h3 { font: 700 1.05rem var(--display); margin: 14px 0 8px; }
.modal .sub { color: var(--muted); text-align: center; margin: 0 0 14px; }
.modal .rows { list-style: none; padding: 0; margin: 0 0 18px; }
.modal .rows li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; font: 600 1rem var(--display); }
.modal .rows li:nth-child(odd) { background: rgba(255, 255, 255, .06); }
.modal .rows li.you { background: linear-gradient(90deg, rgba(255, 210, 63, .35), rgba(255, 79, 139, .25)); }
.modal .rows b { width: 28px; text-align: center; opacity: .8; } .modal .rows span { flex: 1; } .modal .rows em { font-style: normal; opacity: .9; }
.modal .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.medal { width: 96px; height: 110px; margin: -8px auto 8px; display: grid; place-items: center; font: 700 1.6rem var(--display); color: var(--ink); border-radius: 50% 50% 50% 50% / 56% 56% 44% 44%; background: radial-gradient(circle at 35% 28%, #fff 0 10%, #ffe278 30%, #e0a100 100%); box-shadow: 0 10px 30px rgba(255, 200, 40, .5); animation: floaty 2.4s ease-in-out infinite; }
.medal.silver { background: radial-gradient(circle at 35% 28%, #fff 0 10%, #e6ecf2 30%, #8f9aa6 100%); }
.medal.bronze { background: radial-gradient(circle at 35% 28%, #fff 0 10%, #f3b27f 30%, #a55a24 100%); }
.medal.lose { background: radial-gradient(circle at 35% 28%, #fff 0 10%, #c9c3e6 30%, #6b6391 100%); color: #fff; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(3deg); } }
.gamecard .hero-ico { height: 8px; }
.gamecard .ctrl { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; font-size: .9rem; margin: 10px 0 18px; }
.gamecard .ctrl kbd { margin: 0; justify-self: start; }
.gamecard .desc { text-align: center; color: #fff; line-height: 1.45; margin: 0 0 6px; }
.opts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 16px; }
.opts button { padding: .5em .9em; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .06); font: 600 .85rem var(--display); cursor: pointer; }
.opts button.on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; font: 600 .95rem var(--display); }
.setrow input[type=range] { width: 180px; accent-color: var(--pink); }
.tracks { max-height: 180px; overflow: auto; margin: 8px 0; border-radius: 14px; background: rgba(0, 0, 0, .2); }
.tracks div { padding: 8px 12px; font-size: .88rem; display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.tracks div.on { background: rgba(255, 79, 139, .35); }
.tracks div:hover { background: rgba(255, 255, 255, .08); }
.minimap { position: absolute; right: 16px; bottom: 16px; width: 170px; height: 170px; border-radius: 50%; background: rgba(27, 21, 53, .55); border: 2px solid rgba(255, 255, 255, .35); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.pos { font: 700 3.2rem/1 var(--display); color: var(--yellow); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.pos sup { font-size: .45em; }
.itembox { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; font: 700 .72rem var(--display); text-align: center; background: var(--glass); border: 2px solid rgba(255, 255, 255, .4); }
.itembox .ib { font-size: 2rem; line-height: 1; }
.touchbtns { position: absolute; right: 16px; bottom: 90px; display: flex; flex-wrap: wrap-reverse; gap: 10px; width: 170px; justify-content: flex-end; }
.touchbtns button { width: 74px; height: 74px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #fff9 0 10%, #ff4f8bcc 50%); font: 700 .8rem var(--display); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); font: 600 .78rem var(--display); }
.namechip { display: flex; align-items: center; gap: 8px; }
.namechip i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.fps { position: absolute; right: 8px; bottom: 4px; font: 500 .7rem var(--body); opacity: .5; }

/* ------------ transition: a balloon swelling to fill the screen ------------ */
#trans { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(circle at 50% 45%, #ff7aa8, #ff2f73 45%, #6a2bd8 100%); clip-path: circle(0% at 50% 50%); transition: clip-path .5s cubic-bezier(.6, 0, .3, 1); pointer-events: none; }
#trans.in { clip-path: circle(150% at 50% 50%); pointer-events: auto; }
#trans.in.out { clip-path: circle(0% at 50% 50%); }
#trans .ttitle { font: 700 clamp(2rem, 6vw, 4.2rem) var(--display); color: #fff; text-shadow: 0 6px 0 rgba(0, 0, 0, .15); letter-spacing: .02em; text-align: center; padding: 0 20px; }
#trans .tsub { font: 600 1rem var(--display); opacity: .85; }
.tdots { display: flex; gap: 12px; }
.tdots i { width: 22px; height: 28px; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%; background: radial-gradient(circle at 35% 30%, #fff 0 14%, var(--yellow) 45%); animation: bob .9s ease-in-out infinite; }
.tdots i:nth-child(2) { animation-delay: .1s; background: radial-gradient(circle at 35% 30%, #fff 0 14%, var(--blue) 45%); }
.tdots i:nth-child(3) { animation-delay: .2s; background: radial-gradient(circle at 35% 30%, #fff 0 14%, var(--green) 45%); }
.tdots i:nth-child(4) { animation-delay: .3s; background: radial-gradient(circle at 35% 30%, #fff 0 14%, var(--purple) 45%); }
.tdots i:nth-child(5) { animation-delay: .4s; background: radial-gradient(circle at 35% 30%, #fff 0 14%, var(--orange) 45%); }
@keyframes bob { 50% { transform: translateY(-14px) scale(1.06, .94); } }
#boot { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 40%, #9fd0ff, #3a7bf0); transition: opacity .6s; font: 700 1.4rem var(--display); }
#boot.gone { opacity: 0; pointer-events: none; }
#boot .bl { letter-spacing: .1em; }

@media (max-width: 760px) {
  .hero { flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 0 16px 16px; }
  .tagline { display: none; }
  .topbar { padding: 12px 16px; }
  .toplinks .btn.ghost { display: none; }
  .panel { padding: 18px; width: 100%; }
  .wardrobe { max-height: 30vh; }
  .bar { width: 150px; }
  .minimap { width: 120px; height: 120px; }
  #hints { display: none; }
}

/* ------------ phones and tablets ------------ */
.vstick { position: fixed; z-index: 11; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.08), rgba(255,255,255,.22)); border: 2px solid rgba(255,255,255,.45); opacity: 0; transition: opacity .15s; pointer-events: none; }
.vstick.on { opacity: 1; }
.vstick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--pink) 55%); box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.pausebtn { position: fixed; z-index: 12; top: calc(8px + env(safe-area-inset-top, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(27,21,53,.7); display: flex; align-items: center; justify-content: center; gap: 5px; }
.pausebtn span { width: 5px; height: 16px; border-radius: 3px; background: #fff; }
.pausebtn[hidden] { display: none !important; }
.touchbtns { right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: 260px; gap: 12px; }
.touchbtns button { width: 78px; height: 78px; font-size: .78rem; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 6px 14px rgba(0,0,0,.3); -webkit-tap-highlight-color: transparent; touch-action: none; }
.touchbtns button.on { transform: scale(.92); filter: brightness(1.15); }
.touchbtns button:nth-child(2) { background: radial-gradient(circle at 35% 30%, #fff9 0 10%, #3ec1ffcc 50%); }
.touchbtns button:nth-child(3) { background: radial-gradient(circle at 35% 30%, #fff9 0 10%, #ffd23fcc 50%); color: #1b1535; }
.touchbtns button:nth-child(4) { background: radial-gradient(circle at 35% 30%, #fff9 0 10%, #5fd38acc 50%); }
body.touch #hints { display: none; }
body.touch #prompt { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
@media (max-height: 500px) {
  #hints { display: none; }
  .hudbox { padding: 7px 10px; font-size: .82rem; border-radius: 14px; }
  .bignum { font-size: 1.7rem; } .pos { font-size: 2.3rem; }
  .bar { width: 150px; } .bar .track { height: 10px; }
  .minimap { width: 110px; height: 110px; }
  .itembox { width: 60px; height: 60px; } .itembox .ib { font-size: 1.5rem; }
  #banner .b1 { font-size: clamp(2.2rem, 11vh, 4.5rem); } #banner.count .b1 { font-size: clamp(3.5rem, 22vh, 7rem); }
  .modal { padding: 16px; max-height: calc(100vh - 16px); } .modal h2 { font-size: 1.4rem; }
  .gamecard .ctrl { margin: 6px 0 10px; font-size: .82rem; gap: 5px 8px; }
  .touchbtns button { width: 66px; height: 66px; }
  .panel { max-height: calc(100vh - 70px); overflow: auto; padding: 14px; }
  .wardrobe { max-height: 34vh; }
  .hero { padding-bottom: 10px; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .hero { padding: 0 12px 12px; }
  .panel { max-height: 62vh; overflow: auto; }
  .topbar { padding: 10px 12px; }
  .brand small { display: none; }
}
body.touch .minimap { opacity: .85; }
/* the round pause button owns the top right corner in games: shift top-right HUD boxes left of it */
body.haspause #hud .tr { right: calc(60px + env(safe-area-inset-right, 0px)); }
/* the touch buttons own the bottom right: the minimap moves under the top-left box */
body.touch .minimap { right: auto; bottom: auto; left: calc(16px + env(safe-area-inset-left, 0px)); top: 92px; width: 104px; height: 104px; }

#ui #prompt.tap.show { pointer-events: auto; padding: 12px 20px 12px 12px; box-shadow: 0 8px 22px rgba(0,0,0,.3); -webkit-tap-highlight-color: transparent; }
#ui #prompt.tap kbd { background: linear-gradient(#ff8ab3, #ff2f73); color: #fff; box-shadow: 0 3px 0 #b8104a; }
.touchbtns button.dim { opacity: .45; filter: saturate(.6); }
#overlay.show ~ #prompt { opacity: 0; pointer-events: none !important; }
/* short landscape screens (phones sideways): results card goes two columns so the buttons stay on screen */
@media (max-height: 500px) and (min-width: 600px) {
  .modal.results { width: min(760px, calc(100vw - 24px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: auto auto auto 1fr; grid-template-areas: "medal rows" "title rows" "sub rows" "btns rows"; column-gap: 18px; align-items: start; padding: 14px 16px; }
  .modal.results > .medal { grid-area: medal; width: 64px; height: 74px; font-size: 1.15rem; margin: 0 auto 4px; }
  .modal.results > h2 { grid-area: title; font-size: 1.3rem; line-height: 1.15; }
  .modal.results > .sub { grid-area: sub; margin: 2px 0 10px; font-size: .88rem; }
  .modal.results > .rows { grid-area: rows; margin: 0; max-height: calc(100vh - 44px); overflow: auto; align-self: center; }
  .modal.results > .btns { grid-area: btns; align-self: end; flex-direction: column; align-items: stretch; }
  .modal.results > .btns .btn { width: 100%; }
  .modal.results .rows li { padding: 6px 10px; font-size: .9rem; }
  .modal.results > :not(.medal):not(h2):not(.sub):not(.rows):not(.btns) { grid-column: 1 / -1; }
}
.touchbtns.left { right: auto; left: calc(14px + env(safe-area-inset-left, 0px)); justify-content: flex-start; flex-wrap: wrap-reverse; }
@media (max-height: 500px) and (min-width: 600px) {
  .gamecard .ctrl { grid-template-columns: auto 1fr auto 1fr; gap: 6px 10px; }
  .gamecard .desc { font-size: .86rem; line-height: 1.35; }
  .gamecard .sub { margin-bottom: 6px; }
  .modal .btn.big { font-size: 1.05rem; padding: .75em 1.5em; }
}
@media (max-height: 500px) and (min-width: 600px) { .modal:has(.gamecard) { width: min(640px, calc(100vw - 24px)); } }
/* landing on short landscape phones: compact panel, horizontal NUDO strip, the 3D NUDO stays visible */
@media (max-height: 500px) and (min-width: 600px) {
  .tagline p, .gamestrip { display: none; }
  .tagline h1 { font-size: 1.45rem; }
  .panel { width: min(400px, 50vw); }
  .panel .sub, .panel .note { display: none; }
  .panel h2 { font-size: 1.15rem; margin-bottom: 8px; }
  .panel .or { margin: 3px 0; font-size: .72rem; }
  .panel .stack { gap: 8px; }
  .panel .btn { padding-top: .62em; padding-bottom: .62em; }
  .panel .or ~ .stack { display: grid; grid-template-columns: 1fr 1fr; }
  .panel .or ~ .stack .btn { font-size: .8rem; padding-left: .8em; padding-right: .8em; white-space: normal; line-height: 1.15; justify-content: center; }
  .who { padding: 6px 10px; margin-bottom: 8px; }
  .btn.big.enter { font-size: 1.05rem; padding: .8em 1.2em; }
}
@media (max-height: 500px) and (min-width: 600px), (max-width: 760px) and (orientation: portrait) {
  .wardrobe { display: flex; overflow-x: auto; overflow-y: hidden; max-height: none; gap: 8px; margin: 2px -2px 10px; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .wardrobe .nudo { flex: 0 0 104px; padding: 6px; scroll-snap-align: start; }
  .nudo .badge { top: 9px; left: 9px; }
}
#overlay.show ~ #banner { opacity: 0; }

/* ------------ languages ------------ */
.langsel { font: 600 .85rem var(--display); color: #fff; background: rgba(27,21,53,.55); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .5em 2em .5em .9em; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.langsel option { color: #1b1535; background: #fff; }
html.rtl .modal, html.rtl .panel, html.rtl #toast, html.rtl #banner, html.rtl #prompt, html.rtl .tagline, html.rtl .hudbox, html.rtl .gamecard { direction: rtl; }
html.rtl .stack .btn { padding-left: 1em; padding-right: 1.2em; }

/* sticky RUN toggle */
.touchbtns button.toggle { background: radial-gradient(circle at 35% 30%, #fff9 0 10%, #6a5cffcc 50%) !important; color: #fff !important; opacity: .7; }
.touchbtns button.toggle.on { opacity: 1; transform: none; box-shadow: 0 0 0 4px #ffd23f, 0 6px 14px rgba(0,0,0,.3); }

/* big map (hub): tap a pin to jump there */
.minimap.interactive { cursor: pointer; }
.modal.mapmodal { width: min(92vw, 760px); padding: 14px 16px 16px; }
.bigmap .bmhead { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.bigmap .bmhead h2 { margin: 0; }
.bigmap .bmhead .sub { margin: 0; flex: 1; opacity: .8; }
.bigmap .bmwrap { position: relative; width: min(100%, calc(100vh - 150px)); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle, #2a8fd8 0 55%, #1b5fa8 100%); box-shadow: inset 0 0 40px rgba(0,0,0,.35); }
.bigmap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.bigmap .pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 4px; cursor: pointer; color: #fff; font: 700 .78rem var(--display); text-shadow: 0 1px 3px rgba(0,0,0,.7); -webkit-tap-highlight-color: transparent; }
.bigmap .pin i { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--c) 55%); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.35); transition: transform .12s; }
.bigmap .pin.game i { width: 32px; height: 32px; }
.bigmap .pin span { white-space: nowrap; background: rgba(27,21,53,.72); padding: 2px 8px; border-radius: 999px; }
.bigmap .pin:hover i, .bigmap .pin:active i { transform: scale(1.25); }
@media (max-height: 500px) { .modal.mapmodal { padding: 8px 10px; } .bigmap .bmhead .sub { display: none; } .bigmap .bmwrap { width: min(100%, calc(100vh - 80px)); } .bigmap .pin span { font-size: .66rem; padding: 1px 6px; } .bigmap .pin i { width: 20px; height: 20px; } .bigmap .pin.game i { width: 24px; height: 24px; } }

/* TorNUDO pointer at the screen edge */
.tor-arrow { position: absolute; transform: translate(-50%, -50%); display: none; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; font: 700 .8rem var(--display); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.tor-arrow.on { display: flex; animation: torpulse .8s ease-in-out infinite alternate; }
.tor-arrow i { font-style: normal; font-size: 2rem; color: #b8a8ff; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.tor-arrow span { background: rgba(61,52,128,.85); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
@keyframes torpulse { to { transform: translate(-50%, -50%) scale(1.12); } }
.bigmap .pin.up { flex-direction: row-reverse; gap: 4px; transform: translate(calc(-100% + 17px), -50%); }
.bigmap .pin.game { z-index: 2; }
.bigmap .pin:hover, .bigmap .pin:active { z-index: 3; }
@media (max-height: 500px) {
  .bigmap { position: relative; }
  .bigmap .bmhead { position: absolute; left: 0; top: 0; z-index: 4; flex-direction: column; align-items: flex-start; gap: 6px; }
  .bigmap .bmwrap { width: min(100%, calc(100vh - 36px)); }
}
