@font-face { font-family: 'Margarine'; src: url(../fonts/Margarine.woff2) format('woff2'); font-display: block; }

:root {
  --font: 'Margarine', 'Trebuchet MS', sans-serif;
  --clay: none; /* set at runtime to a generated clay bump texture */
  --purple: #5b5277; --purple-hi: #6d6491;
  --green: #6c9a2c; --green-hi: #84b43a;
  --teal: #33b88f; --teal-hi: #4fd6a8;
  --salmon: #d27966; --brown: #91503b; --gray: #6a6670; --red: #b04838; --blue: #4767b8; --gold: #c99a2c;
  --title: #d6cfe6; --text: #f4f0f8; --dim: #a59fb8;
  --ui-scale: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--text); font-family: var(--font); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.42) 100%); }
#world-ui, #hud { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.35s; }
#fade.on { opacity: 1; }

#boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0d0b12; z-index: 50; transition: opacity 0.5s; }
#boot.gone { opacity: 0; pointer-events: none; }
.boot-title { font-size: 64px; color: #e9e4f3; text-shadow: 0 4px 12px #000; }
.boot-sub { margin-top: 12px; color: var(--dim); font-size: 20px; }

/* ---------- Clay surfaces ---------- */
.clay {
  background-color: var(--c, var(--purple));
  background-image: var(--clay);
  background-size: 220px 220px;
  background-blend-mode: overlay;
  box-shadow: inset 0 calc(6px * var(--ui-scale)) calc(10px * var(--ui-scale)) rgba(255, 255, 255, 0.22),
              inset 0 calc(-9px * var(--ui-scale)) calc(14px * var(--ui-scale)) rgba(0, 0, 0, 0.32),
              0 calc(8px * var(--ui-scale)) calc(16px * var(--ui-scale)) rgba(0, 0, 0, 0.5);
}
.c-purple { --c: var(--purple); }
.c-green { --c: var(--green); }
.c-teal { --c: var(--teal); }
.c-salmon { --c: var(--salmon); }
.c-brown { --c: var(--brown); }
.c-gray { --c: var(--gray); }
.c-red { --c: var(--red); }
.c-blue { --c: var(--blue); }
.c-gold { --c: var(--gold); }
.c-dark { --c: #2c2836; }

.panel {
  position: relative;
  border-radius: 70px 90px 80px 100px / 90px 70px 100px 80px;
  padding: 26px 40px 34px;
  color: var(--title);
}
.panel-title { text-align: center; font-size: 40px; color: var(--title); text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35); margin: 6px 0 18px; letter-spacing: 0.5px; }

.btn {
  font-family: var(--font); color: #f5f2fa; border: 0; cursor: pointer; outline: none;
  border-radius: 22px 28px 24px 30px / 28px 22px 30px 24px;
  padding: 10px 26px; font-size: 26px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s ease-out, filter 0.12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:hover, .btn.focus { filter: brightness(1.14) saturate(1.05); }
.btn:active { transform: scale(0.96); }
.btn.focus { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55), inset 0 6px 10px rgba(255, 255, 255, 0.22), inset 0 -9px 14px rgba(0, 0, 0, 0.32), 0 8px 16px rgba(0, 0, 0, 0.5); }
.btn.disabled { filter: grayscale(0.85) brightness(0.6); pointer-events: none; }
.btn small { display: block; font-size: 0.55em; opacity: 0.9; }
.btn.stack { flex-direction: column; gap: 0; line-height: 1; }

.back-btn { position: absolute; left: 34px; top: 30px; width: 58px; height: 48px; padding: 0; font-size: 34px; border-radius: 14px 18px 12px 16px; }
.back-btn svg { width: 30px; height: 30px; }

/* ---------- Screens ---------- */
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.screen.enter { animation: pop-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop-in { from { transform: scale(0.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.screen.leave { animation: pop-out 0.18s ease-in forwards; }
@keyframes pop-out { to { transform: scale(0.9); opacity: 0; } }

/* Main menu */
.main-menu { flex-direction: column; justify-content: flex-start; }
.logo { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); width: min(60vw, 820px); pointer-events: none; }
.logo canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.45)); }
.menu-row { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 22px; }
.menu-row .btn { font-size: 22px; height: 66px; padding: 0 22px; }
.menu-row .btn.big { font-size: 52px; height: 92px; min-width: 280px; border-radius: 34px 44px 36px 46px / 44px 34px 46px 36px; }
.menu-row .btn.icon { height: 92px; width: 92px; flex-direction: column; font-size: 24px; padding: 6px; gap: 0; }
.menu-row .btn.icon svg { width: 46px; height: 40px; }
.version { position: absolute; left: 50%; bottom: calc(17% - 26px); transform: translateX(-50%); font-size: 14px; color: rgba(255, 255, 255, 0.45); white-space: nowrap; }
.corner-btns { position: absolute; left: 18px; bottom: 16px; display: flex; gap: 12px; }
.corner-btns .btn { width: 58px; height: 58px; padding: 0; border-radius: 50%; }
.corner-btns svg { width: 30px; height: 30px; }

/* Play window */
.play-cards { display: flex; gap: 32px; justify-content: center; padding: 6px 30px 12px; }
.card { width: 230px; height: 200px; flex-direction: column; justify-content: flex-end; padding: 10px 10px 18px; border-radius: 30px 36px 28px 34px / 34px 28px 36px 30px; }
.card .label { font-size: 28px; }
.card .sub { font-size: 16px; opacity: 0.85; margin-top: 4px; }
.card .art { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; }

/* Co-op browser */
.coop { width: min(92vw, 1080px); max-height: 86vh; display: flex; flex-direction: column; }
.coop-scroll { overflow-y: auto; padding: 0 10px 8px; border-radius: 30px; background: rgba(0, 0, 0, 0.12); scrollbar-width: thin; }
.section-title { font-size: 26px; color: var(--title); margin: 16px 8px 10px; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3); }
.campaign-row { display: flex; gap: 18px; align-items: center; overflow-x: auto; padding: 4px 6px 12px; scrollbar-width: thin; }
.diff-col { display: flex; flex-direction: column; gap: 10px; }
.diff-col .btn { width: 104px; height: 52px; font-size: 24px; }
.level { width: 150px; min-width: 150px; height: 140px; flex-direction: column; justify-content: flex-start; padding: 8px 6px; border-radius: 22px 26px 20px 24px; font-size: 16px; gap: 4px; }
.level .thumb { width: 118px; height: 64px; border-radius: 16px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25); position: relative; }
.level .stars { font-size: 20px; letter-spacing: 2px; color: rgba(0, 0, 0, 0.35); }
.level .stars .on { color: #ffd23a; text-shadow: 0 1px 2px #000; }
.level.locked .thumb::after { content: '🔒'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; filter: grayscale(1); }
.level-grid { display: flex; flex-wrap: wrap; gap: 16px; padding: 4px 6px 14px; }

/* Playlist browser */
.playlists { display: flex; gap: 22px; padding: 4px 18px 10px; flex-wrap: wrap; justify-content: center; }
.playlist { width: 220px; height: 190px; flex-direction: column; justify-content: flex-start; padding: 12px; font-size: 20px; gap: 8px; border-radius: 26px 30px 24px 28px; }
.playlist .thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; width: 100%; }
.playlist .thumbs div { height: 40px; border-radius: 10px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25); }
.small-btn { font-size: 16px; padding: 6px 14px; border-radius: 10px; }

