/* Premium classic card lounge. Loaded last to give all screens one design system. */
:root {
  color-scheme: dark;
  --bg-dark: #101a17;
  --bg-table: #174b38;
  --bg-table-dark: #103a2b;
  --felt-border: #2c654d;
  --gold: #c6a15b;
  --gold-glow: rgba(198, 161, 91, .2);
  --gold-dark: #a98443;
  --card-white: #fffdf8;
  --text-main: #f5f0e5;
  --text-muted: #b9b9a8;
  --danger: #b94d4d;
  --danger-glow: rgba(185, 77, 77, .18);
  --success: #4f956b;
  --success-glow: rgba(79, 149, 107, .18);
  --info: #91b5a3;
  --card-red: #b52f37;
  --card-black: #202621;
  --font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --surface: #f3ebdd;
  --surface-2: #e7ddc9;
  --surface-dark: #23352b;
  --ink: #242b25;
  --line: rgba(198, 161, 91, .22);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, .2);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, .27);
  --shadow-lg: 0 24px 62px rgba(0, 0, 0, .42);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; }
body {
  min-height: 100dvh;
  color: var(--text-main);
  background: radial-gradient(ellipse at 50% 0, #263b30 0, #17231d 42%, var(--bg-dark) 85%);
  font-family: var(--font-family);
  letter-spacing: .005em;
}
body::after { display: none; }
#app { height: 100dvh; min-height: 100dvh; width: 100%; }
.screen { min-height: 0; }
button, input, select { font: inherit; }
input, select, textarea { user-select: text; -webkit-user-select: text; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #d5bd88; outline-offset: 3px; }

.btn {
  min-height: 46px; padding: 12px 20px; border: 1px solid transparent; border-radius: 12px;
  font-size: .94rem; letter-spacing: .01em; transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.btn-primary { color: #fffaf0; background: linear-gradient(135deg, #386e52, #24533d); box-shadow: 0 6px 16px rgba(10, 35, 24, .22); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); background: #3e7658; box-shadow: 0 8px 20px rgba(10, 35, 24, .3); }
.btn-secondary { color: var(--ink); background: #e7ddc9; border-color: rgba(75, 67, 48, .16); }
.btn-secondary:hover:not(:disabled) { background: #efe6d6; }
.btn-danger { color: #fff9f2; background: #793d46; box-shadow: 0 5px 14px rgba(77, 32, 39, .18); }
.btn-danger:hover:not(:disabled) { background: #8b4650; }
.btn:disabled { opacity: .48; }
.btn-link { min-height: 44px; color: #5d665e; text-decoration: none; }
.form-group label { color: #62675e; font-size: .76rem; letter-spacing: .08em; }
.form-input { min-height: 48px; color: var(--ink); background: #fffdf8; border: 1px solid rgba(61, 69, 57, .2); border-radius: 12px; font-size: 1rem; }
.form-input:focus { border-color: #8c7344; box-shadow: 0 0 0 3px rgba(198, 161, 91, .16); }

/* Landing and lobby */
.landing-container {
  min-height: 100%; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 45%, rgba(198, 161, 91, .09), transparent 50%);
}
.landing-card {
  max-width: 448px; padding: clamp(28px, 5vw, 44px); color: var(--ink);
  background: linear-gradient(150deg, #f8f2e7, var(--surface)); border: 1px solid rgba(198, 161, 91, .3);
  border-radius: 24px; box-shadow: var(--shadow-lg);
}
.game-logo { gap: 12px; margin-bottom: 32px; }
.logo-title {
  color: #243d30; font-family: var(--font-display); font-size: clamp(2.1rem, 8vw, 2.8rem);
  line-height: 1.04; letter-spacing: .035em; text-transform: none;
  background: linear-gradient(100deg, #263e30, #755b31); background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-suits { gap: 14px; font-size: 1.3rem; }
.logo-suits .black { color: #26372c; }
.logo-suits .red { color: #9d3640; }
.landing-menu { gap: 12px; margin-bottom: 18px; }
.landing-menu .btn { width: 100%; min-height: 52px; }
.landing-footer-links { justify-content: center; flex-wrap: wrap; gap: 8px 18px; }
.lobby-container {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(300px, 1.1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "head players" "network actions"; align-content: center; gap: 18px; width: min(100%, 960px);
  max-width: none; height: 100%; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); overflow-y: auto;
}
.lobby-header { grid-area: head; align-self: stretch; display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 24px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.lobby-header h2 { color: #596256 !important; font-family: var(--font-display); font-size: 1.3rem !important; letter-spacing: .025em !important; text-transform: none !important; }
.room-code-badge { padding: 16px 22px; margin-top: 18px; background: #fffaf0; border: 1px dashed #a98443; border-radius: 15px; }
.room-code-badge:hover { background: #fffdf7; box-shadow: 0 0 0 3px rgba(198,161,91,.12); transform: translateY(-1px); }
.room-code-title, .room-code-hint { color: #737366; }
.room-code-value { color: #31573f; font-size: clamp(2rem, 5vw, 2.5rem); letter-spacing: .2em; }
.lan-info-card { grid-area: network; align-self: start; color: #e9eadc; background: rgba(35,53,43,.92); border: 1px solid rgba(198,161,91,.24); border-radius: 15px; }
.lan-info-card strong { color: #fff9eb; }
.lan-url-display { overflow-wrap: anywhere; color: #e6d4aa !important; }
.lobby-players-box { grid-area: players; margin: 0; padding: 20px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.lobby-players-title { color: #5d665e; }
.player-chips-list { gap: 8px; }
.player-chip { min-width: 0; padding: 10px 12px; color: var(--ink); background: rgba(255,255,255,.48); border: 1px solid rgba(89,86,67,.12); border-radius: 12px; }
.player-chip-avatar { flex: 0 0 36px; width: 36px; height: 36px; color: #fff9ef; background: #42694e; }
.player-chip-name { max-width: 32vw; overflow: hidden; text-overflow: ellipsis; font-size: .96rem; }
.player-chip-badges { flex-shrink: 0; }
.badge-host { color: #fff8e9; background: #92723d; }
.badge-you { color: #fff; background: #526d5a; }
.lobby-actions { grid-area: actions; align-self: end; margin: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.lobby-actions label { color: #62675e !important; }
#lobby-game-length-section .form-input { color: var(--ink) !important; background: #fffdf8 !important; border-color: rgba(61,69,57,.2) !important; }
#lobby-waiting-notice { padding: 12px; color: #745e31 !important; background: rgba(198,161,91,.12); border-radius: 12px; }

/* Coherent table, compact status and connected hand dock */
.game-container { min-height: 0; background: radial-gradient(ellipse at 50% 10%, #24372c, #17231d 60%, #101a17); }
.game-header { min-height: 62px; padding: 8px clamp(10px, 2vw, 24px); background: rgba(16,26,23,.97); border-bottom: 1px solid rgba(198,161,91,.2); }
.hud-left, .hud-right { gap: clamp(7px, 1vw, 14px); }
.hud-pill { min-width: 50px; }
.hud-pill-title { color: #b9b9a8; letter-spacing: .1em; }
.hud-pill-value { color: #f7f1e5; font-size: .98rem; }
.trump-badge { padding: 7px 12px; color: #f5f0e5; background: #23352b; border: 1px solid rgba(198,161,91,.28); box-shadow: none; }
.trump-symbol.black { color: #f2eee4; }
.trump-symbol.red { color: #c8444b; }
.trump-name { color: #f1e3bf; font-size: .76rem; }
.icon-btn { width: 42px; height: 42px; color: #f5f0e5; background: #23352b; border: 1px solid rgba(198,161,91,.18); border-radius: 12px; }
.icon-btn:hover { background: #31483a; transform: translateY(-1px); }
.audio-unlock-pill { animation: none; color: #f0dfb8; background: rgba(198,161,91,.1); border-color: rgba(198,161,91,.3); }
.table-felt {
  min-height: 0; margin: clamp(8px, 1.4vw, 16px) clamp(10px, 2vw, 26px) 5px;
  border: 5px solid #345f48; border-radius: clamp(26px, 4vw, 46px);
  background: radial-gradient(ellipse at 50% 44%, #1c5940, #174b38 55%, #103a2b 100%);
  box-shadow: inset 0 0 65px rgba(0,0,0,.22), 0 12px 28px rgba(0,0,0,.24);
}
.table-felt::before { background-image: radial-gradient(ellipse at 50% 50%, rgba(231,221,201,.035), transparent 70%); }
.trick-center { width: min(360px, 44vw); height: clamp(150px, 24vh, 230px); z-index: 2; }
.trick-plays-container { gap: 12px; }
.trick-lead-suit-indicator { color: #f1e5c9; background: rgba(16,26,23,.72); border-color: rgba(198,161,91,.28); }
.trick-winner-banner { color: #f5edda; background: #23352b; border-color: #c6a15b; box-shadow: var(--shadow-md); }
.ready-prompt-card, .bidding-panel-card { color: #242b25; background: var(--surface); border: 1px solid rgba(198,161,91,.42); border-radius: 18px; box-shadow: 0 18px 54px rgba(0,0,0,.4); backdrop-filter: none; }
.ready-prompt-card { padding: 20px; }
.ready-prompt-header span { color: #31573f !important; }
.ready-prompt-desc { color: #65695f; }

/* Desktop bidding is a complete, centered dialog. The hand remains in view. */
.bidding-panel-container {
  position: fixed; z-index: 1100; top: 50%; left: 50%; width: min(92vw, 540px); max-height: min(78dvh, 690px);
  overflow: auto; border-radius: 18px; transform: translate(-50%, -50%);
}
.bidding-panel-card { gap: 11px; padding: clamp(15px, 2vw, 22px); }
.bidding-panel-header { border-bottom-color: rgba(52,67,53,.14); }
.bidding-round-title { color: #26392c; }
.bidding-starter-tag, .bidding-order-header, .bid-selector-heading { color: #676c61; }
.bidding-total-badge { color: #33533d; background: #e5ecdf; border-color: rgba(79,149,107,.25); }
.bidding-total-badge .total-val { color: #31573f; }
.bidding-order-wrapper { padding: 9px 11px; background: #e8e2d5; border-radius: 12px; }
.bidding-player-chip { color: #343b34; background: #faf7ef; border-color: rgba(63,70,59,.12); }
.bidding-player-chip.is-current { border-color: #4f956b; box-shadow: inset 0 0 0 1px rgba(79,149,107,.15); }
.bidding-player-chip.has-bid { background: #edf2e9; }
.chip-status.current { color: #315f40; }
.chip-status.bid { color: #4f8056; }
.chip-status.waiting { color: #777a70; }
.bidding-turn-banner { padding: 9px; color: #31573f; background: #e4eee4; border-radius: 10px; }
.bidding-turn-prompt { color: #315f40; }
.bidding-turn-dot { background: #4f956b; box-shadow: none; }
.bidding-waiting-text { color: #65695f; }
.bid-btn { width: clamp(44px, 4.4vw, 52px); height: clamp(44px, 4.4vw, 52px); color: #2e352f; background: #fffdf8; border: 1px solid rgba(70,75,63,.18); border-radius: 12px; }
.bid-btn:hover:not(:disabled) { background: #f4eee1; border-color: #a98443; }
.bid-btn.selected { color: #fffaf0; background: #315b40; border-color: #315b40; box-shadow: 0 5px 12px rgba(38,69,47,.2); }
.bid-btn:disabled.forbidden { color: #945255; background: #f4e5e1; border-color: rgba(185,77,77,.25); }
.forbidden-bid-alert { color: #783d42; background: #f3e6e1; border-color: rgba(185,77,77,.24); }
.bidding-submitted-badge { color: #315b40; background: #e5eee3; border-color: rgba(79,149,107,.28); }

.player-avatar-box { min-width: 110px; padding: 8px 11px; color: #f5f0e5; background: rgba(26,43,33,.94); border: 1px solid rgba(198,161,91,.26); border-radius: 13px; box-shadow: 0 5px 15px rgba(0,0,0,.18); backdrop-filter: none; }
.player-seat.active-turn .player-avatar-box { border-color: #c6a15b; box-shadow: 0 0 0 2px rgba(198,161,91,.18), 0 7px 18px rgba(0,0,0,.2); animation: none; }
.player-seat-name { max-width: 132px; color: #fff9ed; }
.player-stats-row { gap: 5px; }
.stat-badge { padding: 3px 7px; color: #eee5d3; background: rgba(243,235,221,.12); border-radius: 7px; }
.stat-badge.bid { color: #e7c98f; }
.stat-badge.won { color: #acd0ad; }
.mini-card-back { width: 20px; height: 29px; background: linear-gradient(145deg, #537254, #304d39); border-color: rgba(243,235,221,.7); }

/* Scores and status are deliberately compact so they read as one game footer. */
.live-scorecard { gap: 10px; min-height: 34px; padding: 4px 16px; background: transparent; border: 0; }
.live-scorecard-title { margin-right: 4px; color: #d5c6a6; }
.live-scorecard-rows { gap: clamp(10px, 1.6vw, 24px); }
.live-score-row { color: #ddd6c7; font-size: .76rem; }
.live-score-row.live-score-leader { color: #e4c98d; }
.live-score-pts { color: #fff8e9; }
.turn-banner { width: fit-content; max-width: calc(100% - 24px); align-self: center; padding: 5px 14px; color: #e8dec8; background: #23352b; border: 1px solid rgba(198,161,91,.2); border-radius: 999px; font-size: .78rem; }
.turn-banner.your-turn { color: #fff1cf; background: #3b6548; border-color: rgba(198,161,91,.4); animation: none; }
.player-hand-dock { gap: 6px; padding: 7px 16px max(10px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #263a2d, #1c2c23); border-top: 1px solid rgba(198,161,91,.26); backdrop-filter: none; }
#your-player-stats { color: #e2d9c7 !important; font-size: .78rem !important; }
.hand-cards-row { min-height: clamp(88px, 14vh, 126px); gap: clamp(4px, .8vw, 10px); padding: 5px 8px 4px; }
.hand-actions-bar .btn { min-width: min(100%, 230px); }

/* Traditional ivory playing cards, with familiar red and black suits. */
.card { width: clamp(58px, 5.3vw, 76px); height: clamp(86px, 7.5vw, 110px); color: var(--card-black); background: linear-gradient(160deg, #fffefa, #f3eee2); border: 1px solid rgba(57,55,45,.19); border-radius: 10px; box-shadow: 0 6px 15px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.75); }
.card.red { color: var(--card-red); }
.card.black { color: var(--card-black); }
.card.playable:hover { transform: translateY(-9px) scale(1.025); border-color: #c6a15b; box-shadow: 0 10px 20px rgba(0,0,0,.32); }
.card.selected { transform: translateY(-12px) scale(1.035) !important; border: 2px solid #c6a15b !important; box-shadow: 0 12px 24px rgba(0,0,0,.35), 0 0 0 3px rgba(198,161,91,.14) !important; }
.card-back { background: linear-gradient(135deg, #526f56, #2b4d39); border-color: #e9dec5; }

/* Dialogs and secondary surfaces */
.modal-overlay { z-index: 1200; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); background: rgba(8,15,11,.7); backdrop-filter: blur(5px); }
.modal-content { max-width: 600px; max-height: min(90dvh, 900px); color: var(--ink); background: linear-gradient(150deg, #f8f2e7, var(--surface)); border: 1px solid rgba(198,161,91,.4); border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: rgba(65,69,57,.14); }
.modal-title { color: #28392d; font-family: var(--font-display); font-size: 1.35rem; }
.modal-close { width: 42px; height: 42px; color: #303a30; border-radius: 11px; }
.modal-body { min-height: 0; overflow-y: auto; }
.setting-item, .rule-item { color: var(--ink); background: rgba(255,255,255,.45); border-color: rgba(65,69,57,.13); border-radius: 13px; }
.setting-name, .rule-title { color: #28392d; }
.scoreboard-table { color: var(--ink); font-size: .9rem; }
.scoreboard-table th { color: #344c39; background: rgba(198,161,91,.14); }
.scoreboard-table td, .scoreboard-table th { border-color: rgba(65,69,57,.14); }
.scoreboard-row.exact { background: rgba(79,149,107,.1); }
.score-tag.positive { color: #3d7c53; }
.game-over-box { padding: 8px 0; }
.winner-names { color: #31573f; font-family: var(--font-display); }
.end-game-settings-action { width: 100%; margin-bottom: 14px; justify-content: flex-start; }
.end-game-confirm-card { max-width: 480px; }
.end-game-confirm-card .modal-body p { line-height: 1.55; color: #50594f; }
.end-game-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
.early-end-results > p { margin: 0 0 12px; line-height: 1.5; color: #50594f; }
.early-end-leader { padding: 11px 13px; color: #31573f !important; background: #e5ecdf; border-radius: 11px; font-weight: 700; }
.early-end-table-wrap { max-width: 100%; overflow-x: auto; }
.early-end-table-wrap .scoreboard-table { min-width: 0; }
.early-end-footnote { margin-top: 14px !important; color: #77776b !important; font-size: .82rem; }
.early-end-waiting { width: 100%; text-align: center; color: #666b61; }
#toast-container { top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 1500; }
.toast { color: #f7f1e4; background: rgba(35,53,43,.98); border: 1px solid rgba(198,161,91,.2); border-left: 4px solid var(--gold); border-radius: 12px; box-shadow: var(--shadow-md); }
.toast.error { border-left-color: #d27a76; }
.toast.success { border-left-color: #79b48b; }
.connection-pill { bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; color: #f4eedf; background: #1b2a21; border-color: rgba(198,161,91,.2); }
.status-dot { box-shadow: none; }
@media (max-width: 1024px) {
  .live-scorecard { overflow-x: auto; }
  .player-avatar-box { min-width: 96px; }
  .player-seat-name { max-width: 112px; }
  .seat-left { left: 8px; }
  .seat-right { right: 8px; }
}

@media (max-width: 768px) {
  .lobby-container { grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto auto auto; grid-template-areas: "head" "players" "network" "actions"; align-content: start; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
  .lobby-header { padding: 17px; }
  .lobby-header h2 { margin-bottom: 0; }
  .room-code-badge { width: 100%; margin-top: 12px; padding: 12px; }
  .room-code-value { font-size: 2rem; }
  .lan-info-card { margin: 0; }
  .lobby-players-box { padding: 15px; }
  .lobby-actions { padding: 14px; }
  .game-header { min-height: 54px; }
  .table-felt { margin: 5px 7px 3px; border-width: 3px; border-radius: 22px; }
  .seat-top { top: 7px; }
  .seat-top-left, .seat-left { top: 20%; left: 6px; transform: translateY(-50%); }
  .seat-top-right, .seat-right { top: 20%; right: 6px; left: auto; transform: translateY(-50%); }
  .seat-bottom-left { bottom: 6px; left: 20%; }
  .seat-bottom-right { bottom: 6px; left: 80%; }
  .player-seat { gap: 3px; }
  .player-avatar-box { min-width: 78px; padding: 5px 7px; border-radius: 10px; }
  .player-seat-name { max-width: 82px; font-size: .72rem; }
  .player-stats-row { font-size: .66rem; }
  .player-stats-row > span[style] { font-size: .66rem !important; }
  .opponent-cards-fan { transform: scale(.76); transform-origin: top center; }
  .trick-center { width: min(280px, 70vw); height: clamp(112px, 20vh, 175px); }
  .trick-plays-container { flex-wrap: wrap; justify-content: center; gap: 7px; }
  .trick-card-wrapper .card { width: 47px; height: 68px; }
  .trick-player-label { max-width: 72px; overflow: hidden; text-overflow: ellipsis; font-size: .63rem; }
  /* Fixed overlay escapes the felt bounds. It sits above the compact footer, never over the hand. */
  .bidding-panel-container {
    top: auto; bottom: calc(156px + env(safe-area-inset-bottom)); left: 50%; width: min(96vw, 470px);
    max-height: min(39dvh, 320px); overflow-y: auto; border-radius: 17px; transform: translateX(-50%);
  }
  .bidding-panel-card { gap: 7px; padding: 11px 12px; }
  .bidding-round-title { font-size: .92rem; }
  .bidding-panel-header { min-height: 34px; }
  .bidding-order-wrapper { max-height: 55px; overflow-y: auto; padding: 6px 8px; }
  .bidding-order-header { margin-bottom: 4px; font-size: .62rem; }
  .bidding-player-chips { max-height: none; gap: 5px; }
  .bidding-player-chip { padding: 4px 7px; font-size: .68rem; }
  .bidding-turn-banner { padding: 5px 7px; font-size: .76rem; }
  .bid-selector-heading { font-size: .68rem; }
  .bid-buttons-grid { max-height: 82px; overflow-y: auto; gap: 5px; }
  .bid-btn { width: 42px; height: 42px; }
  .forbidden-bid-alert { padding: 5px 7px; font-size: .7rem; }
  .bidding-actions .btn { min-height: 42px; }
  .bidding-actions { position: sticky; bottom: 0; padding-top: 4px; background: var(--surface); }
  .live-scorecard { min-height: 30px; padding: 3px 8px; }
  .live-scorecard-title { margin-right: 3px; font-size: .58rem; }
  .live-scorecard-rows { gap: 10px; }
  .live-score-name { max-width: 72px; }
  .live-score-row { font-size: .66rem; }
  .turn-banner { min-height: 27px; padding: 4px 11px; font-size: .7rem; }
  .player-hand-dock { gap: 4px; padding: 5px 8px max(8px, env(safe-area-inset-bottom)); }
  #your-player-stats { font-size: .69rem !important; }
  .hand-cards-row { justify-content: center; min-height: 84px; overflow-x: auto; overscroll-behavior-x: contain; }
  .card { width: 54px; height: 80px; padding: 4px 6px; }
  .card-rank { font-size: .98rem; }
  .card-center { font-size: 1.55rem; }
  .hand-cards-row.crowded .card { margin-left: -13px; }
  .hand-cards-row.crowded .card:first-child { margin-left: 0; }
  .hand-cards-row.crowded .card.selected { margin-left: 2px; margin-right: 6px; }
  .hand-actions-bar .btn { min-height: 42px; padding: 8px 16px; }
  .connection-pill { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); left: 7px; transform: none; padding: 3px 7px; font-size: .58rem; }
  #toast-container { left: 10px; right: 10px; }
  .toast { max-width: none; }
}

@media (max-width: 600px) {
  .game-header { gap: 4px; padding: 5px 7px; }
  .hud-left, .hud-right { gap: 5px; }
  .hud-pill { min-width: 36px; }
  .hud-pill-title { font-size: .54rem; }
  .hud-pill-value { font-size: .78rem; }
  .hud-center { gap: 4px; }
  .trump-badge { gap: 4px; padding: 5px 7px; }
  .trump-badge .hud-pill-title { display: none; }
  .trump-symbol { font-size: 1rem; }
  .trump-name { font-size: .61rem; }
  .icon-btn { width: 36px; height: 36px; font-size: .9rem; }
  #audio-unlock-pill { max-width: 36px; overflow: hidden; white-space: nowrap; padding: 7px; font-size: 0; }
  #audio-unlock-pill::first-letter { font-size: .9rem; }
  .bidding-panel-container { bottom: calc(148px + env(safe-area-inset-bottom)); max-height: min(37dvh, 300px); }
  .modal-overlay { align-items: flex-end; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); }
  .modal-content { max-height: min(88dvh, 760px); border-radius: 19px 19px 14px 14px; }
  .scoreboard-table { min-width: 470px; }
  .early-end-table-wrap .scoreboard-table { min-width: 0; }
  .end-game-confirm-actions { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .player-seat-name { max-width: 63px; font-size: .64rem; }
  .player-avatar-box { min-width: 68px; padding: 4px 5px; }
  .stat-badge { padding: 2px 4px; }
  .card { width: 49px; height: 74px; }
  .hand-cards-row.crowded .card { margin-left: -15px; }
  .table-felt { margin-left: 5px; margin-right: 5px; }
  #your-player-stats { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .game-header { min-height: 45px; padding-top: 3px; padding-bottom: 3px; }
  .table-felt { margin-top: 3px; margin-bottom: 2px; }
  .player-hand-dock { gap: 2px; padding-top: 2px; }
  .hand-cards-row { min-height: 60px; padding-top: 1px; }
  .card { width: 43px; height: 62px; }
  .turn-banner { min-height: 22px; padding: 2px 10px; }
  .live-scorecard { min-height: 25px; }
  .bidding-panel-container { top: 50%; bottom: auto; max-height: 70dvh; transform: translate(-50%,-50%); }
}

@media (min-width: 1200px) {
  .game-container { width: min(100%, 1920px); margin-inline: auto; }
  .table-felt { margin-inline: clamp(22px, 3vw, 52px); }
  .player-hand-dock { padding-inline: 28px; }
  .live-scorecard { padding-inline: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
