/* Desktop styles (data-device="desktop", set by js/device.js). Loaded after css/style.css, so these rules
   win over the phone rules of the same specificity. Everything here is scoped to the desktop device or to
   the scaled stage (.desk-stage), so phones are untouched. Read "Desktop styles" in js/README.md first. */

/* The lobby "?" cue (see the phone rules in style.css): the same dot and pulsing ring on the desktop button */
.desk-lobby .help-cue { position: relative; }
.desk-lobby .help-cue::after { content: ""; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #d63031; border: 2px solid var(--bg); box-sizing: border-box; }
.desk-lobby .help-cue-pulse::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 2.5px solid var(--good); pointer-events: none; animation: help-cue-ring 1.8s ease-out 6 both; animation-delay: var(--cue-spent, 0s); }
@media (prefers-reduced-motion: reduce) { .desk-lobby .help-cue-pulse::before { animation: none; display: none; } }

/* ================================================================
   Desktop (data-device="desktop", set by js/device.js). Desktop screens are drawn on a
   1440x900 stage that js/device.js scales to fit the window through --desk-scale (fitDesktopStage);
   the page background shows around it. The menu, Join / Create, the tutorial, the lobby and the
   message screens have a desktop layout; the game screens still use the phone column. Everything here is scoped to the desktop device,
   so phones are untouched.
   ================================================================ */