/* Playlist settings dialog */
.dialog { width: min(90vw, 560px); }
.dialog .row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0; font-size: 26px; color: #eef3e2; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35); }
.dialog .row .val { color: #9cf06a; min-width: 48px; text-align: center; }
.dialog .row .btn { width: 46px; height: 42px; padding: 0; font-size: 28px; }
.check { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; color: #ffcf3a; cursor: pointer; }
.dialog .thumbgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 10px; }
.dialog .thumbgrid div { height: 44px; border-radius: 10px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25); }
.close-btn { position: absolute; left: 24px; top: 22px; width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 26px; }
.wide-btn { display: flex; width: 100%; height: 76px; font-size: 44px; margin-top: 10px; border-radius: 34px 40px 32px 38px; }

/* Confirm / pause */
.pause { width: 320px; padding: 20px 26px 26px; display: flex; flex-direction: column; gap: 14px; }
.pause .name { text-align: center; color: var(--dim); font-size: 24px; margin-bottom: 2px; }
.pause .btn { height: 58px; font-size: 32px; }
.confirm { padding: 26px 34px 30px; text-align: center; }
.confirm .q { font-size: 32px; color: var(--text); margin-bottom: 20px; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35); }
.confirm .btns { display: flex; gap: 18px; justify-content: center; }
.confirm .btn { width: 160px; height: 60px; font-size: 32px; }

