/* The Gang — Midnight edition. Layout in normal flow, at every player count. */
:root {
    color-scheme: dark;
    --tg-ink: #091714;
    --tg-panel: #102520;
    --tg-felt: #143c32;
    --tg-gold: #d9bd83;
    --tg-text: #f5f0e5;
    --tg-muted: #b1c2b9;
    --tg-line: rgba(217, 189, 131, .24);
}
html[data-theme="bleu"] { --tg-ink: #0a1420; --tg-panel: #111f30; --tg-felt: #17334b; --tg-muted: #b2c2d3; }
html[data-theme="gris"] { --tg-ink: #121719; --tg-panel: #202629; --tg-felt: #30393a; --tg-muted: #bec5c5; }
html[data-theme="rose"] { --tg-ink: #201218; --tg-panel: #301e28; --tg-felt: #462735; --tg-muted: #d0b9c4; }
html { background: var(--tg-ink); }
html.tg-noir body {
    height: auto;
    min-height: 100svh;
    color: var(--tg-text);
    background: linear-gradient(180deg, rgba(6, 15, 14, .60), var(--tg-ink) 1100px), url('/images/gang/noir-vault.webp') center top / cover fixed;
    font-family: 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--tg-gold); outline-offset: 4px; }
.tg-eyebrow, .tg-section-label {
    display: block;
    color: var(--tg-gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .19em;
    line-height: 1.6;
}
.tg-hint, .tg-subtitle, .tg-cross-link, .tg-log-entry-system { color: var(--tg-muted); line-height: 1.55; }
.tg-row label, .tg-toggle-title { color: var(--tg-text); }
.tg-btn, .tg-hud-btn-secondary {
    min-height: 42px;
    border: 1px solid var(--tg-line);
    border-radius: 5px;
    background: var(--tg-panel);
    color: var(--tg-text);
    transition: background .18s, border-color .18s, transform .18s;
}
.tg-btn:hover, .tg-hud-btn-secondary:hover { background: var(--tg-felt); border-color: var(--tg-gold); }
.tg-btn-primary, .tg-hud-btn:not(.tg-hud-btn-secondary) {
    background: linear-gradient(115deg, #e6cfa0, #c6a565);
    color: #18211c;
    border: 1px solid #e8d5af;
    border-radius: 5px;
    font-weight: 750;
    min-height: 42px;
}
.tg-btn-primary:hover { background: #ead4a7; }
.tg-btn:active, .tg-token-clickable:active { transform: translateY(1px); }
.tg-row input[type="text"], .tg-settings-select, .tg-chat-form input {
    background: rgba(3, 13, 11, .65);
    border-color: var(--tg-line);
    border-radius: 4px;
    min-height: 44px;
    color: var(--tg-text);
}
input[type="range"] { accent-color: var(--tg-gold); min-height: 24px; }
.tg-switch-track { background: #45534c; }
.tg-switch input:checked + .tg-switch-track { background: #ab8b54; }
.tg-switch:has(input:focus-visible) { outline: 2px solid var(--tg-gold); outline-offset: 4px; border-radius: 20px; }
.tg-card, .tg-showdown-card {
    border: 1px solid var(--tg-line);
    background: rgba(10, 25, 21, .95);
    border-radius: 10px;
    box-shadow: 0 25px 100px #0005;
}
#createScreen { gap: clamp(32px, 7vw, 130px); max-width: 1440px; margin: auto; padding: 48px; }
.tg-intro { flex: 1; max-width: 700px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.tg-intro .tg-eyebrow { letter-spacing: .25em; }
.tg-intro h1 { font: 400 clamp(42px, 4.6vw, 70px)/1.06 Georgia, serif; letter-spacing: -.04em; margin: 28px 0; text-shadow: 0 3px 30px #0009; }
.tg-intro h1 em { color: #e5c996; font-weight: 400; }
.tg-intro > p { font-size: 16px; line-height: 1.8; color: #cbd3c9; }
.tg-intro-rules { display: flex; gap: 28px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--tg-line); }
.tg-intro-rules span { font-size: 12px; color: #dde2d6; }
.tg-intro-rules b { display: block; color: var(--tg-gold); font: italic 25px Georgia, serif; margin-bottom: 8px; }
.tg-intro-caption { margin-top: 80px; color: #b8c2b7; letter-spacing: .2em; font-size: 9px; }
.tg-create-card { flex: 0 0 400px; max-width: 400px; padding: 30px; backdrop-filter: blur(16px); }
.tg-create-card .tg-logo { max-width: 230px; margin: 0 auto 22px; }
.tg-create-card h2 { font: 400 28px Georgia, serif; margin-bottom: 12px; }
.tg-create-card .tg-subtitle { font-size: 13px; margin-bottom: 24px; }
.tg-create-card .tg-hint { font-size: 11px; }
.tg-create-card .tg-row { margin-bottom: 20px; }
.tg-create-card .tg-btn-primary { display: flex; justify-content: space-between; padding: 14px 18px; }

/* Briefing masthead (wordmark + "POKER COOPERATIF" stamp), crew-size row and
   the Gangster/solo option rows - markup added for the noir redesign but
   left unstyled, which is why the option icons rendered at native SVG size
   (huge) with no flex row to constrain them. */
.tg-briefing-masthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--tg-line); }
.tg-wordmark { display: flex; align-items: center; gap: 10px; }
.tg-wordmark-emblem { color: var(--tg-gold); font-size: 22px; line-height: 1; }
.tg-wordmark > span:last-child { display: flex; align-items: baseline; gap: 4px; font-family: Georgia, serif; }
.tg-wordmark small { font-size: 11px; font-weight: 400; letter-spacing: .22em; color: var(--tg-muted); }
.tg-wordmark strong { font-size: 19px; font-weight: 700; letter-spacing: .04em; color: var(--tg-text); }
.tg-briefing-edition { text-align: right; font-size: 9px; font-weight: 700; letter-spacing: .18em; line-height: 1.7; color: var(--tg-gold); white-space: nowrap; padding-top: 4px; }
.tg-briefing-heading { margin-bottom: 20px; }
.tg-crew-setting { margin: 20px 0; }
.tg-crew-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.tg-crew-heading label { font-size: 12px; color: var(--tg-text); font-weight: 600; letter-spacing: .02em; }
.tg-crew-count { font-size: 12px; color: var(--tg-muted); }
.tg-crew-count output { font: italic 17px Georgia, serif; color: var(--tg-gold); margin-right: 4px; }
.tg-crew-range { display: flex; align-items: center; gap: 12px; }
.tg-crew-range input[type="range"] { flex: 1; }
.tg-crew-range button { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--tg-line); background: rgba(3, 13, 11, .5); color: var(--tg-text); font-size: 16px; line-height: 1; padding: 0; cursor: pointer; transition: background .18s, border-color .18s; }
.tg-crew-range button:hover { background: var(--tg-felt); border-color: var(--tg-gold); }
.tg-briefing-options { display: flex; flex-direction: column; gap: 16px; margin: 22px 0; padding-top: 20px; border-top: 1px solid var(--tg-line); }
.tg-option { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.tg-option-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(217, 189, 131, .08); border: 1px solid var(--tg-line); color: var(--tg-gold); }
.tg-option-icon svg { width: 18px; height: 18px; }
.tg-option-copy { flex: 1; min-width: 0; }
.tg-option-copy .tg-toggle-title, .tg-option-copy .tg-hint { display: block; }
.tg-option-copy .tg-hint { margin-top: 2px; }
.tg-option .tg-switch { flex: 0 0 auto; }

.tg-cross-link { font-size: 12px; }
.tg-cross-link a { color: var(--tg-gold); text-underline-offset: 3px; }
.tg-card h1, .tg-showdown-card h2 { color: var(--tg-gold); }
.tg-table-screen { width: 100%; max-width: 1600px; padding: 0 32px 24px; gap: 20px; }
.tg-topbar { min-height: 78px; gap: 12px; padding: 8px 0 12px; border-bottom: 1px solid var(--tg-line); }
.tg-brand { margin-right: auto; gap: 6px; min-width: 0; }
.tg-brand-logo { width: 165px; height: auto; }
.tg-badge { margin-left: 0; background: #643342; border-radius: 3px; letter-spacing: .12em; font-size: 9px; }
.tg-heist-tracker { gap: 16px; }
.tg-vaults::before, .tg-alarms::before { font-size: 9px; font-weight: 700; letter-spacing: .1em; color: var(--tg-muted); margin-right: 5px; }
.tg-vaults::before { content: 'COFFRES'; }
.tg-alarms::before { content: 'ALARMES'; }
.tg-icon { height: 27px; width: 27px; border-radius: 5px; border-color: var(--tg-line); font: 600 13px Georgia, serif; }
.tg-icon-vault-off, .tg-icon-alarm-off { background: #0c1815; color: #63766a; }
.tg-icon-vault-on { background: var(--tg-gold); color: var(--tg-ink); box-shadow: 0 0 12px #d9bd8328; }
.tg-icon-alarm-on { background: #b54b55; color: white; }
.tg-theme-swatches { gap: 5px; }
.tg-theme-swatch { width: 20px; height: 20px; border: 1px solid #ffffff30; border-radius: 50%; box-shadow: none; }
.tg-theme-swatch[data-theme-value="vert"] { background: #245340; }
.tg-theme-swatch[data-theme-value="bleu"] { background: #274b6d; }
.tg-theme-swatch[data-theme-value="gris"] { background: #51585a; }
.tg-theme-swatch[data-theme-value="rose"] { background: #70374c; }
.tg-theme-swatch-active { outline: 1px solid var(--tg-gold); outline-offset: 3px; }
.tg-info-btn, .tg-icon-btn { min-width: 34px; height: 34px; font-style: normal; font-size: 15px; color: var(--tg-gold); border: 1px solid var(--tg-line); border-radius: 5px; background: #0b171380; }
.tg-topbar .tg-btn-small { min-height: 34px; font-size: 11px; padding: 7px 10px; }
.tg-mission-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 2px 0 4px; }
.tg-mission-header h1 { font: 400 clamp(24px, 2.5vw, 34px)/1.2 Georgia, serif; margin-top: 5px; }
.tg-stage-track { list-style: none; display: flex; gap: 0; }
.tg-stage-step { display: flex; align-items: center; gap: 8px; padding: 10px 17px; color: #a5b4ad; font-size: 12px; border-bottom: 1px solid var(--tg-line); white-space: nowrap; }
.tg-stage-step > span { font-size: 10px; opacity: .8; }
.tg-stage-step.is-current { color: var(--tg-text); background: linear-gradient(0deg, #d9bd831a, transparent); border-color: var(--tg-gold); }
.tg-stage-step.is-current > span { color: var(--tg-gold); }
.tg-stage-step.is-done { color: var(--tg-gold); }
.tg-main-layout { gap: 18px; width: 100%; }
.tg-main-column { width: 100%; gap: 12px; }
#tgTableArea { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tg-section-label { font-size: 9px; letter-spacing: .16em; color: var(--tg-muted); }
.tg-players-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: stretch; gap: 10px; }
.tg-player-card { min-width: 0; padding: 12px; border-radius: 7px; border: 1px solid var(--tg-line); background: color-mix(in srgb, var(--tg-panel) 94%, transparent); }
.tg-player-name { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; max-width: none; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.tg-seat-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 22px; height: 22px; border: 1px solid var(--tg-line); background: #d9bd830a; border-radius: 50%; font: 12px Georgia, serif; color: var(--tg-gold); }
.tg-player-card.tg-player-me { border-color: #a58d59; }
.tg-player-ready { border-color: #5e9d7f; }
.tg-player-card.tg-player-ready::after { background: #77b995; color: #112e1e; top: -6px; right: -5px; }
.tg-own-label { display: none; }
.tg-token { width: 43px; height: 43px; min-width: 43px; flex-shrink: 0; border: 3px double #0006; outline: 1px solid #ffffff12; outline-offset: 2px; box-shadow: 0 4px 0 #0005, inset 0 0 0 3px #ffffff25; font-size: 18px; font-weight: 750; }
.tg-token-empty { color: #99ada0; border: 1px dashed #91a39770; box-shadow: none; outline: none; }
.tg-token-mine { outline: 2px solid var(--tg-gold); outline-offset: 3px; }
.tg-token-locked { outline: 2px solid #c85861; }
.tg-token-yellow { background: #e6c25c; }
.tg-token-orange { background: #db955b; }
.tg-token-red { background: #ae414c; }
.tg-token-history { gap: 5px; }
.tg-token-mini { width: 20px; height: 20px; font-size: 10px; }
.tg-board { position: relative; isolation: isolate; border: 1px solid #9f98604a; border-radius: 16px; padding: 23px 26px 22px; gap: 20px; background: radial-gradient(ellipse at 50% 0%, #6b926927, transparent 70%), repeating-linear-gradient(45deg, #ffffff02 0px, #ffffff02 1px, transparent 1px, transparent 4px), var(--tg-felt); box-shadow: 0 20px 60px #0003, inset 0 0 70px #0003; }
.tg-board::before { content: ''; position: absolute; inset: 7px; border: 1px solid #d9bd8317; border-radius: 10px; z-index: -1; pointer-events: none; }
.tg-board-heading { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; }
.tg-board-heading > span:last-child { color: var(--tg-muted); font: italic 13px Georgia, serif; }
.tg-community { width: min(100%, 660px); gap: 12px; min-height: 0; justify-content: center; align-items: center; }
.tg-card-face, .tg-card-placeholder { flex: 1 1 0; min-width: 0; width: auto; height: auto; aspect-ratio: 5 / 7; padding: 0; border-radius: 7px; }
.tg-card-placeholder { position: relative; background: linear-gradient(#102a2399, #102a2399), url('/images/gang/noir-card-back.webp') center / cover; box-shadow: inset 0 0 0 1px #d9bd8333; }
.tg-card-placeholder > span { position: absolute; inset: auto 0 12%; text-align: center; color: #e3d0aa; font-size: 8px; letter-spacing: .2em; text-shadow: 0 2px 4px #000; }
.tg-pool-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 660px; width: 100%; padding-top: 2px; color: var(--tg-muted); font-size: 10px; }
.tg-pool-heading > span:first-child { font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--tg-gold); }
.tg-token-pool { max-width: 820px; border: none; box-shadow: none; background: none; padding: 0 6px 3px; gap: 15px; min-height: 46px; }
.tg-in-lobby .tg-pool-heading, .tg-in-lobby .tg-token-pool { display: none; }
.tg-tokens-closed .tg-pool-heading, .tg-tokens-closed .tg-token-pool { display: none; }
.tg-in-lobby .tg-community { max-width: 510px; opacity: .7; }
.tg-own-seat:empty { display: none; }
.tg-own-seat .tg-player-card { display: grid; grid-template-columns: minmax(130px, 1fr) auto minmax(100px, 1fr); column-gap: 24px; align-items: center; padding: 16px 30px; background: linear-gradient(110deg, #d9bd8309, transparent), var(--tg-panel); border: 1px solid #d9bd834a; }
.tg-own-seat .tg-player-name { grid-column: 1; grid-row: 1; display: block; text-align: left; align-self: end; font: 24px Georgia, serif; margin-bottom: 9px; }
.tg-own-seat .tg-own-label { display: block; font: 700 9px/1.5 'Segoe UI', sans-serif; color: var(--tg-gold); letter-spacing: .12em; margin-bottom: 12px; }
.tg-own-seat .tg-mini-cards { grid-column: 2; grid-row: 1 / 4; margin: 0; gap: 12px; }
.tg-own-seat .tg-player-hand-desc { grid-column: 1; grid-row: 2; align-self: start; justify-content: flex-start; margin-top: 0; color: var(--tg-muted); font-size: 13px; }
.tg-own-seat .tg-token { grid-column: 3; grid-row: 2; justify-self: center; align-self: start; width: 52px; height: 52px; font-size: 22px; }
.tg-own-seat .tg-token-history { grid-column: 3; grid-row: 1; align-self: end; padding-bottom: 8px; }
.tg-own-seat .tg-player-votes { grid-column: 3; }
.tg-mini-cards { gap: 7px; margin-bottom: 9px; }
.tg-mini-card-own, .tg-flip-card { flex: 0 1 72px; min-width: 0; width: 72px; height: auto; aspect-ratio: 5 / 7; border-radius: 5px; box-shadow: none; }
.tg-own-seat .tg-mini-card-own, .tg-own-seat .tg-flip-card { flex: 0 0 auto; width: clamp(92px, 8vw, 115px); height: auto; }
.tg-mini-card-own.tg-mini-card-own-focus { height: auto; box-shadow: 0 0 0 2px var(--tg-gold); }
.tg-player-hand-desc { color: var(--tg-gold); font-size: 12px; line-height: 1.4; }
/* Card indexes are outside the illustration area and cannot be cropped. */
.tg-playing-card { container-type: inline-size; display: block; width: 100%; height: 100%; position: relative; border-radius: 6px; color: #142d27; background: #f4efe2; border: 1px solid #e9dfc9; box-shadow: 0 2px 3px #0005, 0 5px 14px #0002; overflow: hidden; }
.tg-playing-card::after { content: ''; position: absolute; inset: 5%; border: 1px solid #b49a643b; border-radius: 3px; pointer-events: none; }
.tg-playing-card-red { color: #b43448; }
.tg-card-index { position: absolute; z-index: 2; top: 5%; left: 7%; display: flex; flex-direction: column; align-items: center; font: 700 27cqw/.92 Georgia, serif; gap: 3cqw; }
.tg-card-index b { font-weight: 700; letter-spacing: -.08em; padding-right: .08em; }
.tg-card-index > span { font-size: 23cqw; }
.tg-card-index-bottom { left: auto; top: auto; bottom: 5%; right: 7%; transform: rotate(180deg); }
.tg-card-art { position: absolute; inset: 14% 23%; display: flex; align-items: center; justify-content: center; }
.tg-card-emblem { font: 58cqw/1 Georgia, serif; text-shadow: 0 2px 0 #b59a6020; }
.tg-card-ace { font-size: 68cqw; }
.tg-court-art { position: absolute; inset: 1% -8%; background-image: url('/images/gang/noir-courts.webp'); background-size: 300% 100%; background-repeat: no-repeat; mix-blend-mode: multiply; }
.tg-court-11 { background-position: left center; }
.tg-court-12 { background-position: center; }
.tg-court-13 { background-position: right center; }
.tg-mini-card-content, .tg-reveal-spotlight-card-content { padding: 0; }
.tg-flip-face-back, .tg-reveal-spotlight-face-back { background-image: url('/images/gang/noir-card-back.webp'); background-size: 100% 100%; border: 1px solid #ae9359; }
.tg-table-showdown .tg-players-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tg-table-showdown .tg-player-card { min-height: 190px; }
.tg-table-showdown .tg-player-me .tg-player-name { color: var(--tg-gold); }
.tg-sabotage-sidebar { width: 175px; padding-top: 29px; }
.tg-sabotage-card { border: 1px solid #ac6d6b70; border-radius: 6px; padding: 14px; background: linear-gradient(135deg, #763d4220, transparent), var(--tg-panel); }
.tg-sabotage-name { color: #e6bbac; font-size: 12px; }
.tg-sabotage-icon { color: #d7aa83; }
.tg-sabotage-desc { max-height: none; overflow: visible; opacity: 1; margin-top: 10px; color: var(--tg-muted); font-size: 12px; line-height: 1.5; }
.tg-sabotage-card:hover .tg-sabotage-desc, .tg-sabotage-card:focus-within .tg-sabotage-desc { max-height: none; margin-top: 10px; }
.tg-actions { gap: 12px; padding: 0; }
.tg-actions .tg-btn-primary { max-width: 420px; }
.tg-actions .tg-hint { font-size: 12px; }
#tgAdvanceBtn { font-size: 11px; min-height: 34px; padding: 7px 10px; }
.tg-log-panel { border: 1px solid var(--tg-line); border-radius: 5px; background: #0a1713cc; }
.tg-log-toggle { color: var(--tg-muted); font-size: 12px; padding: 12px 16px; }
.tg-log-toggle:hover { color: var(--tg-gold); }
.tg-chat-form, .tg-log-panel.tg-log-expanded .tg-log-body { border-color: var(--tg-line); }
.tg-chat-form input { min-width: 0; }
.tg-lobby-host-controls, .tg-lobby-player-item { background: var(--tg-panel); border-color: var(--tg-line); }
.tg-lobby-host-title, .tg-ranking-title, .tg-ranking-name, .tg-scoreboard-rank { color: var(--tg-gold); }
.tg-lobby-host-row label, .tg-ranking-scale, .tg-scoreboard-players { color: var(--tg-muted); }
.tg-lobby-host-row input, .tg-lobby-host-row select { accent-color: var(--tg-gold); }
.tg-info-popover { background: #10231e; border-color: var(--tg-line); border-radius: 7px; padding: 20px; width: 355px; z-index: 65; visibility: hidden; }
.tg-info-btn.tg-info-open .tg-info-popover { display: block; opacity: 1; visibility: visible; pointer-events: auto; }
.tg-end-banner { position: relative; inset: auto; transform: none; width: 100%; max-width: none; order: -1; border-radius: 8px; justify-content: space-between; padding: 20px 26px; margin-top: 16px; background: linear-gradient(100deg, #1b392eef, #0b1715e8), url('/images/gang/noir-vault.webp') right center / cover; border-color: var(--tg-gold); }
#tgEndBannerText { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 400; color: var(--tg-muted); }
#tgEndBannerText strong { color: var(--tg-text); font: 28px Georgia, serif; }
#tgRestartTableBtn { width: auto; }
.tg-end-lost { border-color: #b26769; background: linear-gradient(100deg, #331e26f5, #161618ed), url('/images/gang/noir-vault.webp') right center / cover; }
.tg-end-lost .tg-eyebrow { color: #e2a2a6; }
html.tg-noir .tg-reveal-spotlight { background: #0c201cf5; border: 1px solid var(--tg-line); border-radius: 12px; max-width: calc(100vw - 24px); width: max-content; padding: 28px 36px; }
.tg-reveal-spotlight-name { font: 400 30px Georgia, serif; color: var(--tg-gold); }
.tg-reveal-spotlight-flip, .tg-reveal-redraw-card { width: clamp(80px, 12vw, 160px); height: auto; aspect-ratio: 5 / 7; flex-shrink: 0; }
.tg-reveal-redraw-card > .tg-card-face { width: 100%; height: 100%; }
.tg-reveal-redraw-grown { transform: scale(1); }
.tg-reveal-spotlight-desc { color: var(--tg-text); font-size: 16px; }
.tg-reveal-verdict { font: 400 clamp(32px, 6vw, 70px) Georgia, serif; max-width: calc(100vw - 32px); width: max-content; text-align: center; }
.tg-reveal-verdict-fail { color: #ffb4b4; padding: 24px 36px; border: 1px solid #b26769; background: #281319ee; border-radius: 8px; }
.tg-toast { background: #dfc28a; color: #14271f; border: 1px solid #f5deaf; font-size: 13px; }
.tg-scoreboard-row { background: var(--tg-panel); border-color: var(--tg-line); }
.tg-team-page #createScreen { max-width: 600px; }
.tg-team-page .tg-create-card { flex-basis: 100%; }
@media (min-width: 1500px) { .tg-community { max-width: 720px; } }
/* Laptop screens: put the private hand beside the board to keep it in view. */
@media (min-width: 1200px) and (max-height: 850px) {
    .tg-table-screen { gap: 12px; }
    .tg-topbar { min-height: 62px; padding-block: 6px; }
    .tg-brand-logo { width: 140px; }
    .tg-mission-header h1 { font-size: 27px; }
    #tgTableArea:not(.tg-in-lobby):not(.tg-table-showdown):has(.tg-own-seat:not(:empty)) { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 10px; }
    #tgTableArea > .tg-section-label, #tgTableArea > .tg-players-row { grid-column: 1 / -1; }
    .tg-players-row > .tg-player-card:not(:has(.tg-mini-cards)) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 10px 12px; }
    .tg-players-row > .tg-player-card:not(:has(.tg-mini-cards)) .tg-player-name { grid-column: 1 / -1; grid-row: 1; margin-bottom: 6px; justify-content: flex-start; }
    .tg-players-row > .tg-player-card:not(:has(.tg-mini-cards)) .tg-token-history { grid-column: 1; grid-row: 2; justify-content: flex-start; margin: 0; }
    .tg-players-row > .tg-player-card:not(:has(.tg-mini-cards)) > .tg-token { grid-column: 2; grid-row: 2; }
    .tg-board { gap: 15px; padding: 20px; }
    .tg-community { max-width: 585px; gap: 10px; }
    .tg-own-seat .tg-player-card { height: 100%; grid-template-columns: 1fr auto; gap: 10px; padding: 20px; }
    .tg-own-seat .tg-player-name { grid-row: 1; grid-column: 1 / -1; margin: 0; font-size: 22px; align-self: start; }
    .tg-own-seat .tg-own-label { margin-bottom: 7px; }
    .tg-own-seat .tg-mini-cards { grid-row: 2; grid-column: 1 / -1; gap: 8px; justify-content: flex-start; }
    .tg-own-seat .tg-mini-card-own { width: 100px; }
    .tg-own-seat:has(.tg-mini-cards > :nth-child(3)) .tg-mini-card-own { width: 75px; }
    .tg-own-seat .tg-player-hand-desc { grid-row: 3; grid-column: 1; align-self: end; font-size: 12px; }
    .tg-own-seat .tg-token-history { grid-row: 4; grid-column: 1; justify-content: flex-start; align-self: start; padding: 0; }
    .tg-own-seat .tg-token { grid-row: 3 / 5; grid-column: 2; width: 45px; height: 45px; align-self: center; }
    .tg-sabotage-sidebar { padding-top: 25px; }
}
@media (max-width: 1150px) {
    .tg-table-screen { padding-inline: 22px; }
    .tg-topbar { gap: 10px; }
    .tg-brand-logo { width: 135px; }
    .tg-heist-tracker { gap: 10px; }
    .tg-vaults::before, .tg-alarms::before { display: none; }
    .tg-mission-header h1 { max-width: 470px; }
    .tg-stage-step { padding: 10px 12px; }
    .tg-players-row { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
    .tg-sabotage-sidebar { width: 155px; }
}
@media (max-width: 850px) {
    #createScreen { padding: 32px 24px; gap: 30px; }
    .tg-intro h1 { font-size: 42px; }
    .tg-intro-rules { flex-direction: column; gap: 15px; margin-top: 24px; }
    .tg-intro-rules b { display: inline; font-size: 17px; margin-right: 12px; }
    .tg-intro-caption { margin-top: 40px; }
    .tg-create-card { flex-basis: 350px; padding: 26px; }
    .tg-mission-header { align-items: flex-start; flex-direction: column; gap: 14px; }
    .tg-stage-track { align-self: stretch; }
    .tg-stage-step { flex: 1; justify-content: center; }
    .tg-own-seat .tg-player-card { column-gap: 16px; padding: 16px 20px; grid-template-columns: minmax(110px, 1fr) auto minmax(70px, .7fr); }
    .tg-own-seat .tg-player-name { font-size: 20px; }
    .tg-own-seat .tg-own-label { font-size: 8px; }
}
@media (max-width: 720px) {
    .tg-main-layout { flex-direction: column; }
    .tg-sabotage-sidebar { width: 100%; flex-direction: row; padding-top: 0; gap: 10px; }
    .tg-sabotage-card { width: 230px; min-width: 230px; }
    .tg-topbar { flex-wrap: wrap; }
    .tg-brand-logo { width: 140px; }
    .tg-heist-tracker { margin-left: auto; }
    .tg-hud-actions { order: 2; margin-left: auto; }
    .tg-main-column { min-width: 0; }
    .tg-board { padding: 18px; }
    .tg-community { gap: 8px; }
    .tg-board-heading { align-items: flex-start; }
    .tg-board-heading > span:last-child { font-size: 11px; text-align: right; }
    .tg-table-showdown .tg-players-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    .tg-info-popover { width: calc(100vw - 28px); max-width: 370px; }
}
@media (max-width: 600px) {
    #createScreen { flex-direction: column; gap: 28px; padding: 34px 18px 24px; }
    .tg-intro { align-self: center; }
    .tg-intro h1 { font-size: 40px; margin: 16px 0; }
    .tg-intro > p { font-size: 13px; }
    .tg-intro-rules { flex-direction: row; gap: 18px; margin-top: 24px; padding-top: 15px; }
    .tg-intro-rules span { font-size: 10px; }
    .tg-intro-rules b { display: block; margin-bottom: 6px; }
    .tg-intro-caption { display: none; }
    .tg-create-card { flex: auto; width: 100%; max-width: 430px; padding: 25px; }
    .tg-create-card .tg-logo { max-width: 190px; margin-bottom: 16px; }
    .tg-table-screen { padding: 0 14px 20px; gap: 16px; }
    .tg-topbar { gap: 9px; padding-top: 8px; }
    .tg-brand { flex-wrap: wrap; }
    .tg-brand-logo { width: 118px; }
    .tg-heist-tracker { gap: 8px; }
    .tg-icon { height: 22px; width: 22px; font-size: 11px; }
    .tg-vaults, .tg-alarms { gap: 3px; }
    .tg-theme-swatches { margin-right: auto; }
    .tg-theme-swatch { width: 18px; height: 18px; }
    .tg-topbar .tg-btn-small { font-size: 10px; padding: 7px; }
    .tg-hud-actions { flex-basis: 100%; justify-content: flex-end; }
    .tg-hud-actions:empty { display: none; }
    .tg-mission-header h1 { font-size: 25px; }
    .tg-stage-step { font-size: 11px; padding: 9px 6px; gap: 6px; }
    #tgTableArea { gap: 12px; }
    .tg-board { order: 1; }
    .tg-own-seat { order: 2; }
    .tg-section-label { order: 3; margin-top: 6px; }
    .tg-players-row { order: 4; }
    .tg-table-showdown .tg-section-label { order: 0; }
    .tg-table-showdown .tg-players-row { order: 1; }
    .tg-table-showdown .tg-board { order: 2; }
    .tg-players-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tg-player-card { padding: 10px; }
    .tg-player-name { font-size: 12px; margin-bottom: 8px; gap: 6px; }
    .tg-board { padding: 17px 10px; gap: 16px; border-radius: 10px; }
    .tg-board-heading { padding: 0 3px; gap: 14px; }
    .tg-board-heading .tg-eyebrow { font-size: 8px; white-space: nowrap; }
    .tg-board-heading > span:last-child { font-size: 10px; }
    .tg-community { gap: 5px; }
    .tg-card-face, .tg-card-placeholder { border-radius: 4px; }
    .tg-card-placeholder > span { font-size: 6px; letter-spacing: .1em; }
    .tg-playing-card { border-radius: 4px; }
    .tg-pool-heading { flex-direction: column; gap: 6px; }
    .tg-token-pool { gap: 13px; padding: 0 8px 4px; }
    .tg-own-seat .tg-player-card { grid-template-columns: minmax(0, 1fr) auto; column-gap: 15px; padding: 16px; row-gap: 12px; }
    .tg-own-seat .tg-player-name { grid-row: 1; grid-column: 1; font-size: 19px; align-self: start; margin: 0 0 8px; }
    .tg-own-seat .tg-own-label { max-width: 120px; font-size: 8px; letter-spacing: .08em; margin-bottom: 8px; }
    .tg-own-seat .tg-mini-cards { grid-column: 1; grid-row: 2 / 4; gap: 7px; justify-content: flex-start; }
    .tg-own-seat .tg-mini-card-own, .tg-own-seat .tg-flip-card { width: clamp(80px, 23vw, 110px); }
    .tg-own-seat .tg-player-hand-desc { grid-column: 2; grid-row: 1; font-size: 12px; align-self: end; justify-content: flex-end; margin-bottom: 9px; }
    .tg-own-seat .tg-token { grid-column: 2; grid-row: 3; width: 43px; height: 43px; justify-self: end; font-size: 18px; }
    .tg-own-seat .tg-token-history { grid-column: 2; grid-row: 2; justify-content: flex-end; margin-bottom: 0; padding: 0; }
    .tg-own-seat .tg-player-votes { grid-column: 1; }
    .tg-own-seat:has(.tg-mini-cards > :nth-child(3)) .tg-mini-card-own { width: clamp(60px, 19vw, 90px); }
    .tg-own-seat:has(.tg-mini-cards > :nth-child(3)) .tg-token-history { gap: 3px; }
    .tg-own-seat:has(.tg-mini-cards > :nth-child(3)) .tg-token-mini { width: 15px; height: 15px; font-size: 8px; }
    .tg-table-showdown .tg-players-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tg-table-showdown .tg-mini-card-own, .tg-table-showdown .tg-flip-card { flex-basis: 63px; }
    .tg-mini-cards:has(> :nth-child(3)) { gap: 3px; }
    .tg-reveal-spotlight-cards { gap: 9px; }
    html.tg-noir .tg-reveal-spotlight { padding: 24px 20px; }
    .tg-reveal-spotlight-flip, .tg-reveal-redraw-card { width: min(28vw, 125px); }
    .tg-reveal-spotlight-cards:has(> :nth-child(3)) .tg-reveal-spotlight-flip,
    .tg-reveal-spotlight-cards:has(> :nth-child(3)) .tg-reveal-redraw-card { width: 24vw; }
    .tg-reveal-spotlight-name { font-size: 25px; }
    .tg-reveal-spotlight-desc { font-size: 14px; }
    .tg-reveal-verdict-fail { width: calc(100vw - 32px); padding: 24px 12px; }
    .tg-end-banner { padding: 20px; margin-top: 12px; }
    #tgEndBannerText strong { font-size: 25px; }
    #tgRestartTableBtn { width: 100%; margin-top: 6px; }
    .tg-actions { flex-wrap: wrap; }
    .tg-actions .tg-hint { text-align: center; font-size: 11px; }
    .tg-lobby-host-controls { padding: 14px; }
    .tg-lobby-host-row { flex-wrap: wrap; }
}
@media (max-width: 360px) {
    /* Three revealed cards need a full row on narrow phones. */
    .tg-table-showdown:has(.tg-mini-cards > :nth-child(3)) .tg-players-row { grid-template-columns: 1fr; }
    .tg-table-showdown .tg-mini-cards:has(> :nth-child(3)) > .tg-flip-card,
    .tg-table-showdown .tg-mini-cards:has(> :nth-child(3)) > .tg-mini-card-own { flex-basis: 76px; width: 76px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    ::view-transition-group(*) { animation-duration: .01ms; }
}
