.tk-touch { position:fixed; inset:0; z-index:var(--z-touch, 45); pointer-events:none; --touch-size:1; --touch-opacity:.75; --pad:calc(108px * var(--touch-size)); --button:calc(58px * var(--touch-size)); }
.tk-touch[hidden] { display:none; }
.tk-touch > .steering,.tk-touch > .actions { position:absolute; bottom:max(12px,env(safe-area-inset-bottom)); height:calc(126px * var(--touch-size)); }
.tk-touch .steering { left:max(12px,env(safe-area-inset-left)); width:calc(112px * var(--touch-size)); }
.tk-touch .actions { right:max(12px,env(safe-area-inset-right)); width:calc(200px * var(--touch-size)); height:calc(190px * var(--touch-size)); }
.tk-touch[data-gas='manual'] .actions { width:calc(224px * var(--touch-size)); }
.tk-touch.swap .steering { right:max(12px,env(safe-area-inset-right)); left:auto; transform:scaleX(-1); }
.tk-touch.swap .actions { left:max(12px,env(safe-area-inset-left)); right:auto; transform:scaleX(-1); }
.tk-touch.swap .steering button,.tk-touch.swap .actions button { transform:scaleX(-1); }
.tk-touch button { position:absolute; display:flex; flex-direction:column; align-items:center; justify-content:center; box-sizing:border-box; width:var(--button); height:var(--button); pointer-events:auto; touch-action:none; user-select:none; border-radius:50%; background:#241a14; color:#fff; opacity:var(--touch-opacity); font:700 24px Rubik,sans-serif; border:2px solid #fff1cc; box-shadow:0 2px 5px #0005; padding:2px; }
.tk-touch button.held { background:#71510b; opacity:1; border-color:#ffd24a; }
.tk-touch button small { font:600 10px/1.15 Rubik,sans-serif; max-width:100%; overflow-wrap:anywhere; z-index:1; }.tk-touch button span { z-index:1; }
.tk-touch .steer { width:var(--pad); height:var(--pad); bottom:0; left:0; }
.tk-touch .steer i { position:absolute; width:40%; height:40%; border:1px solid #fff7; border-radius:50%; background:#fff2; transform:translateX(var(--dx,0px)); pointer-events:none; }
.tk-touch .left,.tk-touch .right { display:none; bottom:0; width:calc(52px * var(--touch-size)); height:var(--pad); border-radius:18px; }
.tk-touch .left { left:0; }.tk-touch .right { left:calc(58px * var(--touch-size)); }
.tk-touch[data-steering='buttons'] .steer { display:none; }.tk-touch[data-steering='buttons'] .left,.tk-touch[data-steering='buttons'] .right { display:flex; }
/* two-thumb arc: Drift is the primary under the resting right thumb; Item above it, Hook up-left, Brake to the left */
.tk-touch .actions button { --s:var(--touch-size); }
.tk-touch .drift { right:calc(8px * var(--s)); bottom:calc(8px * var(--s)); width:calc(76px * var(--s)); height:calc(76px * var(--s)); font-size:28px; }
.tk-touch .item { right:calc(12px * var(--s)); bottom:calc(88px * var(--s)); width:calc(64px * var(--s)); height:calc(64px * var(--s)); }
.tk-touch .hook { right:calc(88px * var(--s)); bottom:calc(72px * var(--s)); width:calc(60px * var(--s)); height:calc(60px * var(--s)); }
.tk-touch .brake { right:calc(98px * var(--s)); bottom:calc(12px * var(--s)); width:calc(56px * var(--s)); height:calc(56px * var(--s)); }
.tk-touch .gas { display:none; }
/* manual throttle: Gas takes the primary spot, Drift moves left of it (a held drift also holds the gas), Brake further out */
.tk-touch[data-gas='manual'] .gas { display:flex; right:calc(8px * var(--s)); bottom:calc(8px * var(--s)); width:calc(76px * var(--s)); height:calc(76px * var(--s)); font-size:28px; }
.tk-touch[data-gas='manual'] .drift { right:calc(96px * var(--s)); bottom:calc(10px * var(--s)); width:calc(60px * var(--s)); height:calc(60px * var(--s)); font-size:24px; }
.tk-touch[data-gas='manual'] .brake { right:calc(164px * var(--s)); bottom:calc(14px * var(--s)); width:calc(52px * var(--s)); height:calc(52px * var(--s)); }
.tk-touch .steering button.drifting { border-color:#ffd24a; box-shadow:0 -6px 0 #ffd24a99,0 2px 5px #0005; }
.tk-touch .utilities { position:absolute; right:max(10px,env(safe-area-inset-right)); top:max(8px,env(safe-area-inset-top)); display:flex; gap:6px; }
.tk-touch .utilities button { position:static; width:48px; height:48px; border-radius:12px; font-size:20px; }.tk-touch .utilities button small { display:none; }
body.touch-device #app { touch-action:none; }
body.touch-device .tk-padhint { display:none; }
body.touch-device.split-race .tk-touch { bottom:auto; height:50dvh; --touch-size:.85 !important; }
body.touch-device.split-race .tk-touch:is([data-seats='3'],[data-seats='4']) { right:auto; width:50vw; }
body.touch-device.split-race .tk-touch .utilities { gap:4px; }
body.touch-device.split-race .tk-touch .utilities button { width:44px; height:44px; }
body.touch-device .tk-seat { padding:6px; gap:3px; font-size:12px; }
body.touch-device .tk-seat > b,body.touch-device .tk-seat > div { padding:2px 6px; }
body.touch-device .tk-screen { padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
body.touch-device .tk-btn,body.touch-device .tk-btn.small,body.touch-device .tk-tab,body.touch-device .tk-seg button,body.touch-device .tk-key { min-height:44px; }
body.touch-device .tk-lobby .bar .tk-btn { min-height:48px; }
body.touch-device .tk-lobby .tk-prow .acts button { min-width:44px; min-height:44px; }
body.touch-device .tk-lobby .tk-prow .acts { flex-wrap:wrap; justify-content:flex-end; max-width:188px; }
body.touch-device .tk-lobby .tk-prow > span { min-width:0; overflow-wrap:anywhere; }
body.touch-device .tk-panel > .tk-card { max-height:calc(100dvh - 20px); max-width:100%; overflow:auto; }
body.touch-device .tk-panel .body { min-height:70px; flex:1 1 auto; }
body.touch-device .tk-panel h2 { margin:2px 0 8px; font-size:1.25em; }
body.touch-device .tk-tabs { flex-wrap:nowrap; overflow-x:auto; flex-shrink:0; padding-bottom:3px; }
body.touch-device .tk-tab { white-space:nowrap; padding:6px 12px; }
body.touch-device .tk-panel .foot { flex-shrink:0; margin-top:8px; }
body.touch-device .tk-range input { max-width:100%; width:180px; min-height:44px; }
body.touch-device .tk-hud .safe { inset:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
body.touch-device .tk-hud .itembox { top:0; left:0; width:56px; height:56px; border-width:3px; border-radius:12px; }
body.touch-device .tk-hud .itembox canvas { width:46px; height:46px; }
body.touch-device .tk-hud .itembox .n { font-size:18px; }
body.touch-device .tk-hud .coins { top:20px; left:68px; bottom:auto; font-size:20px; gap:3px; }
body.touch-device .tk-hud .coins i { width:18px; height:18px; border-width:2px; }
body.touch-device .tk-hud .place { left:130px; right:auto; top:8px; bottom:auto; font-size:36px; }
body.touch-device .tk-hud .lap { top:0; left:50%; right:auto; transform:translateX(-50%); font-size:16px; white-space:nowrap; }
body.touch-device .tk-hud .lap .tm { font-size:14px; }
body.touch-device .tk-hud .minimap { left:auto; right:0; top:58px; width:86px; height:86px; }
body.touch-device .tk-hud .center { font-size:40px; white-space:normal; max-width:60%; }
body.touch-device .tk-hud .callout { font-size:18px; max-width:50%; text-align:center; }
body.touch-device .tk-hud .chat { left:50%; transform:translateX(-50%); top:auto; bottom:35px; width:36%; font-size:12px; }
body.touch-device .tk-hud .chat .ln:nth-last-child(n+3) { display:none; }
body.touch-device .tk-hud .voiceb { top:62px; right:90px; font-size:12px; }
body.touch-device .tk-hud .board { top:65px; right:100px; font-size:12px; }
body.touch-device .tk-hud .timer { top:0; font-size:24px; }
body.touch-device .tk-hud .balloons { top:65px; bottom:auto; font-size:20px; }
body.touch-device .tk-hud .warn { width:34px; height:34px; font-size:22px; }
body.touch-device .tk-hud .warn.back { left:50%; bottom:20px; margin-left:-17px; }
body.touch-device .tk-hud .net { top:65px; font-size:10px; max-width:60%; overflow:hidden; }
body.touch-device .tk-toasts { max-width:65%; top:64px; bottom:auto; font-size:13px; }
@media (max-height:540px) and (orientation:landscape) {
 body.touch-device .tk-main { overflow:auto; align-items:flex-start; }
 body.touch-device .tk-main .left { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:72%; min-width:0; gap:6px; align-content:start; }
 body.touch-device .tk-main .logo,body.touch-device .tk-main .left > .tk-row { grid-column:1 / -1; }
 body.touch-device .tk-main .left > .tk-row { gap:6px; }
 body.touch-device .tk-main .left > .tk-row .tk-btn { padding:6px 10px; font-size:13px; }
 body.touch-device .tk-main .logo .tk-word { font-size:34px; }
 body.touch-device .tk-menuitem { min-height:48px; padding:4px 8px; gap:8px; font-size:16px; }
 body.touch-device .tk-menuitem small { display:none; }
 body.touch-device .tk-menuitem .ico { width:32px; height:32px; }
 body.touch-device .tk-main .tk-news { display:none; }
 body.touch-device .tk-card { padding:12px; }
 body.touch-device .tk-hub,body.touch-device .tk-lobby,body.touch-device .tk-garage,body.touch-device .tk-results { overflow:auto; }
 body.touch-device .tk-lobby .lcol { top:10px; bottom:110px; width:calc(50% - 24px); overflow:auto; }
 body.touch-device .tk-lobby .lcol.l { left:10px; } body.touch-device .tk-lobby .lcol.r { right:10px; }
 body.touch-device .tk-lobby .grow { flex:none; }
 body.touch-device .tk-lobby .bar { left:10px; right:10px; bottom:10px; transform:none; max-width:none; justify-content:center; }
 body.touch-device[data-screen='lobby'] .bayplate { display:none; }
}
@media (orientation:portrait) and (max-width:900px) {
 body.touch-device .tk-screen { overflow:auto; }
 body.touch-device .tk-panel > .tk-card { max-height:calc(100dvh - 20px); }
 body.touch-device .tk-opt { grid-template-columns:1fr; }
 body.touch-device .tk-opt > * { min-width:0; }
 body.touch-device .tk-main .left { width:100%; }.touch-device .tk-profile { display:none; }
 body.touch-device .tk-hud .lap { top:46px; }
 body.touch-device .tk-touch { --touch-size:.85 !important; }
 body.touch-device .tk-touch .utilities { top:52px; }
 body.touch-device .tk-lobby { display:block; }
 body.touch-device .tk-lobby .lcol { position:static; width:auto; margin:0 0 12px; }
 body.touch-device .tk-lobby .grow { flex:none; }
 body.touch-device .tk-lobby .bar { position:sticky; bottom:0; left:auto; transform:none; max-width:none; padding:8px; background:#f0d6b0; }
 body.touch-device[data-screen='lobby'] .bayplate { display:none; }
}