/* Settings */
.settings { width: min(92vw, 640px); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 10px 8px; font-size: 24px; color: var(--text); }
.set-row input[type=range] { width: 220px; accent-color: #84b43a; }
.seg { display: flex; gap: 8px; }
.seg .btn { font-size: 18px; padding: 6px 14px; }
.seg .btn.on { --c: var(--teal); }

/* Text pages (how to play / credits) */
.textpage { width: min(92vw, 900px); max-height: 86vh; display: flex; flex-direction: column; }
.textpage .body { overflow-y: auto; font-size: 21px; line-height: 1.45; color: #e8e3f2; padding: 0 16px 10px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.textpage h3 { color: #ffd76a; margin: 14px 0 4px; font-weight: normal; font-size: 26px; }

/* Join / lobby */
.lobby { position: absolute; inset: 0; background: #17141c; }
.lobby-bg { position: absolute; inset: 0; opacity: 0.22; background-repeat: no-repeat; background-position: center 58%; background-size: min(60vh, 560px); }
.lobby .prompt { position: absolute; left: 0; right: 0; top: 34px; text-align: center; font-size: 30px; color: #c7b8f0; text-shadow: 0 2px 3px #000; }
.lobby .upnext { position: absolute; left: 0; right: 0; top: 76px; text-align: center; font-size: 18px; color: #9e98ad; }
.lobby .title { position: absolute; left: 0; right: 0; top: 80px; text-align: center; font-size: 38px; color: #d8d2e4; text-shadow: 0 3px 4px #000; }
.lobby .slots { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.slot { display: flex; align-items: center; gap: 12px; font-size: 32px; }
.slot .icon { width: 50px; height: 50px; border-radius: 10px; background: #2b2734; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }
.slot .icon canvas { width: 50px; height: 50px; }
.slot .icon.pic { width: 58px; height: 58px; border-radius: 12px; background-size: cover; background-position: center; }
.slot .ready { font-size: 20px; color: #7dff6a; margin-left: 6px; }
.slot .arrows { font-size: 18px; color: #8d86a0; }
.slot .team { font-size: 18px; padding: 2px 10px; border-radius: 8px; }
.lobby .note { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 420px; text-align: center; font-size: 22px; color: #48e34b; text-shadow: 0 2px 3px #000; }
.lobby .more { position: absolute; left: 0; right: 0; bottom: 118px; text-align: center; font-size: 19px; color: #8f86a8; }
.lobby .tip { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); width: min(80vw, 760px); display: flex; gap: 16px; align-items: flex-start; font-size: 20px; color: #aaa3bb; }
.lobby .tip b { font-size: 30px; font-weight: normal; color: #b9b2c9; }
.lobby .lobby-btns { position: absolute; right: 30px; bottom: 30px; display: flex; gap: 12px; }
.lobby .lobby-btns .btn { font-size: 20px; padding: 8px 16px; }
.lobby .left-info { position: absolute; left: 70px; top: 150px; font-size: 22px; color: #e7e2ef; }

/* Controls guide (HUD + lobby) */
.controls-guide { position: absolute; right: 7%; top: 18%; width: 220px; text-align: center; color: #e5e1ee; font-size: 22px; text-shadow: 0 2px 3px #000; transition: opacity 0.6s; }
.controls-guide .diamond { position: relative; height: 170px; margin-top: 6px; }
.controls-guide .b { position: absolute; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 5px 6px rgba(255, 255, 255, 0.35), inset 0 -6px 8px rgba(0, 0, 0, 0.35), 0 3px 6px rgba(0, 0, 0, 0.5); }
.controls-guide .b svg { width: 34px; height: 34px; }
.controls-guide .k { position: absolute; font-size: 24px; }
.controls-guide .small { font-size: 15px; color: #d5d0e0; line-height: 1.35; }

/* ---------- HUD ---------- */
.hud-tl { position: absolute; left: 22px; top: 12px; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.8); }
.hud-game { font-size: 34px; color: #fff; line-height: 1; }
.hud-desc { font-size: 19px; color: #e8e8e8; margin-top: 2px; }
.scoreboard { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sb-row { display: flex; align-items: center; height: 30px; min-width: 150px; background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.12)); border-left: 4px solid currentColor; padding: 0 10px 0 8px; font-size: 21px; gap: 12px; transition: transform 0.25s, opacity 0.3s; }
.sb-row .nm { flex: 1; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-row .sc { min-width: 30px; text-align: right; color: #fff; }
.sb-row.dead { opacity: 0.45; }
.sb-row .bar { position: relative; width: 90px; height: 8px; background: rgba(0, 0, 0, 0.5); border-radius: 4px; overflow: hidden; }
.sb-row .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: currentColor; }
.sb-row.flash { animation: sb-flash 0.5s; }
@keyframes sb-flash { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.score-box { display: inline-flex; align-items: center; gap: 22px; margin-top: 10px; padding: 2px 10px; font-size: 22px; color: #a8dcff; border: 3px solid #4e8fd0; border-radius: 4px; background: rgba(20, 40, 80, 0.4); }
.score-box b { color: #fff; font-weight: normal; }
.hud-top { position: absolute; left: 0; right: 0; top: 8px; text-align: center; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.85); }
.hud-timer { font-size: 30px; color: #cdd3d8; }
.hud-timer.low { color: #ff6a5a; }
.hud-wave { font-size: 34px; color: #fff; line-height: 1.05; }
.hud-bonus { font-size: 19px; color: #ffe04a; }
.hud-center-msg { position: absolute; left: 0; right: 0; top: 20%; text-align: center; font-size: 30px; text-shadow: 0 3px 4px #000; }

.big-title { position: absolute; left: 0; right: 0; top: 9%; text-align: center; pointer-events: none; }
.big-title .t { display: inline-block; font-size: 92px; line-height: 0.95; letter-spacing: 1px; transform: scaleY(1.22); color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #eaf3ff 45%, #a9c8ef 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 2px #0b1630) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.75)); }
.big-title .s { font-size: 30px; color: #f1f1f1; margin-top: 18px; text-shadow: 0 2px 3px #000; }
.big-title.anim .t { animation: title-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes title-in { from { transform: scale(2.2, 2.6); opacity: 0; } to { transform: scaleY(1.22); opacity: 1; } }
.big-title.out { transition: opacity 0.8s; opacity: 0; }

.zoom-text { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; font-size: 80px; transform: scaleY(1.2); text-shadow: 0 0 3px #000, 0 4px 4px rgba(0, 0, 0, 0.7); }
.zoom-text.in { animation: zoom-in 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes zoom-in { from { transform: scale(0.2); opacity: 0; } to { transform: scaleY(1.2); opacity: 1; } }

.tip-bar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(84vw, 860px); display: flex; gap: 14px; align-items: center; color: #b5b0c6; font-size: 18px; text-shadow: 0 2px 2px #000; transition: opacity 0.8s; }
.tip-bar b { font-size: 28px; font-weight: normal; color: #cbc5d8; }

.announce { position: absolute; left: 0; right: 0; top: 22%; text-align: center; font-size: 34px; text-shadow: 0 2px 4px #000; pointer-events: none; }
.announce div { animation: fade-up 2.4s forwards; }
@keyframes fade-up { 0% { opacity: 0; transform: translateY(10px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

.menu-btn { position: absolute; right: 12px; top: 10px; width: 54px; height: 54px; border-radius: 50%; padding: 0; pointer-events: auto; }
.menu-btn svg { width: 28px; height: 28px; }

/* World-space labels */
.nametag { position: absolute; transform: translate(-50%, -100%); font-size: 18px; white-space: nowrap; text-shadow: 0 0 2px #000, 0 1px 2px #000; pointer-events: none; }
.nametag .hp { display: block; margin: 2px auto 0; width: 46px; height: 5px; background: rgba(0, 0, 0, 0.55); border-radius: 3px; overflow: hidden; }
.nametag .hp i { display: block; height: 100%; background: #6bff4a; }
.nametag .pw { display: flex; gap: 2px; justify-content: center; margin-top: 2px; }
.nametag .pw span { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: #fff; }
.nametag .pw canvas { width: 16px; height: 16px; }
.popup { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; text-shadow: 0 0 3px #000, 0 2px 3px #000; }
.offscreen { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; opacity: 0.8; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); }

/* Results / score screens */
.results { position: absolute; inset: 0; background: #17141c; }
.results .bg { position: absolute; inset: 0; opacity: 0.18; background-repeat: no-repeat; background-position: center 55%; background-size: min(64vh, 620px); }
.results .head { position: absolute; left: 0; right: 0; top: 4%; text-align: center; font-size: 42px; color: #6ee06a; text-shadow: 0 3px 3px #000; transform: scaleY(1.15); }
.results .sub { position: absolute; left: 0; right: 0; top: 11%; text-align: center; font-size: 16px; color: #8fdc84; }
.results .big { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scaleY(1.2); font-size: 110px; color: #ff9a2a; text-shadow: 0 0 4px #3b1400, 0 6px 4px rgba(0, 0, 0, 0.7); }
.results .big.win { color: #ffe060; }
.results .note { position: absolute; left: 0; right: 0; top: 62%; text-align: center; font-size: 24px; color: #d9d4e4; }
.results .col { position: absolute; top: 18%; width: 28%; font-size: 22px; }
.results .col.left { left: 7%; }
.results .col.right { right: 5%; }
.results .col h4 { margin: 0 0 8px; font-weight: normal; font-size: 26px; color: #f1eef6; }
.results .col .line { display: flex; gap: 10px; color: #e4e0ec; }
.results .col .line b { color: #ffbf3a; font-weight: normal; min-width: 50px; text-align: right; }
.results .btns { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); display: flex; gap: 22px; }
.results .btns .btn { width: 110px; height: 84px; padding: 0; border-radius: 26px 30px 24px 28px; }
.results .btns svg { width: 54px; height: 54px; }

.standings { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(90vw, 760px); }
.standings h2 { text-align: center; font-weight: normal; font-size: 46px; margin: 0 0 20px; color: #fff; text-shadow: 0 3px 4px #000; }
.st-row { display: flex; align-items: center; gap: 16px; font-size: 32px; margin: 8px 0; text-shadow: 0 2px 3px #000; opacity: 0; animation: st-in 0.4s forwards; }
.st-row .rk { width: 60px; text-align: right; color: #ccc; }
.st-row .nm { flex: 1; }
.st-row .pts { color: #fff; min-width: 80px; text-align: right; }
.st-row .gain { color: #7dff6a; font-size: 24px; min-width: 70px; }
@keyframes st-in { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.press-any { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font-size: 22px; color: #aaa; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* Touch controls */
.touch { position: absolute; inset: 0; pointer-events: none; }
.touch .stick { position: absolute; left: 6%; bottom: 10%; width: 150px; height: 150px; border-radius: 50%; background: rgba(0, 0, 0, 0.3); pointer-events: auto; touch-action: none; }
.touch .stick i { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.touch .pad { position: absolute; right: 5%; bottom: 8%; width: 200px; height: 200px; pointer-events: none; }
.touch .pad .b { position: absolute; width: 74px; height: 74px; border-radius: 50%; pointer-events: auto; touch-action: none; opacity: 0.85; display: flex; align-items: center; justify-content: center; }
.touch .pad .b svg { width: 44px; height: 44px; }

@media (max-width: 900px), (max-height: 560px) {
  :root { --ui-scale: 0.7; }
  .panel { padding: 16px 20px 22px; border-radius: 44px 56px 50px 60px / 56px 44px 60px 50px; }
  .panel-title { font-size: 30px; margin-bottom: 10px; }
  .play-cards { gap: 14px; padding: 4px 6px; }
  .card { width: 160px; height: 150px; }
  .card .label { font-size: 21px; }
  .menu-row { gap: 10px; bottom: 12%; }
  .menu-row .btn { font-size: 16px; height: 52px; padding: 0 12px; }
  .menu-row .btn.big { font-size: 36px; height: 70px; min-width: 170px; }
  .menu-row .btn.icon { height: 70px; width: 70px; font-size: 16px; }
  .hud-game { font-size: 26px; }
  .big-title .t { font-size: 60px; }
  .controls-guide { display: none; }
  .back-btn { left: 16px; top: 16px; width: 48px; height: 40px; }
}
