/* Radish Rumble — design tokens (thiet_ke/design_tokens.json) + screens 06/07/08/09 */
:root {
  --bg: #fcf3eb; --surface: #fdf7ee; --primary: #6a9f28; --secondary: #f9ead8; --accent: #ffc811;
  --text: #452916; --muted: #916545; --border: #a56638; --danger: #c65027; --success: #4bbc21;
  --logo: #6d2f09; --pill: #f8e1c1; --pill2: #fcedd8; --sec-border: #713e14;
  --hud: #faeddd; --team: #f7e7d2; --hide: #6c992f; --ink8: #2b311f; --grey8: #56514c; --badge8: #c4d2aa; --xp8: #e4e7cf; --cta8: #719850; --ring8: #b2be86;
  --ink9: #233915; --hud9: #f9ecd2; --team9: #f7ecd1; --hide9: #33662d; --hide9b: #cdf3bc; --bar9: #6ab42f; --warn9: #fdc6b9; --ring9: #ef4e41;
  --r-sm: 16px; --r-md: 24px; --r-lg: 44px;
  --shadow: inset 0 2px 0 rgba(255,255,255,.62), 0 3px 8px rgba(69,41,22,.20);
  --font: 'Nunito', var(--font-intl, 'Nunito'), 'Arial Rounded MT Bold', sans-serif;
  --font-clock: 'Baloo 2', 'Nunito', var(--font-intl, 'Nunito'), sans-serif;
  --k: 1;
  font-synthesis: none;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-weight: 800; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.hidden { display: none !important; }
svg { display: block; }
#bg { position: fixed; inset: 0; background: var(--bg) url(../assets/img/backdrop_v.webp) center/cover; opacity: 0; transition: opacity .4s; }
body.ingame #bg { opacity: 1; }
@media (orientation: landscape) { #bg { background-image: url(../assets/img/backdrop_h.webp); } }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .3s; }
body.ingame #game { opacity: 1; }

/* ---------- fixed-art screens: 941 x 1672 design canvas scaled to fit ---------- */
.screen { position: fixed; inset: 0; z-index: 5; background: var(--bg); overflow: hidden; }
.screen .stage { position: absolute; left: 50%; top: 50%; width: 941px; height: 1672px; margin: -836px 0 0 -470.5px; transform-origin: 50% 50%; transform: scale(var(--s, .5)); }
.stage > * { position: absolute; }
#results.screen { background: var(--surface); }

/* lobby 06 */
.profile { left: 32px; top: 16px; display: flex; align-items: center; gap: 18px; text-align: start; }
.profile .ava { width: 126px; height: 118px; border-radius: 31px; background: #f0e6c9; border: 3px solid #b99a63; object-fit: cover; object-position: 50% 30%; box-shadow: var(--shadow); }
.pname b { display: block; font-size: 38px; font-weight: 1000; letter-spacing: -.5px; line-height: 1.05; max-width: 300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pname i { display: block; font-style: normal; font-size: 30px; font-weight: 750; color: var(--muted); }
.wallet { right: 140px; top: 28px; width: 234px; height: 74px; border-radius: 37px; background: var(--pill2); border: 3px solid #c9a37a; display: flex; align-items: center; gap: 14px; padding: 0 24px; box-shadow: var(--shadow); }
.wallet img { width: 46px; height: 46px; object-fit: contain; }
.wallet b { font-size: 38px; font-weight: 1000; flex: 1; text-align: center; }
.sq { width: 82px; height: 78px; border-radius: 24px; background: var(--pill2); border: 3px solid #b48c66; color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow); }
.sq svg { width: 46px; height: 46px; }
.gear { right: 32px; top: 26px; }
.trophy { right: 32px; top: 120px; }
.hero { left: 0; top: 334px; width: 941px; height: auto; pointer-events: none; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.logo { left: 0; right: 0; top: 117px; margin: 0; text-align: center; color: var(--logo); font-size: 130px; font-weight: 1000; line-height: .9; letter-spacing: -2px; text-transform: uppercase; }
.logo span { display: block; }
.sparks { width: 60px; height: 100px; top: 205px; }
.sparks.l { left: 190px; transform: scaleX(-1); } .sparks.r { right: 190px; }
.tagline { left: 50%; transform: translateX(-50%); top: 366px; min-width: 445px; padding: 6px 26px; border-radius: 24px; background: var(--pill); font-size: 24px; font-weight: 1000; white-space: nowrap; text-align: center; }
.online { left: 50%; transform: translateX(-50%); top: 1002px; height: 52px; padding: 0 30px; border-radius: 26px; background: #f8ead2; display: flex; align-items: center; gap: 14px; font-size: 27px; font-weight: 850; white-space: nowrap; box-shadow: var(--shadow); }
.online i { width: 20px; height: 20px; border-radius: 50%; background: var(--success); }
.party { left: 32px; top: 1105px; width: 876px; height: 181px; border-radius: 32px; background: var(--surface); border: 3px solid #ecdcc6; padding: 14px 30px; }
.phead { display: flex; justify-content: space-between; font-size: 38px; font-weight: 1000; letter-spacing: -.5px; }
.slots { display: flex; gap: 13px; margin-top: 14px; margin-inline-start: -4px; }
.slot { width: 90px; height: 92px; border-radius: 24px; border: 3px solid #e0cdb5; display: grid; place-items: center; font-size: 50px; color: #8a6a4e; font-weight: 700; overflow: hidden; background: #fdf7ee; }
.slot.me { border-color: var(--primary); background: #eef2d8; }
.slot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.cta { left: 32px; top: 1318px; width: 877px; height: 148px; border-radius: 45px; background: linear-gradient(#78b031, var(--primary) 55%, #5b8b20); color: #fff; display: flex; align-items: center; justify-content: center; gap: 56px; box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 6px 0 #4f7a1c, 0 10px 18px rgba(69,41,22,.18); }
.cta:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 2px 0 #4f7a1c; }
.cta svg { width: 70px; height: 76px; }
.cta span b { display: block; font-size: 76px; font-weight: 1000; line-height: .95; text-transform: uppercase; }
.cta span i { display: block; font-style: normal; font-size: 30px; font-weight: 850; }
.sec { top: 1490px; width: 425px; height: 103px; border-radius: 34px; border: 3px solid var(--sec-border); background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 26px; font-size: 36px; font-weight: 1000; color: var(--text); }
.sec svg { width: 52px; height: 52px; }
.sec.rooms { left: 32px; } .sec.invite { right: 32px; }
.tip { left: 0; right: 0; top: 1606px; text-align: center; font-size: 30px; font-weight: 750; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 18px; }
.langbtn { display: inline-flex; align-items: center; gap: 8px; height: 58px; padding: 0 24px; border-radius: 29px; border: 3px solid var(--sec-border); background: var(--surface); font-family: var(--font); font-size: 28px; font-weight: 900; color: var(--text); white-space: nowrap; }
.langbtn:active { transform: translateY(2px); }

/* waiting room */
.wtop { left: 32px; right: 32px; top: 24px; display: flex; gap: 24px; align-items: center; }
.wtop .sq { position: static; }
.wtitle b { display: block; font-size: 52px; font-weight: 1000; } .wtitle i { font-style: normal; font-size: 30px; color: var(--muted); font-weight: 750; }
.hero.small { top: 150px; transform: scale(.8); transform-origin: 50% 0; }
.party.big { top: 760px; height: auto; min-height: 420px; }
.wlist { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 16px; }
.wp { display: flex; align-items: center; gap: 14px; height: 76px; padding: 0 12px; border-radius: 24px; border: 3px solid #e7d6bf; font-size: 30px; font-weight: 900; overflow: hidden; white-space: nowrap; }
.wp img { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; object-position: 50% 30%; flex: none; }
.wp.me { border-color: var(--primary); background: #eef2d8; }
.wp.empty { color: #b5967a; justify-content: center; border-style: dashed; }
.wp .cc { font-size: 20px; color: var(--muted); margin-inline-start: auto; }
.wp .nm { overflow: hidden; text-overflow: ellipsis; }
.wrow { left: 32px; right: 32px; top: 1220px; display: flex; gap: 26px; }
.wrow .sec { position: static; width: 0; flex: 1; font-size: 30px; gap: 14px; }
.wrow .sec b { color: var(--primary); }
#waiting .cta { top: 1370px; }

/* ---------- HUD (k = scale vs design 941 wide portrait / 941 tall landscape) ---------- */
#hud { position: fixed; inset: 0; z-index: 4; pointer-events: none; font-size: calc(25px * var(--k)); }
#hud > *, #hud .ctrl > * { position: absolute; }
#hud button, #hud .joy, #hud .ctrl { pointer-events: auto; }
#hud .ctrl { inset: auto 0 0 0; height: 0; pointer-events: none; }
.card { background: var(--hud); border-radius: calc(24px * var(--k)); box-shadow: var(--shadow); }
.h-title { top: calc(16px * var(--k)); left: 0; right: 0; text-align: center; font-size: calc(40px * var(--k)); font-weight: 1000; color: var(--text); text-transform: uppercase; text-shadow: 0 2px 0 rgba(255,255,255,.5); }
.h-seeds { left: calc(33px * var(--k)); top: calc(95px * var(--k)); width: calc(256px * var(--k)); height: calc(78px * var(--k)); border-radius: calc(39px * var(--k)); background: var(--hud); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; gap: calc(12px * var(--k)); }
.h-seeds img { width: calc(48px * var(--k)); } .h-seeds b { font-size: calc(46px * var(--k)); font-weight: 1000; }
.h-running { left: calc(60px * var(--k)); top: calc(182px * var(--k)); font-size: calc(28px * var(--k)); font-weight: 1000; color: #4f7f22; }
.h-timer { left: 50%; transform: translateX(-50%); top: calc(79px * var(--k)); width: calc(308px * var(--k)); height: calc(126px * var(--k)); border-radius: calc(46px * var(--k)); background: var(--hud); box-shadow: var(--shadow); text-align: center; }
.h-timer i { display: block; font-style: normal; font-size: calc(25px * var(--k)); font-weight: 1000; margin-top: calc(10px * var(--k)); }
.h-timer b { display: block; font-family: var(--font-clock); font-size: calc(88px * var(--k)); font-weight: 800; line-height: .9; font-variant-numeric: tabular-nums; }
.h-timer.low b { color: var(--danger); }
.h-pause { right: calc(33px * var(--k)); top: calc(95px * var(--k)); width: calc(78px * var(--k)); height: calc(77px * var(--k)); border-radius: calc(24px * var(--k)); border: 0; background: var(--hud); }
.h-pause svg, .h-sound svg, .h-gear svg { width: 60%; height: 60%; fill: var(--text); }
.h-sound, .h-gear, .h-logo, .h-gold, .h-left, .h-aim, .ctrl .jlabel, .hide .l2, .h-team .tt2 { display: none; }
.h-team { left: calc(7px * var(--k)); top: calc(250px * var(--k)); width: calc(151px * var(--k)); padding: calc(14px * var(--k)) calc(8px * var(--k)); border-radius: calc(24px * var(--k)); background: var(--team); box-shadow: var(--shadow); }
.h-team > b { display: block; text-align: center; font-size: calc(22px * var(--k)); font-weight: 1000; margin-bottom: calc(8px * var(--k)); }
.tm { display: flex; align-items: center; gap: calc(8px * var(--k)); height: calc(54px * var(--k)); padding: 0 calc(8px * var(--k)); border-radius: calc(27px * var(--k)); font-size: calc(24px * var(--k)); font-weight: 900; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.tm svg { width: calc(34px * var(--k)); height: calc(34px * var(--k)); flex: none; color: #5a8f25; }
.tm .nm { overflow: hidden; text-overflow: ellipsis; }
.tm.m { color: var(--danger); border-bottom: 2px solid #e2cfb6; border-radius: 0; margin-bottom: calc(6px * var(--k)); } .tm.m svg { color: var(--text); }
.tm.you { background: #dce8c0; color: #3d6b16; }
.tm.out { color: #aaa197; } .tm.out svg { color: #bdb5aa; } .tm.out small { display: block; font-size: calc(16px * var(--k)); }
.tm.hid svg { opacity: .55; }
.tm .dot { width: calc(14px * var(--k)); height: calc(14px * var(--k)); border-radius: 50%; background: var(--success); flex: none; display: none; }
.h-warn { left: 0; top: 0; padding: calc(10px * var(--k)) calc(24px * var(--k)); border-radius: calc(30px * var(--k)); background: var(--danger); color: #fff; font-size: calc(32px * var(--k)); font-weight: 1000; text-transform: uppercase; white-space: nowrap; transform: translate(-50%, -50%); opacity: 0; transition: opacity .15s; }
.h-warn.on { opacity: 1; animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: translate(-50%, -50%) scale(1.06); } }
#labels { inset: 0; }
.lbl { position: absolute; left: 0; top: 0; padding: calc(3px * var(--k)) calc(12px * var(--k)); border-radius: calc(14px * var(--k)); background: rgba(253,247,238,.92); font-size: calc(22px * var(--k)); font-weight: 1000; text-transform: uppercase; white-space: nowrap; will-change: transform; color: var(--text); }
.lbl.you { background: #4f8a1f; color: #fff; }
.lbl.you::after { content: ''; position: absolute; left: 50%; bottom: calc(-12px * var(--k)); margin-left: calc(-10px * var(--k)); border: calc(10px * var(--k)) solid transparent; border-top-color: #4f8a1f; border-bottom: 0; }
.lbl.m { background: var(--danger); color: #fff; }
.lbl.gone { display: none; }
/* controls (portrait 07) */
.joy { left: calc(38px * var(--k)); bottom: calc(56px * var(--k)); width: calc(264px * var(--k)); height: calc(264px * var(--k)); border-radius: 50%; background: rgba(250,237,221,.82); border: calc(6px * var(--k)) solid #fdf5ea; box-shadow: var(--shadow); touch-action: none; }
.joy .ring { position: absolute; inset: 24%; border-radius: 50%; border: calc(4px * var(--k)) solid rgba(165,102,56,.35); }
.joy .knob { position: absolute; left: 50%; top: 50%; width: calc(92px * var(--k)); height: calc(92px * var(--k)); margin: calc(-46px * var(--k)); border-radius: 50%; background: radial-gradient(circle at 40% 35%, #5fae31, #3f861d 70%); box-shadow: 0 calc(5px * var(--k)) calc(8px * var(--k)) rgba(40,60,10,.35); }
.joy > b { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-size: calc(28px * var(--k)); font-weight: 1000; }
.joy .arrows { position: absolute; inset: 6%; fill: #2f5d14; display: none; }
.dash { right: calc(300px * var(--k)); bottom: calc(220px * var(--k)); width: calc(142px * var(--k)); height: calc(142px * var(--k)); border-radius: 50%; background: var(--hud); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: calc(28px * var(--k)); font-weight: 1000; overflow: hidden; }
.dash svg { width: 56%; height: auto; }
.dash .cd { position: absolute; inset: 0; background: rgba(69,41,22,.28); transform-origin: 50% 100%; transform: scaleY(0); }
.hide { right: calc(44px * var(--k)); bottom: calc(52px * var(--k)); width: calc(267px * var(--k)); height: calc(267px * var(--k)); border-radius: 50%; background: var(--hide); border: calc(7px * var(--k)) solid #fbf3e3; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 calc(6px * var(--k)) calc(14px * var(--k)) rgba(40,60,10,.3); touch-action: none; }
.hide svg { width: 46%; color: #fff; }
.hide > b { font-size: calc(50px * var(--k)); font-weight: 1000; line-height: 1; text-transform: uppercase; }
.hide > i { font-style: normal; font-size: calc(28px * var(--k)); font-weight: 900; }
.hide.dim { filter: saturate(.4) brightness(.92); }
.hide.on { transform: scale(.94); background: #4e7e1e; }
.hide .air { position: absolute; inset: calc(-14px * var(--k)); width: auto; height: auto; transform: rotate(-90deg); pointer-events: none; }
.hide .air circle { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 100 100; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.near { right: calc(320px * var(--k)); bottom: calc(80px * var(--k)); height: calc(62px * var(--k)); padding: 0 calc(18px * var(--k)); border-radius: calc(18px * var(--k)); background: var(--hud9); border: calc(3px * var(--k)) solid var(--ink9); display: none; align-items: center; gap: calc(10px * var(--k)); font-size: calc(26px * var(--k)); font-weight: 1000; color: var(--ink9); white-space: nowrap; }
.near img { width: calc(54px * var(--k)); }
.near.on { display: flex; }
.near.taken { border-color: var(--danger); color: var(--danger); }
.h-tip { left: 50%; transform: translateX(-50%); bottom: calc(22px * var(--k)); height: calc(58px * var(--k)); padding: 0 calc(30px * var(--k)); border-radius: calc(29px * var(--k)); background: var(--hud); display: flex; align-items: center; font-size: calc(26px * var(--k)); font-weight: 900; white-space: nowrap; box-shadow: var(--shadow); }
.ctrl.mallet { display: none; }
#hud.role-m .ctrl.radish { display: none; } #hud.role-m .ctrl.mallet { display: block; }
.smashhint { left: 50%; bottom: calc(120px * var(--k)); transform: translateX(-50%); display: flex; align-items: center; gap: calc(14px * var(--k)); padding: calc(12px * var(--k)) calc(26px * var(--k)); border-radius: calc(36px * var(--k)); background: var(--warn9); color: var(--danger); font-size: calc(30px * var(--k)); font-weight: 1000; white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; }
.smashhint img { width: calc(52px * var(--k)); }
.mcd { width: calc(44px * var(--k)); height: calc(44px * var(--k)); transform: rotate(-90deg); }
.mcd circle { fill: none; stroke: var(--danger); stroke-width: 5; stroke-dasharray: 100 100; }
.banner { left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.6); padding: calc(18px * var(--k)) calc(44px * var(--k)); border-radius: calc(44px * var(--k)); background: var(--surface); border: calc(4px * var(--k)) solid var(--primary); font-size: calc(54px * var(--k)); font-weight: 1000; text-align: center; white-space: nowrap; opacity: 0; transition: all .25s cubic-bezier(.3,1.6,.5,1); color: var(--ink9); text-transform: uppercase; }
.banner small { display: block; font-size: .5em; color: var(--muted); }
.banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner.red { border-color: var(--danger); color: var(--danger); }
.toast { left: 50%; top: 24%; transform: translateX(-50%); font-size: calc(44px * var(--k)); font-weight: 1000; color: #fff; text-shadow: 0 3px 0 var(--text), 0 0 12px rgba(69,41,22,.4); opacity: 0; white-space: nowrap; }
.toast.on { animation: toast 1.1s ease-out; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30px); } }

/* ---------- landscape HUD (design 09) ---------- */
@media (orientation: landscape) {
  .h-title, .h-seeds, .h-running, .h-pause, .h-timer i, .ctrl .dash > b { display: none; }
  .h-logo, .h-gold, .h-sound, .h-gear, .h-left { display: flex; }
  .h-logo { left: calc(22px * var(--k)); top: calc(20px * var(--k)); width: calc(402px * var(--k)); height: calc(93px * var(--k)); border-radius: calc(28px * var(--k)); background: var(--hud9); box-shadow: var(--shadow); align-items: center; gap: calc(14px * var(--k)); padding: 0 calc(20px * var(--k)); color: var(--ink9); }
  .h-logo img { width: calc(70px * var(--k)); }
  .h-logo b { display: block; font-size: calc(40px * var(--k)); font-weight: 1000; line-height: 1.05; text-transform: uppercase; white-space: nowrap; }
  .h-logo i { display: block; font-style: normal; font-size: calc(25px * var(--k)); font-weight: 1000; }
  .h-timer { top: calc(18px * var(--k)); width: calc(215px * var(--k)); height: calc(60px * var(--k)); border-radius: calc(30px * var(--k)); background: var(--hud9); }
  .h-timer b { font-size: calc(58px * var(--k)); line-height: 1.05; color: var(--ink9); }
  .h-left { left: 50%; transform: translateX(-50%); top: calc(88px * var(--k)); height: calc(46px * var(--k)); padding: 0 calc(22px * var(--k)); border-radius: calc(23px * var(--k)); background: var(--hud9); box-shadow: var(--shadow); align-items: center; font-size: calc(25px * var(--k)); font-weight: 1000; color: var(--ink9); white-space: nowrap; }
  .h-sound { right: calc(130px * var(--k)); top: calc(20px * var(--k)); width: calc(87px * var(--k)); height: calc(70px * var(--k)); border: 0; background: var(--hud9); }
  .h-gear { right: calc(22px * var(--k)); top: calc(20px * var(--k)); width: calc(87px * var(--k)); height: calc(70px * var(--k)); border: 0; background: var(--hud9); }
  .h-gear svg { fill: none; color: var(--ink9); }
  .h-gold { right: calc(22px * var(--k)); top: calc(140px * var(--k)); width: calc(269px * var(--k)); height: calc(146px * var(--k)); border-radius: calc(24px * var(--k)); background: var(--hud9); box-shadow: var(--shadow); flex-direction: column; align-items: center; justify-content: center; color: var(--ink9); gap: calc(4px * var(--k)); }
  .h-gold > i { font-style: normal; font-size: calc(25px * var(--k)); font-weight: 1000; }
  .h-gold div { display: flex; align-items: center; gap: calc(12px * var(--k)); }
  .h-gold img { width: calc(52px * var(--k)); } .h-gold b { font-size: calc(50px * var(--k)); font-weight: 1000; line-height: 1; }
  .h-gold .bar { width: 85%; height: calc(20px * var(--k)); border-radius: calc(10px * var(--k)); background: #e8dcc0; overflow: hidden; }
  .h-gold .bar span { display: block; height: 100%; width: 0; background: var(--bar9); border-radius: inherit; transition: width .3s; }
  .h-aim { right: calc(22px * var(--k)); top: calc(300px * var(--k)); width: calc(269px * var(--k)); height: calc(63px * var(--k)); border-radius: calc(20px * var(--k)); background: var(--warn9); align-items: center; justify-content: center; gap: calc(10px * var(--k)); font-size: calc(25px * var(--k)); font-weight: 1000; color: #7b2416; white-space: nowrap; box-shadow: var(--shadow); }
  .h-aim.on { display: flex; }
  .h-warn { display: none; }
  .h-team { left: calc(22px * var(--k)); top: calc(140px * var(--k)); width: calc(202px * var(--k)); background: var(--team9); color: var(--ink9); }
  .h-team .tt1 { display: none; } .h-team .tt2 { display: block; font-size: calc(25px * var(--k)); text-align: start; padding-inline-start: calc(14px * var(--k)); }
  .tm { height: calc(46px * var(--k)); } .tm .dot { display: block; } .tm.you { background: transparent; color: var(--ink9); }
  .tm.out .dot { background: #b9b1a4; }
  .joy { left: calc(42px * var(--k)); bottom: calc(40px * var(--k)); width: calc(256px * var(--k)); height: calc(256px * var(--k)); }
  .joy > b { display: none; } .joy .arrows { display: block; } .joy .ring { display: none; }
  .joy .knob { width: calc(104px * var(--k)); height: calc(104px * var(--k)); margin: calc(-52px * var(--k)); background: #2f6a26; }
  .ctrl .jlabel { display: block; left: calc(82px * var(--k)); bottom: calc(300px * var(--k)); padding: calc(4px * var(--k)) calc(24px * var(--k)); border-radius: calc(20px * var(--k)); background: var(--hud9); font-size: calc(25px * var(--k)); font-weight: 1000; color: var(--ink9); }
  .hide { right: calc(26px * var(--k)); bottom: calc(40px * var(--k)); width: calc(259px * var(--k)); height: calc(259px * var(--k)); background: var(--hide9); border-color: var(--hide9b); }
  .hide > b, .hide > i { display: none; } .hide .l2 { display: block; font-size: calc(28px * var(--k)); font-weight: 1000; text-align: center; line-height: 1.05; max-width: 80%; }
  .dash { right: calc(300px * var(--k)); bottom: calc(190px * var(--k)); width: calc(110px * var(--k)); height: calc(110px * var(--k)); }
  .near { right: calc(300px * var(--k)); bottom: calc(60px * var(--k)); }
  .h-tip { bottom: calc(26px * var(--k)); height: calc(62px * var(--k)); background: var(--hud9); color: var(--ink9); font-size: calc(30px * var(--k)); }
}

/* ---------- results 08 ---------- */
.rbrand { left: 40px; top: 10px; display: flex; align-items: center; gap: 14px; font-size: 40px; font-weight: 1000; color: var(--ink8); text-transform: uppercase; }
.rbrand img { width: 80px; }
.wallet.r { right: 30px; top: 22px; width: 212px; height: 64px; background: transparent; border: 3px solid var(--ring8); box-shadow: none; }
.rk { left: 0; right: 0; top: 108px; text-align: center; font-size: 26px; font-weight: 1000; letter-spacing: 4px; color: var(--grey8); }
.rtitle { left: 0; right: 0; top: 150px; margin: 0; text-align: center; font-size: 82px; font-weight: 1000; letter-spacing: -1px; color: var(--ink8); text-transform: uppercase; line-height: 1; white-space: nowrap; }
.rsub { left: 0; right: 0; top: 238px; text-align: center; font-size: 34px; font-weight: 700; color: var(--grey8); }
.hero.r { top: 285px; animation: none; }
.rbadge { left: 50%; transform: translateX(-50%); top: 738px; height: 54px; min-width: 316px; padding: 0 28px; border-radius: 27px; background: var(--badge8); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 1000; letter-spacing: 2px; color: var(--ink8); white-space: nowrap; }
.rstats { left: 40px; right: 40px; top: 815px; display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 2px solid #e1ddd2; padding-bottom: 20px; }
.rstats div { text-align: center; } .rstats div + div { border-inline-start: 2px solid #dcd8cc; }
.rstats i { display: block; font-style: normal; font-size: 26px; letter-spacing: 2px; color: var(--grey8); font-weight: 1000; }
.rstats b { display: block; font-size: 66px; font-weight: 1000; color: var(--ink8); line-height: 1.1; }
.rrew { left: 40px; right: 40px; top: 950px; }
.rrew h3, .uph { margin: 0 0 6px; font-size: 40px; font-weight: 1000; color: var(--ink8); letter-spacing: -.6px; }
.rrow { display: flex; align-items: center; gap: 30px; height: 66px; font-size: 32px; font-weight: 750; color: var(--ink8); border-bottom: 2px solid #e8e4d9; padding: 0 22px; }
.rrow:last-child { border: 0; } .rrow img { width: 70px; } .rrow b { margin-inline-start: auto; font-size: 38px; font-weight: 1000; }
.xp { left: 32px; top: 1150px; width: 877px; height: 62px; border-radius: 20px; background: var(--xp8); display: flex; align-items: center; gap: 30px; padding: 0 32px; color: var(--ink8); font-size: 30px; }
.xp b { font-weight: 1000; white-space: nowrap; } .xp i { font-style: normal; font-weight: 750; white-space: nowrap; }
.xp .bar { flex: 1; height: 22px; border-radius: 11px; background: #cfd6b5; overflow: hidden; } .xp .bar span { display: block; height: 100%; background: var(--cta8); border-radius: inherit; width: 0; transition: width 1s ease-out; }
.uph { left: 40px; top: 1232px; }
.ups { left: 36px; top: 1296px; width: 868px; height: 191px; border-radius: 24px; border: 3px solid #e3e0d6; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.up { position: relative; padding: 18px 20px; display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto auto 1fr; column-gap: 20px; color: var(--ink8); }
.up + .up { border-inline-start: 2px solid #e3e0d6; }
.up > img { grid-row: 1 / 3; width: 120px; } .up > b { font-size: 32px; font-weight: 1000; } .up > i { font-style: normal; font-size: 28px; color: #8a8478; font-weight: 750; }
.buy { grid-column: 1 / 3; margin-top: 10px; height: 58px; border-radius: 16px; border: 3px solid #8b8a86; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 28px; font-weight: 1000; color: var(--ink8); }
.buy.green { border-color: var(--cta8); } .buy.green span { color: #3e6d1c; }
.buy img { width: 44px; } .buy b { padding-inline-end: 14px; border-inline-end: 2px solid #ccc; }
.buy:disabled { opacity: .5; }
.ractions { left: 36px; right: 36px; top: 1500px; display: flex; gap: 14px; justify-content: center; }
.mini { height: 0; display: none; }
.ractions .mini { display: flex; height: 0; }
.cta.r { top: 1516px; left: 28px; width: 886px; height: 91px; border-radius: 28px; background: var(--cta8); box-shadow: 0 4px 0 #557a3a; gap: 0; }
.cta.r b { font-size: 50px; color: var(--surface); }
.back2 { left: 0; right: 0; top: 1616px; text-align: center; font-size: 34px; font-weight: 700; color: var(--grey8); }
/* replay/clip/double: compact chips placed over results hero corner */
.ractions { top: 300px; left: auto; right: 28px; flex-direction: column; gap: 10px; }
.ractions .mini { height: 56px; padding: 0 20px; border-radius: 28px; background: rgba(253,247,238,.94); border: 2px solid var(--ring8); align-items: center; gap: 10px; font-size: 24px; font-weight: 1000; color: var(--ink8); box-shadow: var(--shadow); }
.ractions .mini svg { width: 30px; height: 30px; } .ractions .mini img { width: 34px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(69,41,22,.38); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 28px; border: 3px solid #ecdcc6; box-shadow: 0 10px 30px rgba(69,41,22,.25); overflow: hidden; }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 22px; font-size: 26px; font-weight: 1000; border-bottom: 2px solid #efe2cf; }
.mhead .sq { position: static; width: 46px; height: 44px; border-radius: 14px; }
.mhead .sq svg { width: 26px; height: 26px; stroke: var(--text); stroke-width: 5; stroke-linecap: round; }
.mbody { overflow: auto; padding: 14px 18px 20px; font-size: 17px; font-weight: 750; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 2px solid #f1e6d6; }
.row:last-child { border: 0; }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row img.av { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; object-position: 50% 30%; background: #f0e6c9; }
.row .rk { position: static; width: 34px; text-align: center; font-weight: 1000; color: var(--muted); letter-spacing: 0; font-size: 18px; }
.row.me { background: #eef2d8; border-radius: 14px; }
.btn { height: 46px; padding: 0 18px; border-radius: 16px; border: 3px solid var(--sec-border); background: var(--surface); font-weight: 1000; font-size: 17px; white-space: nowrap; }
.btn.go { background: var(--primary); border-color: #4f7a1c; color: #fff; }
.btn:disabled { opacity: .45; }
.field { width: 100%; height: 50px; border-radius: 16px; border: 3px solid #d9c4a8; background: #fff; padding: 0 14px; font: inherit; font-size: 20px; color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.item { border: 3px solid #e7d6bf; border-radius: 20px; padding: 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.item.eq { border-color: var(--primary); background: #eef2d8; }
.item .sw { width: 64px; height: 64px; border-radius: 50%; box-shadow: var(--shadow); }
.howto { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.howto div { border-radius: 20px; background: #fef6e2; border: 3px solid #fff; box-shadow: var(--shadow); padding: 12px; }
.howto b { display: block; color: #2e5204; font-size: 18px; font-weight: 1000; } .howto span { font-size: 15px; }
.howto em { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #477916; color: #fff; font-style: normal; font-weight: 1000; margin-inline-end: 6px; }
.note { margin-top: 10px; padding: 10px 14px; border-radius: 16px; background: #eef2d8; color: #2e5204; font-size: 15px; }
.avs { display: flex; flex-wrap: wrap; gap: 8px; } .avs button { width: 56px; height: 56px; border-radius: 16px; border: 3px solid #e7d6bf; overflow: hidden; background: #f6ecd9; } .avs button.on { border-color: var(--primary); }
.avs img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* VDS language popup restyled to match the design */
#vds-lang-pop { background: rgba(69,41,22,.38) !important; font-family: var(--font) !important; }
#vds-lang-pop > div { background: var(--surface) !important; color: var(--text) !important; border: 3px solid #ecdcc6; border-radius: 28px !important; }
#vds-lang-pop button { background: #fdf7ee !important; color: var(--text) !important; border: 3px solid #e7d6bf !important; border-radius: 16px !important; font-weight: 900; font-family: var(--font) !important; }
#vds-lang-pop button[style*="#6366f1"] { background: var(--primary) !important; color: #fff !important; border-color: #4f7a1c !important; }
[dir=rtl] .hide .air, [dir=rtl] .mcd { transform: rotate(-90deg) scaleY(-1); }
/* numbers stay left-to-right inside RTL layouts */
.h-seeds b, .h-gold b, .h-timer b, .h-running, .rstats b, .wallet b, #partyN, .xp i, .rrow b, .buy b, #wTimer { direction: ltr; unicode-bidi: isolate; }
#hud.role-m .h-tip { display: none; }
.h-team .tt2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud.replay .ctrl, #hud.replay .h-tip { visibility: hidden; }

.h-warn { z-index: 2; }
.h-aim img { width: calc(40px * var(--k)); height: auto; flex: none; } .h-aim span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ?fps diagnostic bar (device-fps.mjs): dev-only, symbols + units only; sits at the right edge, clear of joystick/HUD panels */
.fpsdiag { position: fixed; z-index: 45; right: calc(6px + env(safe-area-inset-right, 0px)); top: 30%; width: 204px; display: flex; flex-direction: column; gap: 4px; padding: 5px 6px; border-radius: 14px; border: 2px solid var(--sec-border); background: var(--surface); color: var(--text); font-family: var(--font); font-size: 11px; font-weight: 900; box-shadow: var(--shadow); opacity: .9; }
.fpsdiag-row { display: flex; align-items: center; gap: 4px; }
.fpsdiag-name { flex: 1 1 auto; min-width: 0; height: 26px; padding: 0 7px; border-radius: 10px; border: 2px solid #d9c4a8; background: #fff; font: inherit; color: var(--text); user-select: text; -webkit-user-select: text; touch-action: manipulation; }
.fpsdiag-name:disabled { opacity: .6; }
.fpsdiag-btn { flex: none; height: 26px; min-width: 32px; padding: 0 7px; border-radius: 13px; border: 2px solid var(--sec-border); background: var(--surface); font-family: var(--font); font-size: 12px; font-weight: 1000; color: var(--text); white-space: nowrap; touch-action: manipulation; }
.fpsdiag-btn:active { transform: translateY(2px); }
.fpsdiag-slot { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 9px; background: var(--secondary); font-variant-numeric: tabular-nums; }
.fpsdiag-slot[data-ok="1"] { color: var(--primary); }
.fpsdiag-slot::before, .fpsdiag-live[data-o="portrait"]::before, .fpsdiag-live[data-o="landscape"]::before { content: ''; flex: none; width: 6px; height: 10px; border: 2px solid currentColor; border-radius: 2px; }
.fpsdiag-slot[data-o="landscape"]::before, .fpsdiag-live[data-o="landscape"]::before { width: 10px; height: 6px; }
.fpsdiag-live { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.fpsdiag[data-state="run"] { border-color: var(--primary); }
.fpsdiag[data-state="bad"] { border-color: var(--danger); } .fpsdiag[data-state="bad"] .fpsdiag-live { color: var(--danger); }
.fpsdiag-out { width: 100%; height: 80px; resize: none; border-radius: 10px; border: 2px solid #d9c4a8; background: #fff; color: var(--text); font: 10px/1.3 ui-monospace, monospace; user-select: text; -webkit-user-select: text; }
.fpsdiag-out[hidden] { display: none; }

/* --- review fixes 03/12 --- */
/* lobby: logo/sparks must not swallow taps on the trophy (leaderboard) and other corner buttons */
.logo, .sparks, .tagline, .hero { pointer-events: none; }
.profile, .wallet, .sq { z-index: 3; }
/* results: 3-4 reward lines are laid out two-up inside the fixed 190px slot above the XP bar */
#rRows { max-height: 140px; }
#rRows.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
#rRows.two .rrow { gap: 14px; padding: 0 12px; font-size: 27px; border-bottom: 2px solid #e8e4d9; min-width: 0; }
#rRows.two .rrow:nth-last-child(-n+2):nth-child(odd), #rRows.two .rrow:last-child { border-bottom: 0; }
#rRows.two .rrow img { width: 54px; }
#rRows.two .rrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#rRows.two .rrow b { font-size: 32px; }
/* settings: quit-match button (landscape HUD has no pause button) */
.btn.danger { background: #fdf7ee; border-color: #c4553a; color: #b2452c; }
/* HUD: floating name tags pass under every HUD panel (timer, counters, player list, controls) */
#hud > * { z-index: 1; } #hud > #labels { z-index: 0; } #hud > .h-warn { z-index: 2; }

/* ---- shop: rendered item thumbnails + real-money packs ---- */
.item .thumb { width: 64px; height: 64px; display: grid; place-items: center; }
.item .thumb img { width: 64px; height: 64px; object-fit: contain; display: block; }
.paybox { margin-top: 14px; border: 3px solid #e7d6bf; border-radius: 20px; padding: 4px 12px 2px; background: var(--surface); }
.payhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 2px solid #f1e6d6; font-size: 19px; font-weight: 1000; color: var(--text); }
.payhead small { flex: none; font-size: 14px; font-weight: 900; color: var(--muted); border: 2px solid #e7d6bf; border-radius: 12px; padding: 2px 10px; white-space: nowrap; }
.row.pack { padding: 8px 2px; }
.row.pack img { width: 44px; height: 44px; flex: none; object-fit: contain; }
.row.pack .grow b { display: block; font-size: 17px; font-weight: 1000; overflow: hidden; text-overflow: ellipsis; }
.row.pack .grow small { display: block; font-size: 14px; font-weight: 750; color: var(--muted); white-space: normal; }
.row.pack .btn { flex: none; min-width: 96px; }
.mbody .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.item .btn { max-width: 100%; height: auto; min-height: 46px; padding: 6px 12px; white-space: normal; line-height: 1.15; }
.row.pack .grow { white-space: normal; }
