/* TeeKarts UI: printed wooden plaques and cardboard labels with die-cut edges and screws in the corners (PLAN 7.11);
   the transition is a wall of toy blocks that drops in, clicks and opens again. Titan One + Rubik (SIL OFL). */
@font-face { font-family: 'Titan One'; src: url('../assets/fonts/TitanOne-latin.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('../assets/fonts/Rubik-latin.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --ink: #241a14; --ink2: #4a3a2e; --wood: #d9b48f; --wood2: #c49a6c; --wood3: #a8774c; --card: #fff6e6; --card2: #f3e3c8; --mute: #8a7462;
  --red: #e8483b; --blue: #2e86ab; --gold: #ffcf3a; --green: #5ab04a; --ok: #4fc86a; --bad: #e8483b; --purple: #8e5bd6;
  --st1: #5aa8ff; --st2: #ff8a2a; --st3: #b14fd6;
  --ts: 1; --r: 16px;
  /* one z-order for every layer (desktop, touch and split-screen alike): race overlays < HUD < menu screens < UI chrome */
  --z-split: 3; --z-speed: 6; --z-hud: 8; --z-screen: 12; --z-cursor: 30; --z-toast: 35; --z-modal: 38; --z-wipe: 40; --z-touch: 45;
  --shadow: 0 5px 0 rgba(36, 26, 20, 0.6), 0 14px 30px rgba(0, 0, 0, 0.35);
  font-family: 'Rubik', system-ui, sans-serif;
}
body.cb-protan, body.cb-deutan { --red: #d88a1a; --green: #2a8adf; } body.cb-tritan { --blue: #2ab8b8; --purple: #d84a8a; }

#ui-root * { box-sizing: border-box; }
.tk-screen { position: absolute; inset: 0; z-index: var(--z-screen); pointer-events: none; display: flex; font-size: calc(16px * var(--ts)); color: var(--ink); }
.tk-screen > * { pointer-events: auto; }
.tk-screen.in { animation: tk-in 360ms cubic-bezier(.2, .9, .3, 1.15) both; }
.tk-screen.out { animation: tk-out 240ms ease-in both; pointer-events: none; }
.tk-screen.out > * { pointer-events: none; }
@keyframes tk-in { from { transform: translateY(24px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tk-out { to { transform: translateY(-20px); opacity: 0; } }
.reduced .tk-screen.in, .reduced .tk-screen.out { animation-duration: 1ms; }

/* block-wall wipe (<= 450 ms, PLAN 7.11) */
.tk-wipe { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-wipe); display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(5, 1fr); overflow: hidden; }
.tk-wipe i { display: block; border: 3px solid var(--ink); border-radius: 12px; margin: -2px; animation: tk-drop 430ms cubic-bezier(.4, 1.4, .5, 1) both; }
@keyframes tk-drop { 0% { transform: translateY(-120vh); } 45%, 60% { transform: none; } 100% { transform: translateY(120vh) rotate(8deg); } }

/* plaques */
.tk-card { position: relative; background: linear-gradient(var(--card), var(--card2)); border: 4px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 22px; }
.tk-card::before, .tk-card::after { content: ''; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 15%, #b8bcc4 30%, #6a6e78 75%); border: 2px solid var(--ink); top: 7px; }
.tk-card::before { left: 7px; } .tk-card::after { right: 7px; }
.tk-card.wood { background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.03) 0 2px, transparent 2px 9px), linear-gradient(var(--wood), var(--wood2)); }
.tk-card.plain::before, .tk-card.plain::after { display: none; }
.tk-card h2, .tk-h { font-family: 'Titan One', 'Rubik', sans-serif; font-weight: 400; margin: 4px 0 12px; font-size: 1.6em; letter-spacing: 0.5px; color: var(--ink); }
.tk-card h3 { font-family: 'Titan One', sans-serif; font-weight: 400; margin: 10px 0 6px; font-size: 1.1em; }
.tk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 1em 'Rubik', sans-serif; color: var(--ink); background: #fff;
  border: 3px solid var(--ink); border-radius: 12px; padding: 10px 18px; box-shadow: 0 4px 0 var(--ink); cursor: pointer; transition: transform 80ms, box-shadow 80ms, background 120ms; min-height: 44px; }
.tk-btn:hover, .tk-btn.focus { background: #fff1c0; transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.tk-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tk-btn.primary { background: var(--gold); } .tk-btn.primary:hover, .tk-btn.primary.focus { background: #ffe06a; }
.tk-btn.red { background: #ff8a7a; } .tk-btn.blue { background: #8ac8ff; } .tk-btn.green { background: #9be36b; }
.tk-btn[disabled], .tk-btn.disabled { opacity: 0.45; pointer-events: none; filter: grayscale(0.6); }
.tk-btn.small { padding: 6px 12px; min-height: 34px; font-size: 0.9em; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.tk-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tk-col { display: flex; flex-direction: column; gap: 10px; }
.tk-grow { flex: 1; }
.tk-muted { color: var(--mute); }
.tk-small { font-size: 0.85em; }
.tk-tag { display: inline-block; padding: 2px 8px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; font-weight: 700; font-size: 0.8em; }
.tk-tag.gold { background: var(--gold); } .tk-tag.silver { background: #dfe3ea; } .tk-tag.bronze { background: #e0a070; } .tk-tag.master { background: #c8a0ff; }

.tk-cursor { position: absolute; width: 30px; height: 30px; pointer-events: none; z-index: var(--z-cursor); transition: left 120ms cubic-bezier(.3, 1.4, .5, 1), top 120ms cubic-bezier(.3, 1.4, .5, 1), opacity 120ms; opacity: 0; }
.tk-cursor.on { opacity: 1; }

/* loading: a Tee screws a kart together, progress as a growing tower of blocks */
.tk-loading { align-items: center; justify-content: center; flex-direction: column; gap: 20px; background: radial-gradient(ellipse at 50% 35%, #4a3020, #1a120c 72%); color: #fff; }
.tk-loading .tower { display: flex; flex-direction: column-reverse; gap: 4px; height: 150px; justify-content: flex-start; }
.tk-loading .blk { width: 90px; height: 22px; border: 3px solid #1a120c; border-radius: 7px; transform: translateY(-140px); opacity: 0; transition: transform 380ms cubic-bezier(.3, 1.5, .5, 1), opacity 200ms; }
.tk-loading .blk.on { transform: none; opacity: 1; }
.tk-loading .step { font-weight: 600; opacity: 0.85; }
.tk-loading .tip { max-width: 600px; text-align: center; opacity: 0.75; min-height: 2.6em; padding: 0 20px; }
.tk-word { font-family: 'Titan One', sans-serif; font-size: 72px; color: #fff; text-shadow: 0 5px 0 var(--ink), 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 -4px 0 var(--ink), 0 10px 24px rgba(0, 0, 0, 0.5); letter-spacing: 2px; line-height: 1; }
.tk-word span { color: var(--gold); }
.tk-word b { display: inline-block; animation: tk-snap 600ms cubic-bezier(.3, 1.6, .5, 1) both; font-weight: 400; }
@keyframes tk-snap { from { transform: translateY(-60px) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tk-err { background: var(--bad); padding: 14px 18px; border-radius: 12px; border: 3px solid #fff; max-width: 520px; }

/* title */
.tk-title { flex-direction: column; align-items: center; justify-content: space-between; padding: 7vh 0 9vh; }
.tk-title .tk-word { font-size: clamp(56px, 10vw, 128px); }
.tk-title .sub { font-family: 'Titan One', sans-serif; color: #fff; font-size: 26px; text-shadow: 0 3px 0 var(--ink); margin-top: 10px; text-align: center; }
.tk-title .press { font-family: 'Titan One', sans-serif; font-size: 28px; color: #fff; text-shadow: 0 3px 0 var(--ink); animation: tk-pulse 1.4s ease-in-out infinite; }
.tk-title .wip { position: absolute; right: 18px; bottom: 14px; color: rgba(255, 255, 255, 0.8); font-size: 13px; text-shadow: 0 1px 0 #000; }
@keyframes tk-pulse { 0%, 100% { opacity: 0.55; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1.03); } }

/* main menu */
.tk-main { align-items: stretch; padding: 4vh 0 4vh 4vw; gap: 3vw; }
.tk-main .left { display: flex; flex-direction: column; gap: 9px; width: min(400px, 42vw); justify-content: center; }
.tk-main .logo .tk-word { font-size: 58px; }
.tk-menuitem { display: flex; align-items: center; gap: 14px; padding: 9px 16px; border: 4px solid var(--ink); border-radius: 14px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.025) 0 2px, transparent 2px 10px), linear-gradient(#f0d6b0, #ddb88a); box-shadow: 0 5px 0 var(--ink);
  font: 400 22px 'Titan One', sans-serif; cursor: pointer; transition: transform 100ms, background 120ms; color: var(--ink); text-align: left; position: relative; }
.tk-menuitem small { display: block; font: 500 13px 'Rubik', sans-serif; color: var(--ink2); }
.tk-menuitem:hover, .tk-menuitem.focus { transform: translateX(10px) rotate(-0.6deg); background: linear-gradient(#ffe9a8, #ffd770); }
.tk-menuitem .ico { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: 22px; background: #fff; }
.tk-news { font-size: 14px; }
.tk-roster { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-seatcard { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font: 500 0.95em 'Rubik', sans-serif; color: var(--ink); min-height: 44px; }
.tk-seatcard > b { font-family: 'Titan One', 'Rubik', sans-serif; font-weight: 400; font-size: 1.15em; }
.tk-seatcard.add { border-style: dashed; background: rgba(255, 255, 255, .45); cursor: pointer; flex-wrap: wrap; max-width: 330px; text-align: left; }
.tk-seatcard.add:hover, .tk-seatcard.add.focus { background: #fff1c0; }
.tk-seatcard.add .tk-small { flex-basis: 100%; }
.tk-news .item { padding: 6px 0; border-bottom: 2px dashed rgba(36, 26, 20, 0.18); }
.tk-profile { position: absolute; right: 3vw; bottom: 4vh; display: flex; gap: 12px; align-items: center; }
.tk-xpbar { width: 180px; height: 14px; border: 3px solid var(--ink); border-radius: 8px; background: #fff; overflow: hidden; }
.tk-xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff9a3a); }

/* panels */
.tk-panel { align-items: center; justify-content: center; padding: 3vh 3vw; }
.tk-panel > .tk-card { width: min(1140px, 94vw); max-height: 92vh; display: flex; flex-direction: column; }
.tk-panel .body { overflow: auto; flex: 1; padding-right: 6px; }
.tk-panel .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.tk-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tk-tab { padding: 8px 14px; border: 3px solid var(--ink); border-radius: 12px 12px 4px 4px; background: var(--card2); font-weight: 700; cursor: pointer; }
.tk-tab.on { background: var(--gold); }
.tk-tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.tk-trackcard { border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; transition: transform 100ms; position: relative; }
.tk-trackcard:hover, .tk-trackcard.focus { transform: translateY(-3px) rotate(-0.5deg); }
.tk-trackcard.on { outline: 5px solid var(--gold); }
.tk-trackcard .pic { height: 96px; background-size: cover; background-position: center; background-color: #6a8aa0; }
.tk-trackcard .nm { font: 400 15px 'Titan One', sans-serif; padding: 6px 8px 2px; }
.tk-trackcard .md { font-size: 11px; padding: 0 8px 7px; color: var(--mute); }
.tk-trackcard .medal { position: absolute; top: 6px; right: 6px; }
/* four worlds of three tracks: a 2 x 2 grid, one column on narrow screens */
.tk-worlds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .tk-worlds { grid-template-columns: minmax(0, 1fr); } }
.tk-cupcard { border: 4px solid var(--ink); border-radius: 14px; padding: 10px; background: var(--card); cursor: pointer; }
.tk-cupcard.on { outline: 5px solid var(--gold); }
.tk-opt { display: grid; grid-template-columns: 190px 1fr; gap: 8px 14px; align-items: center; }
.tk-opt label { font-weight: 700; }
.tk-seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; flex-wrap: wrap; }
.tk-seg button { border: none; border-right: 2px solid var(--ink); background: #fff; padding: 7px 12px; font: 600 0.92em 'Rubik', sans-serif; cursor: pointer; color: var(--ink); }
.tk-seg button:last-child { border-right: none; }
.tk-seg button.on { background: var(--gold); }
.tk-seg button:hover, .tk-seg button.focus { background: #fff1c0; }
.tk-range { display: flex; gap: 10px; align-items: center; }
.tk-range input { width: 220px; accent-color: var(--ink); }
.tk-input { border: 3px solid var(--ink); border-radius: 10px; padding: 8px 12px; font: 600 1em 'Rubik', sans-serif; background: #fff; color: var(--ink); min-width: 0; }
.tk-input:focus { outline: 3px solid var(--gold); }
.tk-keyrow { display: grid; grid-template-columns: 1fr 120px 120px; gap: 8px; align-items: center; padding: 3px 0; }
.tk-key { border: 3px solid var(--ink); border-radius: 8px; padding: 4px 8px; background: #fff; font-weight: 700; text-align: center; cursor: pointer; }
.tk-key.wait { background: var(--gold); animation: tk-pulse 0.8s infinite; }
table.tk-table { border-collapse: collapse; width: 100%; }
table.tk-table td, table.tk-table th { padding: 5px 8px; border-bottom: 2px dashed rgba(36, 26, 20, 0.15); text-align: left; }
table.tk-table tr.me td { background: #fff1c0; font-weight: 800; }

/* toasts and modals */
.tk-toasts { position: absolute; top: 3vh; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: var(--z-toast); pointer-events: none; }
.tk-toast { background: var(--card); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 16px; font-weight: 700; box-shadow: 0 4px 0 var(--ink); animation: tk-toast 3.2s ease both; }
.tk-toast.bad { background: #ffc0b8; } .tk-toast.good { background: #c8f5b0; }
@keyframes tk-toast { 0% { transform: translateY(-20px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
.tk-modal { position: absolute; inset: 0; background: rgba(20, 12, 8, 0.55); display: flex; align-items: center; justify-content: center; z-index: var(--z-modal); pointer-events: auto; }

/* HUD (PLAN 7.11): safe margin 5 % */
.tk-hud { position: absolute; inset: 0; pointer-events: none; font-family: 'Titan One', sans-serif; color: #fff; z-index: var(--z-hud); }
.tk-hud .safe { position: absolute; inset: 4.5vh 4vw; }
.tk-hud .place { position: absolute; right: 0; bottom: 0; font-size: calc(96px * var(--ts)); line-height: 0.9; text-shadow: 0 6px 0 var(--ink), 5px 0 0 var(--ink), -5px 0 0 var(--ink), 0 -5px 0 var(--ink); transform-origin: 80% 80%; }
.tk-hud .place sup { font-size: 0.42em; vertical-align: super; }
.tk-hud .place.pop { animation: tk-placepop 420ms cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tk-placepop { from { transform: rotateX(90deg) scale(1.3); } to { transform: none; } }
.tk-hud .lap { position: absolute; right: 0; top: 0; text-align: right; font-size: calc(30px * var(--ts)); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); }
.tk-hud .lap .tm { font: 700 calc(20px * var(--ts)) 'Rubik', sans-serif; opacity: 0.95; }
.tk-hud .itembox { position: absolute; left: 0; top: 0; width: 104px; height: 104px; border: 5px solid var(--ink); border-radius: 18px; background: rgba(255, 246, 230, 0.86); box-shadow: 0 5px 0 var(--ink); display: flex; align-items: center; justify-content: center; }
.tk-hud .itembox canvas { width: 82px; height: 82px; }
.tk-hud .itembox .n { position: absolute; right: -6px; bottom: -8px; font-size: 26px; text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); }
.tk-hud .itembox.roll canvas { animation: tk-roll 120ms linear infinite; }
@keyframes tk-roll { from { transform: translateY(-8px); } to { transform: translateY(8px); } }
.tk-hud .coins { position: absolute; left: 0; bottom: 0; font-size: calc(36px * var(--ts)); display: flex; align-items: center; gap: 8px; text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); }
.tk-hud .coins i { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #ffc83a 45%, #c08a10); border: 4px solid var(--ink); display: inline-block; }
.tk-hud .minimap { position: absolute; left: 0; top: 34%; width: 170px; height: 170px; }
.tk-hud .center { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%); font-size: calc(76px * var(--ts)); text-shadow: 0 6px 0 var(--ink), 5px 0 0 var(--ink), -5px 0 0 var(--ink), 0 -5px 0 var(--ink); white-space: nowrap; text-align: center; }
.tk-hud .center.pop { animation: tk-cpop 700ms cubic-bezier(.3, 1.7, .5, 1); }
@keyframes tk-cpop { from { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.tk-hud .callout { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-size: calc(30px * var(--ts)); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); animation: tk-callout 1.2s ease both; }
@keyframes tk-callout { 0% { transform: translateX(-50%) scale(0.6); opacity: 0; } 15% { transform: translateX(-50%) scale(1.1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(-50%) translateY(-30px); opacity: 0; } }
.tk-hud .warn { position: absolute; top: 50%; width: 64px; height: 64px; margin-top: -32px; border-radius: 50%; border: 5px solid var(--ink); background: #ff4a3a; display: none; align-items: center; justify-content: center; font-size: 34px; animation: tk-pulse 0.3s infinite; }
.tk-hud .warn.left { left: 0; } .tk-hud .warn.right { right: 0; } .tk-hud .warn.back { left: 50%; top: auto; bottom: 0; margin-left: -32px; }
.tk-hud .chat { position: absolute; left: 0; top: 130px; width: min(420px, 36vw); font: 600 15px 'Rubik', sans-serif; text-shadow: 0 1px 2px #000; display: flex; flex-direction: column; gap: 2px; }
.tk-hud .chat .ln { background: rgba(20, 12, 8, 0.45); padding: 2px 8px; border-radius: 6px; transition: opacity 400ms; }
.tk-hud .chatin { position: absolute; left: 0; top: 330px; width: min(420px, 36vw); pointer-events: auto; }
.tk-hud .voiceb { position: absolute; right: 0; top: 90px; font: 700 14px 'Rubik', sans-serif; text-shadow: 0 1px 2px #000; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.tk-hud .stage { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; gap: 6px; }
.tk-hud .stage i { width: 28px; height: 12px; border: 3px solid var(--ink); border-radius: 6px; background: rgba(255,255,255,.3); }
.tk-hud .stage i.s1 { background: var(--st1); } .tk-hud .stage i.s2 { background: var(--st2); } .tk-hud .stage i.s3 { background: var(--st3); }
.tk-hud .net { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font: 600 12px monospace; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 6px; }
.tk-hud .board { position: absolute; right: 0; top: 120px; font: 700 14px 'Rubik', sans-serif; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 2px #000; }
.tk-hud .board .r { display: flex; gap: 8px; justify-content: flex-end; padding: 1px 8px; border-radius: 6px; }
.tk-hud .board .r.me { background: rgba(255, 207, 58, 0.45); }
.tk-hud .timer { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-size: 40px; text-shadow: 0 4px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink); }
.tk-hud .balloons { position: absolute; left: 0; bottom: 60px; font-size: 34px; text-shadow: 0 3px 0 var(--ink); }
.tk-hud .speed { position: absolute; right: 0; bottom: 110px; font: 800 18px 'Rubik', sans-serif; text-shadow: 0 2px 0 var(--ink); opacity: 0.9; }
.tk-speedlines { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-speed); }

/* results, garage, lobby */
.tk-results { align-items: flex-end; justify-content: flex-end; padding: 4vh 4vw; }
.tk-results > .tk-card { width: min(640px, 92vw); max-height: 92vh; overflow: auto; }
/* the buttons stay in view while a long table scrolls (12 rows did not fit at 720p) */
.tk-results .tk-resfoot { position: sticky; bottom: -18px; margin: 12px -22px -18px !important; padding: 12px 22px 16px; background: linear-gradient(rgba(196, 154, 108, 0), var(--wood2) 35%); z-index: 1; }
@media (max-height: 820px) { .tk-results table.tk-table td, .tk-results table.tk-table th { padding-top: 3px; padding-bottom: 3px; } }
.tk-awards { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tk-garage { justify-content: flex-start; align-items: stretch; padding: 3vh 2vw; }
.tk-garage .side { width: min(470px, 46vw); display: flex; flex-direction: column; gap: 10px; }
.tk-garage .side .tk-card { overflow: auto; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-chip { border: 3px solid var(--ink); border-radius: 10px; padding: 5px 10px; background: #fff; cursor: pointer; font-weight: 700; font-size: 0.9em; }
.tk-chip.on { background: var(--gold); }
.tk-chip.sw { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.tk-stats { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; align-items: center; font-weight: 700; font-size: 0.9em; }
.tk-bar { height: 14px; border: 3px solid var(--ink); border-radius: 7px; background: #fff; position: relative; overflow: hidden; }
.tk-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); }
.tk-bar b { position: absolute; top: 0; bottom: 0; background: var(--ok); opacity: 0.8; }
.tk-bar b.down { background: var(--bad); }
.tk-plate { display: inline-flex; gap: 6px; align-items: center; background: var(--card); border: 3px solid var(--ink); border-radius: 10px; padding: 2px 8px; font: 700 13px 'Rubik', sans-serif; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); }
.tk-plate.ready { background: #c8f5b0; }
.tk-plate[data-mic='talk']::after { content: '🔊'; } .tk-plate[data-mic='on']::after { content: '🎙'; opacity: .6; }
.tk-countdown { font-family: 'Titan One', sans-serif; font-size: 130px; color: #fff; text-shadow: 0 8px 0 var(--ink), 6px 0 0 var(--ink), -6px 0 0 var(--ink), 0 -6px 0 var(--ink); animation: tk-cpop 600ms cubic-bezier(.3, 1.7, .5, 1); }
@media (max-width: 760px) { .tk-opt { grid-template-columns: 1fr; } .tk-main .left { width: 92vw; } .tk-hud .place { font-size: 64px; } }

/* controllers (brief 4c): the "press any button" hint disappears once a pad is in use */
.tk-padhint { position: absolute; left: 50%; bottom: 2.4vh; transform: translateX(-50%); background: rgba(36, 26, 20, 0.72); color: #fff8ea; font: 700 15px 'Rubik', sans-serif; padding: 6px 14px; border-radius: 12px; pointer-events: none; white-space: nowrap; }
body.has-pad .tk-padhint { display: none; }
body.photo-mode .tk-hud { display: none; }
/* the HUD belongs to the running race only: any menu screen over it (results, podium, pause, loading, replay) hides
   it and the split-screen seat labels - one rule for desktop, touch and split-screen (menus.js sets data-screen) */
body[data-screen]:not([data-screen='']) .tk-hud, body[data-screen]:not([data-screen='']) .tk-split > .tk-seat, body[data-screen]:not([data-screen='']) .tk-split-board { visibility: hidden; }
.tk-photo { pointer-events: none; }
.tk-photo .tk-card { pointer-events: auto; }
.tk-photo input[type="range"] { width: 100%; }
.split-race .tk-hud, .split-race .tk-speedlines { display: none; }
.tk-split { position: fixed; inset: 0; z-index: var(--z-split); pointer-events: none; display: grid; grid-template: repeat(2, 1fr) / repeat(2, 1fr); color: white; text-shadow: 0 2px 4px #111; }
.tk-split.count-2 { grid-template-columns: 1fr; }
.tk-seat { position: relative; padding: 14px; border: 2px solid #202433; display: flex; align-items: start; flex-direction: column; gap: 5px; font-size: clamp(12px, 1.5vw, 20px); }
.tk-seat > b, .tk-seat > div { background: #202433c9; padding: 4px 10px; border-radius: 8px; }
.tk-seat > strong { position: absolute; top: 40%; align-self: center; font-size: 3em; }
.tk-split-board { background: #202433; white-space: pre-line; display: grid; place-content: center; line-height: 1.8; font-size: 20px; }
.photo-mode .tk-split { display: none; }