:root[data-device="desktop"] { --desk-shadow: 0 5px 0 rgba(0, 0, 0, 0.28); --desk-card-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); }
:root[data-device="desktop"][data-theme="dark"] { --desk-shadow: 0 5px 0 rgba(0, 0, 0, 0.5); --desk-card-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
:root[data-device="desktop"] .screen.desk-screen { max-width: none; padding: 0; overflow: hidden; display: block; }
.desk-stage { position: absolute; left: 50%; top: 50%; width: 1440px; height: 900px; transform: translate(-50%, -50%) scale(var(--desk-scale, 1)); transform-origin: center; font-family: 'Inter', sans-serif; }
.desk-small-note { display: none; }
:root.desk-small .screen.desk-screen .desk-stage { display: none; }
:root.desk-small .screen.desk-screen .desk-small-note { position: absolute; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; font: 700 18px/1.3 'Space Grotesk', sans-serif; color: var(--ink); background: var(--bg); }

/* main menu */
.desk-stage .desk-card { position: absolute; width: 150px; height: 225px; border-radius: 16px; display: flex; align-items: center; justify-content: center; box-shadow: var(--desk-card-shadow); }
.desk-stage .desk-card.ink-light { color: #fff; }
.desk-stage .desk-card.ink-dark { color: #161616; }
.desk-stage .desk-card svg { display: block; width: 46%; height: auto; margin-bottom: 6%; }
.desk-stage .intro-top { position: absolute; left: 32px; right: 32px; top: 28px; z-index: 5; }
.desk-stage .top-left-group { gap: 10px; }
.desk-stage .language-pill { height: 40px; gap: 8px; padding: 0 14px; color: var(--ink); font: 600 14px Inter, sans-serif; letter-spacing: 0; }
.desk-stage .language-caret { font-size: 10px; }
.desk-stage .language-control select { cursor: pointer; }
.desk-stage .settings-btn { width: 40px; height: 40px; color: var(--ink); cursor: pointer; }
.desk-stage .settings-btn svg { width: 18px; height: 18px; }
.desk-stage .theme-switch button { min-height: 34px; padding: 0 18px; font-size: 14px; }
.desk-stage .intro-hero { position: absolute; left: 0; top: 70px; z-index: 2; width: 1440px; padding: 0; overflow: visible; }
.desk-stage .flub-hero { width: 520px; max-width: none; max-height: none; height: auto; }
.desk-stage .intro-bottom { position: absolute; left: 50%; top: 575px; z-index: 2; width: 380px; margin: 0; transform: translateX(-50%); gap: 14px; }
.desk-stage .action-btn.primary { height: 68px; margin: 0; padding: 0; border-radius: 16px; background: var(--ink); color: var(--bg); font: 700 22px 'Space Grotesk', sans-serif; box-shadow: var(--desk-shadow); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.desk-stage .action-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(0, 0, 0, 0.28); }
.desk-stage .action-btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28); }
.desk-stage .how-to-play-btn { height: 56px; min-height: 0; margin: 0; gap: 10px; border-radius: 16px; background: var(--panel-2); font: 700 17px 'Space Grotesk', sans-serif; transition: border-color 0.12s ease; }
.desk-stage .how-to-play-btn:hover { border-color: var(--ink-dim); }
.desk-stage .how-to-play-btn:active { background: var(--panel-2); }
.desk-stage .action-btn.primary:focus-visible,
.desk-stage .how-to-play-btn:focus-visible,
.desk-stage .install-app-btn:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
.desk-stage .install-app-btn { align-self: center; width: auto; margin: 0; padding: 6px; border: 0; border-radius: 6px; background: none; color: var(--ink-dim); font: 600 14px Inter, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.desk-stage .install-app-btn:hover { color: var(--ink); }
.desk-stage .install-help { font-size: 13px; line-height: 1.5; text-align: center; color: var(--ink-dim); }

/* main menu Settings: a small popover under the gear, not a pull-up sheet */
.desk-stage .players-scrim { z-index: 20; background: transparent; transition: none; }
.desk-stage .settings-sheet { left: 90px; right: auto; top: 80px; bottom: auto; z-index: 21; width: 300px; max-height: none; padding: 8px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3); transform: translateY(-6px); opacity: 0; transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s; }
.desk-stage .settings-sheet.open { transform: none; opacity: 1; transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s; }
.desk-stage .settings-sheet::before,
.desk-stage .settings-sheet .players-sheet-grab,
.desk-stage .settings-sheet .players-sheet-hd { display: none; }
.desk-stage .settings-sheet .settings-row { min-height: 0; padding: 12px 10px; border: 0; border-radius: 0; background: none; font: 600 15px 'Space Grotesk', sans-serif; cursor: pointer; }
.desk-stage .settings-sheet .settings-row + .settings-row { margin-top: 0; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) {
  .desk-stage .action-btn.primary, .desk-stage .how-to-play-btn, .desk-stage .settings-sheet { transition: none; }
}
/* The portrait-only guard is for phones: a desktop window can be any shape. */
@media (orientation: landscape) and (max-height: 500px) {
  :root[data-device="desktop"] .rotate-guard { display: none; }
  :root[data-device="desktop"] .screen { display: flex; }
  :root[data-device="desktop"] .screen.desk-screen { display: block; }
}

/* Desktop Join / Create screen */
.desk-stage .desk-back { position: absolute; left: 360px; top: 70px; z-index: 3; padding: 8px 0; border: 0; background: transparent; color: var(--ink-dim); font: 600 15px Inter, sans-serif; cursor: pointer; }
.desk-stage .desk-back:hover { color: var(--ink); }
.desk-stage .desk-back:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
.desk-stage .desk-join-col { position: absolute; left: 360px; top: 112px; width: 720px; display: flex; flex-direction: column; gap: 20px; }
.desk-stage .desk-panel { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px 32px; border-radius: 28px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); }
.desk-stage .desk-peek { position: absolute; right: 32px; top: -44px; width: 84px; height: 80px; line-height: 0; animation: desk-peek 0.7s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.desk-stage .desk-peek svg { width: 100%; height: 100%; }
@keyframes desk-peek { 0% { transform: translateY(14px) rotate(-8deg); } 60% { transform: translateY(-4px) rotate(3deg); } 100% { transform: none; } }
.desk-stage .online-mode-switch { margin: 0; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); }
.desk-stage .online-mode-switch button { min-height: 0; height: 48px; border-radius: 10px; font: 600 15px Inter, sans-serif; }
.desk-stage .online-mode-switch button:hover:not(.active) { color: var(--ink); }
.desk-stage .online-mode-switch button.active { background: var(--panel-2); box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18); }
.desk-stage .desk-field label { display: block; margin-bottom: 8px; color: var(--ink-dim); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.desk-stage .desk-panel input[type=text] { width: 100%; height: 60px; padding: 0 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 22px Inter, sans-serif; }
.desk-stage .desk-panel input[type=text]::placeholder { color: var(--ink-dim); opacity: 0.7; }
.desk-stage #codeIn:focus, .desk-stage #nameIn:focus { outline: 2px solid var(--good); outline-offset: 2px; border-color: var(--line); }
.desk-stage .room-word { position: relative; display: block; border: 0; border-radius: 0; background: none; overflow: visible; }
.desk-stage .room-word input[type=text] { padding-right: 110px; background: var(--bg); }
.desk-stage .room-word-tag { position: absolute; right: 8px; top: 8px; height: 44px; padding: 0 14px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--panel-2); color: var(--ink); font: 700 19px 'Space Grotesk', sans-serif; letter-spacing: 0.08em; }
.desk-stage .desk-code-line { margin-top: -6px; color: var(--ink-dim); font-size: 14px; line-height: 1.5; }
.desk-stage .desk-code-line b { color: var(--ink); }
.desk-stage .desk-opts { display: flex; flex-direction: column; gap: 12px; }
.desk-stage .desk-opts-btn { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 15px 'Space Grotesk', sans-serif; cursor: pointer; }
.desk-stage .desk-opts-btn:hover { border-color: var(--ink-dim); }
.desk-stage .desk-opts-btn:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
.desk-stage .desk-opts-sum { color: var(--ink-dim); font: 400 14px Inter, sans-serif; }
.desk-stage .desk-opts-sum span { font-size: 10px; }
.desk-stage .desk-opts-body { display: flex; flex-direction: column; gap: 14px; animation: desk-fade 0.2s ease-out both; }
@keyframes desk-fade { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: none; } }
.desk-stage .chip-row { gap: 8px; }
.desk-stage .chip { min-height: 0; padding: 10px 16px; border-radius: 99px; white-space: nowrap; background: var(--panel); color: var(--ink); font: 600 14px Inter, sans-serif; }
.desk-stage .chip:hover:not(.active) { border-color: var(--ink-dim); }
.desk-stage .chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.desk-stage .length-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.desk-stage .length-option { min-height: 0; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 18px; border-radius: 14px; }
.desk-stage .length-option span { font: 700 17px 'Space Grotesk', sans-serif; }
.desk-stage .length-option small { color: inherit; font-size: 13px; opacity: 0.75; }
.desk-stage .length-option:hover:not(.selected) { border-color: var(--ink-dim); }
.desk-stage .length-option.selected { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.desk-stage .join-status { min-height: 0; margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.4; text-align: left; }
.desk-stage .join-status.bad { color: #e5484d; font-weight: 600; }
.desk-stage .action-btn.primary:disabled { opacity: 0.6; background: var(--ink); color: var(--bg); transform: none; box-shadow: var(--desk-shadow); cursor: default; }
.desk-stage .recent-rooms { margin: 0; gap: 8px; }
.desk-stage .recent-rooms-title { margin: 0; padding: 0 4px 2px; color: var(--ink-dim); font: 600 13px Inter, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }
.desk-stage .recent-room-join { padding: 14px 18px; border-radius: 16px; }
.desk-stage .recent-room-join:hover, .desk-stage .recent-room-remove:hover { border-color: var(--ink-dim); }
.desk-stage .recent-room-code { font: 700 17px 'Space Grotesk', sans-serif; }
.desk-stage .recent-room-meta { font-size: 13px; }
.desk-stage .recent-room-remove { flex: 0 0 48px; border-radius: 14px; }

/* Wrong device: a short message and Back (phone: centered in the column, desktop: a small card) */
.wrong-device { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.wrong-device-mochi { width: 96px; line-height: 0; }
.wrong-device-mochi svg { width: 100%; height: auto; }
.wrong-device-title { margin: 0; font: 700 26px 'Space Grotesk', sans-serif; letter-spacing: -0.02em; }
.wrong-device-text { margin: 0 0 8px; color: var(--ink-dim); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.wrong-device .action-btn { margin-top: 6px; }
.desk-stage .desk-panel.wrong-device { position: absolute; left: 50%; top: 50%; width: 560px; padding: 40px 48px; gap: 16px; align-items: center; text-align: center; transform: translate(-50%, -50%); }
.desk-stage .wrong-device-mochi { width: 120px; }
.desk-stage .wrong-device-title { font-size: 28px; }
.desk-stage .wrong-device-text { font-size: 17px; }
.desk-stage .wrong-device .action-btn { align-self: stretch; }
@media (prefers-reduced-motion: reduce) { .desk-stage .desk-peek, .desk-stage .desk-opts-body { animation: none; } }

/* Desktop lobby */
.desk-lobby .flub-tiles { position: absolute; left: 0; top: 26px; width: 1440px; height: auto; margin: 0; gap: 8px; pointer-events: none; }
.desk-lobby .flub-tile { width: 34px; height: 42px; border-radius: 8px; font-size: 22px; box-shadow: none; transform: none; }
.desk-lobby .desk-col { position: absolute; top: 110px; display: flex; flex-direction: column; }
.desk-lobby .desk-col-left { left: 160px; width: 440px; gap: 20px; }
.desk-lobby .desk-col-right { left: 660px; width: 620px; gap: 14px; }
.desk-lobby .desk-box { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 28px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); }
.desk-lobby .desk-card-lbl { color: var(--ink-dim); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.desk-lobby .desk-code { font: 700 56px/1 'Space Grotesk', sans-serif; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.desk-lobby .desk-code.long { font-size: 40px; }
.desk-lobby .desk-code.xlong { font-size: 28px; }
.desk-lobby .desk-code-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.desk-lobby .desk-sec-btn { height: 52px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); color: var(--ink); font: 700 15px 'Space Grotesk', sans-serif; cursor: pointer; }
.desk-lobby .desk-sec-btn:hover { border-color: var(--ink-dim); }
.desk-lobby .desk-sec-btn:focus-visible, .desk-lobby .desk-kick:focus-visible, .desk-lobby .desk-seat:focus-visible, .desk-lobby .chip:focus-visible, .desk-lobby .length-option:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
.desk-lobby .room-code-copy-status { min-height: 18px; margin: 0; color: var(--ink-dim); font-size: 13px; }
.desk-lobby .room-code-copy-status.is-error { color: #e5484d; }
.desk-lobby .desk-card-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.desk-lobby .desk-card-hd b { font: 700 20px 'Space Grotesk', sans-serif; }
.desk-lobby .desk-card-hd span { color: var(--ink-dim); font-size: 12px; }
.desk-lobby .desk-field { display: flex; flex-direction: column; gap: 8px; }
.desk-lobby .desk-field-lbl { color: var(--ink-dim); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.desk-lobby .chip:disabled, .desk-lobby .length-option:disabled { cursor: default; opacity: 0.55; }
.desk-lobby .chip.active:disabled, .desk-lobby .length-option.selected:disabled { opacity: 1; }
.desk-lobby .desk-note { color: var(--ink-dim); font-size: 13px; line-height: 1.4; }
.desk-lobby .desk-players-hd { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
.desk-lobby .desk-players-hd b { font: 700 24px 'Space Grotesk', sans-serif; }
.desk-lobby .desk-players-hd span { color: var(--ink-dim); font-size: 14px; font-weight: 600; }
.desk-lobby .desk-peers { display: flex; flex-direction: column; gap: 8px; }
.desk-lobby .desk-peer { display: flex; align-items: center; gap: 14px; height: 64px; box-sizing: border-box; padding: 0 14px 0 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.desk-lobby .desk-peer.ready { border-color: var(--good); }
.desk-lobby .desk-peer.off { opacity: 0.7; }
.desk-lobby .desk-peer-av { position: relative; flex: none; width: 44px; height: 42px; line-height: 0; }
.desk-lobby .desk-peer-av svg { position: absolute; left: 50%; top: 0; width: auto; height: 42px; transform: translateX(-50%); overflow: visible; }
.desk-lobby .desk-peer-nm { font: 700 18px 'Space Grotesk', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-lobby .desk-badge { flex: none; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--ink-dim); font-size: 12px; font-weight: 600; }
.desk-lobby .desk-badge.host { background: var(--ink); color: var(--bg); }
.desk-lobby .desk-peer-status { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; color: var(--ink-dim); font: 600 14px Inter, sans-serif; }
.desk-lobby .desk-peer.ready .desk-peer-status { color: var(--good); }
.desk-lobby .desk-peer-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; }
.desk-lobby .desk-peer.ready .desk-peer-status .dot { background: #26de81; }
.desk-lobby .desk-peer.off .desk-peer-status .dot { background: #8a8f98; animation: desk-pulse 1.2s infinite; }
@keyframes desk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.desk-lobby .desk-kick { flex: none; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink-dim); font: 600 13px Inter, sans-serif; cursor: pointer; }
.desk-lobby .desk-kick:hover { border-color: var(--ink-dim); color: var(--ink); }
.desk-lobby .desk-seat { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; border: 2px dashed var(--line); border-radius: 18px; background: transparent; color: var(--ink-dim); font: 600 15px Inter, sans-serif; cursor: pointer; }
.desk-lobby .desk-seat span { font-size: 20px; }
.desk-lobby .desk-seat:hover { border-color: var(--ink-dim); color: var(--ink); }
.desk-lobby .desk-notice { padding: 10px 14px; border-radius: 12px; background: #f1c40f; color: #161616; font: 600 14px Inter, sans-serif; text-align: center; }
.desk-lobby .stage-label { margin: 0; text-align: center; font-size: 14px; }
.desk-lobby .desk-hint { margin-top: 8px; color: var(--ink-dim); font-size: 14px; line-height: 1.4; text-align: center; }
.desk-stage .action-btn.primary.is-ready { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.desk-lobby .action-btn.primary:disabled { cursor: not-allowed; opacity: 0.55; }
.desk-lobby .settings-sheet { left: 132px; }
@media (prefers-reduced-motion: reduce) { .desk-lobby .desk-peer.off .desk-peer-status .dot { animation: none; } }

/* Desktop lobby: How to play pop-up (fixed over the whole window, the panel scales with the stage) */
.desk-modal-scrim { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); }
.desk-modal { width: 520px; box-sizing: border-box; padding: 32px; display: flex; flex-direction: column; gap: 24px; border-radius: 24px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); transform: scale(var(--desk-scale, 1)); animation: desk-modal-in 0.25s ease-out both; }
@keyframes desk-modal-in { 0% { opacity: 0; translate: 0 8px; } 100% { opacity: 1; translate: 0 0; } }
.desk-modal-hd { display: flex; align-items: center; justify-content: space-between; }
.desk-modal-hd h2 { margin: 0; font: 700 28px 'Space Grotesk', sans-serif; }
.desk-modal-x { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--panel-2); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer; }
.desk-rules { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.desk-rules li { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 14px; background: var(--panel-2); font-size: 17px; line-height: 1.35; }
.desk-rule-ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 18px 'Space Grotesk', sans-serif; }
.desk-modal-full { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); font: 700 16px 'Space Grotesk', sans-serif; cursor: pointer; }
.desk-modal-full:hover, .desk-modal-x:hover { border-color: var(--ink-dim); }
.desk-modal-x:focus-visible, .desk-modal-full:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
:root.desk-small .desk-modal-scrim { display: none; }
@media (prefers-reduced-motion: reduce) { .desk-modal { animation: none; } }

/* game table (js/desk/game.js): your card, the deck and the opponents on the left, standings on the right */
:root[data-device="desktop"] { --desk-glow: rgba(28, 27, 25, 0.28); }
:root[data-device="desktop"][data-theme="dark"] { --desk-glow: rgba(255, 255, 255, 0.45); }
.desk-game-title { position: absolute; left: 0; right: 0; top: 28px; z-index: 4; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--ink); font: 700 18px 'Space Grotesk', sans-serif; pointer-events: none; }
.desk-score { display: flex; align-items: center; height: 40px; box-sizing: border-box; padding: 0 18px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); font: 700 16px 'Space Grotesk', sans-serif; }
.desk-score .pts-icon { width: 16px; height: 16px; }
.desk-score.bump { animation: desk-bump 0.42s ease-out 1.05s both; } /* when the +1 arrives (js: playPointFlight) */
.desk-table { position: absolute; left: 0; width: 1140px; height: 784px; }
.desk-lbl { position: absolute; color: var(--ink-dim); font: 600 12px Inter, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.desk-divider { position: absolute; width: 1px; background: var(--ink-dim); opacity: 0.45; }

.desk-tile { position: absolute; z-index: 1; display: flex; flex-direction: column; transition: opacity 0.2s ease, filter 0.2s ease; }
.desk-tile.is-racer { z-index: 3; }
.desk-tile.is-dim { opacity: 0.35; filter: grayscale(0.7); }
.desk-tile.is-off { opacity: 0.45; filter: grayscale(1); }
.desk-pcard { position: relative; flex: 1; min-height: 0; container-type: inline-size; box-sizing: border-box; border-radius: 16px; display: flex; flex-direction: column; align-items: center; }
.desk-pcard.ink-light { color: #fff; }
.desk-pcard.ink-dark { color: #161616; }
.desk-tile.is-me .desk-pcard { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.desk-tile.is-me .desk-pcard.ink-dark { box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.desk-tile.is-racer .desk-pcard { transform: scale(1.03); box-shadow: 0 0 0 3px var(--ink), 0 0 24px var(--desk-glow), 0 16px 36px var(--desk-glow); }
.desk-tile.is-pulse .desk-pcard { animation: desk-pulse 0.6s ease-out; }
.desk-pc-topic { flex: none; width: 100%; box-sizing: border-box; height: 52cqw; padding: 18cqw 10cqw 0; display: flex; align-items: flex-start; justify-content: center; text-align: center; font: 700 12.5cqw/1.1 'Space Grotesk', sans-serif; text-wrap: balance; overflow-wrap: anywhere; }
.desk-pc-topic.t1 { font-size: 10.5cqw; }
.desk-pc-topic.t2 { font-size: 9cqw; }
.desk-pc-topic.t3 { font-size: 8cqw; }
.desk-pc-topic.t4 { font-size: 7.2cqw; }
.desk-pc-topic.small { height: auto; padding: 8cqw 6cqw 0; font-size: 9.5cqw; }
.desk-pc-glyph { flex: none; width: 46cqw; height: 46cqw; margin: 16cqw auto auto; }
.desk-pc-glyph svg { display: block; width: 100%; height: 100%; }
.desk-pcard-count { background: var(--ink); color: var(--bg); }
.desk-pc-count { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font: 700 46cqw/1 'Space Grotesk', sans-serif; }
.desk-pcard-empty { justify-content: center; border: 2px dashed var(--ink-dim); opacity: 0.6; color: var(--ink-dim); font: 600 14px/1.4 Inter, sans-serif; text-align: center; padding: 0 16px; }
.desk-tag { position: absolute; top: -12px; left: 50%; z-index: 4; transform: translateX(-50%); padding: 3px 10px; border-radius: 99px; background: var(--ink); color: var(--bg); font: 700 11px Inter, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.desk-cap { flex: none; height: 34px; box-sizing: border-box; margin-top: 6px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 6px; border-radius: 99px; font: 600 14px Inter, sans-serif; color: var(--ink); }
.desk-cap.turn { background: var(--ink); color: var(--bg); font-weight: 700; }
.desk-cap-n { width: 16px; flex: none; text-align: center; font-size: 12px; opacity: 0.6; }
.desk-cap-av { width: 26px; height: 26px; flex: none; }
.desk-cap-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-cap-pt .pts-badge { gap: 4px; font-size: 13px; }
.desk-cap-pt .pts-icon { width: 12px; height: 12px; }

.desk-pile { position: absolute; z-index: 1; container-type: inline-size; box-sizing: border-box; border-radius: 16px; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; background: var(--ink); color: var(--bg); box-shadow: 6px 6px 0 var(--line), 12px 12px 0 var(--line); transition: opacity 0.2s ease, filter 0.2s ease; }
.desk-pile.glow { box-shadow: 6px 6px 0 var(--line), 12px 12px 0 var(--line), 0 0 0 4px var(--bg), 0 0 0 7px var(--ink); }
.desk-pile.is-dim { opacity: 0.35; filter: grayscale(0.7); }
.desk-pile-top { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.desk-pile-logo { font: 700 14px 'Space Grotesk', sans-serif; letter-spacing: 0.3em; margin-right: -0.3em; }
.desk-pile-cat { font-size: 12px; opacity: 0.8; }
.desk-pile-title { padding: 0 8px; text-align: center; text-wrap: balance; font: 700 28px/1.1 'Space Grotesk', sans-serif; }
.desk-pile-title.small { font-size: 9.5cqw; padding: 0; }
.desk-pile-title.long { font-size: 20px; }
.desk-pile-left { font-size: 12px; opacity: 0.75; }
.desk-pile-btn { position: relative; overflow: hidden; width: 100%; height: 56px; border: 0; border-radius: 16px; background: var(--bg); color: var(--ink); font: 700 18px 'Space Grotesk', sans-serif; cursor: pointer; transition: transform 0.12s ease; }
.desk-pile-btn.big { height: 64px; font-size: 24px; }
.desk-pile-btn span { position: relative; z-index: 1; }
.desk-pile-btn:hover:not(:disabled) { transform: translateY(-2px); }
.desk-pile-btn:disabled { cursor: default; opacity: 0.7; }
.desk-pile-btn.locked::before { content: ""; position: absolute; inset: 0; background: rgba(127, 127, 127, 0.4); transform-origin: left; animation: desk-lock var(--lock-left, 0ms) linear both; }
.desk-pile-btn:focus-visible, .desk-vote:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
.desk-pile-vote { z-index: 3; box-shadow: 0 0 0 3px var(--ink), 0 16px 36px var(--desk-glow); }
.desk-pile-tie { z-index: 3; padding: 0; justify-content: flex-start; transform: scale(1.03); box-shadow: 0 0 0 3px var(--ink), 0 0 24px var(--desk-glow), 0 16px 36px var(--desk-glow); } /* same size and look as the racers' countdown cards */
.desk-pile-sub { font-size: 7cqw; line-height: 1.4; text-align: center; opacity: 0.8; }
.desk-vote-row { width: 100%; display: flex; flex-direction: column; gap: 4cqw; }
.desk-vote { padding: 6cqw 2cqw; border: 1.5px solid currentColor; border-radius: 6cqw; background: transparent; color: inherit; font: 700 8cqw 'Space Grotesk', sans-serif; cursor: pointer; }
.desk-vote:disabled { opacity: 0.5; cursor: default; }
.desk-vote.is-selected { background: var(--good); border-color: var(--good); color: var(--good-ink); }
.desk-vote.is-conflict { background: #e5484d; border-color: #e5484d; color: #fff; }

.desk-side { position: absolute; left: 1140px; top: 72px; bottom: 52px; width: 300px; box-sizing: border-box; padding: 47px 24px 24px; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); }
.desk-side-hd { margin-bottom: 12px; color: var(--ink-dim); font: 500 13px Inter, sans-serif; }
.desk-stand { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.desk-st-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 30px; box-sizing: border-box; padding: 3px 10px 3px 8px; border-radius: 8px; font: 600 15px Inter, sans-serif; color: var(--ink); }
.desk-st-row.me { background: var(--line); }
.desk-st-row.off { opacity: 0.5; filter: grayscale(1); }
.desk-st-rank { width: 14px; flex: none; text-align: center; color: var(--ink-dim); font-size: 13px; }
.desk-st-av { width: 28px; height: 28px; flex: none; }
.desk-st-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-st-turn { flex: none; padding: 2px 8px; border-radius: 99px; background: var(--ink); color: var(--bg); font: 700 10px Inter, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
.desk-st-pt { margin-left: auto; font-weight: 700; }
.desk-st-plus { position: absolute; right: 12px; top: -9px; z-index: 2; padding: 1px 7px; border-radius: 99px; background: var(--good); color: var(--good-ink); font: 700 11px Inter, sans-serif; animation: desk-st-plus 1.8s ease-out both; }
.desk-st-row.gain .desk-st-pt { animation: desk-bump 0.7s ease-out 0.1s both; }
.desk-st-row.gain { animation: desk-st-gain 1.8s ease-out backwards; }
.desk-st-row.slide { animation: desk-st-slide 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) backwards; }
.desk-st-row.gain.slide { animation: desk-st-slide 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) backwards, desk-st-gain 1.8s ease-out backwards; }
.desk-ring { margin-top: auto; margin-bottom: 24px; display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); }
.desk-ring svg { width: 80px; height: 80px; flex: none; }
.desk-ring circle { fill: none; stroke-width: 8; }
.desk-ring .trk { stroke: var(--ink-dim); opacity: 0.3; }
.desk-ring .val { stroke: var(--ink); stroke-linecap: round; }
.desk-ring b { display: block; color: var(--ink); font: 700 30px/1.1 'Space Grotesk', sans-serif; }
.desk-ring span { color: var(--ink-dim); font-size: 13px; }
.desk-keys { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; box-sizing: border-box; padding: 0 24px; display: flex; align-items: center; justify-content: flex-end; gap: 22px; border-top: 1px solid var(--line); color: var(--ink-dim); font: 500 13px Inter, sans-serif; }
.desk-key { display: flex; align-items: center; gap: 8px; opacity: 0.55; }
.desk-key.on { opacity: 1; color: var(--ink); }
.desk-key kbd { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font: 600 13px Inter, sans-serif; }
.desk-key.on kbd { border-color: transparent; background: var(--ink); color: var(--bg); font-weight: 700; }
/* a newly drawn card: yours flips in, the others pop in (no 100% step, so it ends on the normal look) */
.desk-tile.is-new .desk-pcard { animation: desk-pop 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) backwards; }
.desk-tile.is-new.is-mine .desk-pcard { animation: desk-flip 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) backwards; }
.desk-tile.is-new.is-pulse .desk-pcard { animation-name: desk-pop, desk-pulse; animation-duration: 0.3s, 0.6s; animation-delay: 0s, 0.3s; animation-fill-mode: backwards, none; }
.desk-tile.is-new.is-mine.is-pulse .desk-pcard { animation-name: desk-flip, desk-pulse; animation-duration: 0.42s, 0.6s; animation-delay: 0s, 0.42s; }
@keyframes desk-flip { 0% { transform: perspective(700px) rotateY(88deg) scale(0.92); opacity: 0.2; } 60% { transform: perspective(700px) rotateY(-8deg) scale(1.03); opacity: 1; } }
@keyframes desk-pop { 0% { transform: scale(0.96); opacity: 0.35; } 60% { transform: scale(1.01); opacity: 1; } }
/* emotes: the panel under the ring, and the bubble on the sender's card */
.desk-emotes { display: flex; flex-direction: column; gap: 8px; }
.desk-emo-hd { display: flex; align-items: center; justify-content: space-between; height: 44px; box-sizing: border-box; padding: 0 12px 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--ink); font: 600 14px Inter, sans-serif; cursor: pointer; }
.desk-emo-hd kbd { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; font: 600 12px Inter, sans-serif; color: var(--ink-dim); }
.desk-emo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.desk-emo { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 72px; box-sizing: border-box; padding: 8px 4px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--ink-dim); font: 600 12px Inter, sans-serif; cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease; }
.desk-emo .mochi { width: 36px; height: 36px; flex: none; }
.desk-emo:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--ink-dim); color: var(--ink); }
.desk-emo:disabled { opacity: 0.45; cursor: default; }
.desk-emo-hd:focus-visible, .desk-emo:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
.desk-bubble { position: absolute; top: -18px; right: -10px; z-index: 5; width: 44px; height: 44px; box-sizing: border-box; padding: 4px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); box-shadow: 0 4px 12px var(--desk-glow); animation: desk-bubble-pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both, desk-bubble-fade 3s linear both; pointer-events: none; }
@keyframes desk-bubble-pop { 0% { transform: scale(0.2) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.18) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes desk-bubble-fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* end screen (js/desk/end.js): over the table area, the standings column stays */
.desk-end { position: absolute; left: 0; top: 72px; width: 1140px; height: 776px; box-sizing: border-box; padding: 0 64px; display: flex; align-items: center; justify-content: center; gap: 96px; color: var(--ink); }
.desk-end-left { width: 380px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.desk-end-mochi { width: 220px; height: 238px; flex: none; animation: desk-bubble-pop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.desk-end-left h1 { margin: 0; font: 700 44px/1.05 'Space Grotesk', sans-serif; }
.desk-end-result { font: 600 22px/1.2 'Space Grotesk', sans-serif; text-wrap: balance; }
.desk-end-sub { color: var(--ink-dim); font-size: 14px; }
.desk-end-right { width: 460px; display: flex; flex-direction: column; gap: 24px; }
.desk-end-rows { display: flex; flex-direction: column; gap: 6px; }
.desk-end-row { display: flex; align-items: center; gap: 12px; min-height: 52px; box-sizing: border-box; padding: 8px 14px; border-radius: 12px; background: var(--panel-2); color: var(--ink); animation: desk-end-row 0.4s ease-out both; }
.desk-end-row.first { background: var(--ink); color: var(--bg); }
.desk-end-rank { width: 22px; flex: none; font-weight: 700; opacity: 0.7; }
.desk-end-av { width: 30px; height: 29px; flex: none; }
.desk-end-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 16px; }
.desk-end-tag { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.desk-end-pt { margin-left: auto; flex: none; font-weight: 700; font-size: 16px; }
.desk-end-btns { display: flex; gap: 10px; }
.desk-end-btn { flex: 1; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink); font: 700 17px 'Space Grotesk', sans-serif; cursor: pointer; transition: transform 0.12s ease; }
.desk-end-btn.primary { border: 0; background: var(--ink); color: var(--bg); }
.desk-end-btn:hover { transform: translateY(-2px); }
.desk-end-btn:focus-visible { outline: 2px solid var(--good); outline-offset: 2px; }
.desk-end-confetti { position: absolute; left: 292px; top: 250px; width: 0; height: 0; z-index: 3; pointer-events: none; }
.desk-end-confetti i { position: absolute; left: 0; top: 0; }
.desk-end-confetti b { display: block; width: 10px; height: 14px; border-radius: 2px; animation-name: desk-conf-a; animation-timing-function: ease-out; animation-fill-mode: both; }
.desk-end-confetti b.c1 { animation-name: desk-conf-b; }
.desk-end-confetti b.c2 { animation-name: desk-conf-c; }
@keyframes desk-conf-a { 0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; } 100% { transform: translateY(-220px) rotate(540deg) scale(0.6); opacity: 0; } }
@keyframes desk-conf-b { 0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; } 100% { transform: translateY(-300px) rotate(540deg) scale(0.6); opacity: 0; } }
@keyframes desk-conf-c { 0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; } 100% { transform: translateY(-380px) rotate(540deg) scale(0.6); opacity: 0; } }
@keyframes desk-end-row { from { opacity: 0; transform: translateX(16px); } }
@keyframes desk-st-gain { 0% { box-shadow: inset 0 0 0 2px var(--good); background: color-mix(in srgb, var(--good) 35%, transparent); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
@keyframes desk-st-plus { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes desk-st-slide { from { transform: translateY(var(--dy)); } }
@keyframes desk-bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.25); } }
@keyframes desk-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.09); } 100% { transform: scale(1.03); } }
@keyframes desk-lock { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .desk-end-mochi, .desk-end-row, .desk-end-confetti b, .desk-bubble, .desk-emo, .desk-st-row, .desk-st-plus, .desk-st-row.gain .desk-st-pt, .desk-tile.is-new .desk-pcard, .desk-score.bump, .desk-tile.is-pulse .desk-pcard, .desk-pile-btn.locked::before { animation: none; } }
