/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --felt:       #1a4a2e;
  --felt-dark:  #0f2e1a;
  --felt-light: #235f3a;
  --gold:       #c8a84b;
  --gold-dim:   #8a7030;
  --red:        #c0392b;
  --cream:      #f5f0e8;
  --bg:         #0b1a10;
  --card-bg:    #ffffff;
  --card-shadow: 0 3px 10px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.3);
  --text:       #e8dfc8;
  --text-dim:   #9a8e78;
  --border:     #284a38;
  --highlight:  #f0c040;
  --highlight-glow: 0 0 12px 3px rgba(240,192,64,0.7);
  --disabled:   #3a3a3a;
  --modal-bg:   rgba(0,0,0,0.82);
  --panel-bg:   rgba(8,24,14,0.95);
  --radius:     10px;
  --radius-card: 9px;
  --font:       'Inter', system-ui, sans-serif;
  --font-display: 'Cinzel', Georgia, serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Screens ───────────────────────────────────────────────────────────────── */
.screen { display: none; width: 100%; height: 100vh; }
.screen.active { display: flex; }

/* ── Reconnecting screen ───────────────────────────────────────────────────── */
#screen-reconnecting {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1f4a2e 0%, #0a1810 100%);
}
.reconnecting-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  color: var(--gold);
}
.reconnecting-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(200,168,75,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.reconnecting-msg {
  color: var(--text-dim);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* ── Lobby ─────────────────────────────────────────────────────────────────── */
#screen-lobby {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 40%, #1f4a2e 0%, #0a1810 100%);
  position: relative;
}

/* Background suit decorations */
.lobby-suits-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.lobby-suit-dec {
  position: absolute;
  font-size: 12rem;
  font-family: var(--font-display);
  opacity: 0.035;
  color: var(--gold);
  user-select: none;
  line-height: 1;
}
.lobby-suit-dec.s1 { top: -3%;  left: -4%;  font-size: 16rem; transform: rotate(-15deg); }
.lobby-suit-dec.s2 { top: 8%;   right: -3%; font-size: 13rem; transform: rotate(12deg);  color: #c04040; opacity: 0.04; }
.lobby-suit-dec.s3 { bottom: 2%; left: 6%;  font-size: 10rem; transform: rotate(8deg);   color: #c04040; opacity: 0.04; }
.lobby-suit-dec.s4 { bottom: 6%; right: 2%; font-size: 14rem; transform: rotate(-10deg); }
.lobby-suit-dec.s5 { top: 42%;  left: -2%; font-size: 9rem;  transform: rotate(-5deg);  opacity: 0.025; }
.lobby-suit-dec.s6 { top: 35%;  right: -1%;font-size: 8rem;  transform: rotate(18deg);  color: #c04040; opacity: 0.03; }

.lobby-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 700px;
  padding: 24px 16px 20px;
  position: relative;
  z-index: 1;
}

.logo-block { text-align: center; }
.logo-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(200,168,75,0.45), 0 4px 10px rgba(0,0,0,0.7);
  line-height: 1;
}
.logo-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  letter-spacing: 0.35em;
  margin-top: 5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Live player count */
.lobby-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.lobby-stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5dc07c;
  box-shadow: 0 0 6px rgba(93,192,124,0.8);
  animation: stat-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes stat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Suit divider */
.lobby-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}
.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,168,75,0.3), transparent);
}
.divider-suit {
  font-size: 1.1rem;
  color: var(--gold);
  opacity: 0.6;
  flex-shrink: 0;
}

.lobby-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* How to Play button */
.btn-how-to-play {
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 8px;
  color: var(--text);
  border-color: rgba(200,168,75,0.25);
}
.btn-how-to-play:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200,168,75,0.08);
}

/* CREATE card — gold accent top border */
.form-card--create {
  border-top: 2px solid rgba(200,168,75,0.55);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 0 rgba(200,168,75,0);
}
.form-card--create h2 { color: var(--gold); }
.form-card--create:hover {
  border-color: rgba(200,168,75,0.5);
  border-top-color: var(--gold);
  box-shadow: 0 14px 44px rgba(0,0,0,0.55), 0 0 20px rgba(200,168,75,0.08);
}

/* JOIN card — subtler, cooler accent */
.form-card--join {
  border-top: 2px solid rgba(80,120,200,0.35);
}
.form-card--join h2 { color: #8aafdf; }
.form-card--join:hover {
  border-color: rgba(80,120,200,0.35);
  border-top-color: rgba(80,120,200,0.7);
  box-shadow: 0 14px 44px rgba(0,0,0,0.55), 0 0 20px rgba(80,120,200,0.06);
}

/* VS COMPUTER card — green felt accent */
.form-card--bots {
  border-top: 2px solid rgba(90,180,120,0.35);
}
.form-card--bots h2 { color: #7fc79b; }
.form-card--bots:hover {
  border-color: rgba(90,180,120,0.35);
  border-top-color: rgba(90,180,120,0.7);
  box-shadow: 0 14px 44px rgba(0,0,0,0.55), 0 0 20px rgba(90,180,120,0.06);
}
.bot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.bot-row label {
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.bot-row select {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.9rem;
}
.bot-summary {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  margin: 4px 0 10px;
  min-height: 1.2em;
  line-height: 1.4;
}
.bot-summary strong { color: #7fc79b; font-weight: 600; }

/* Bot marker in lists and seats */
.bot-tag {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #7fc79b;
  border: 1px solid rgba(90,180,120,0.35);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 5px;
  white-space: nowrap;
}

/* Group photo with caption */
.group-pic-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  margin-top: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 20px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.group-pic-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  font-weight: 600;
  opacity: 0.8;
  flex: 1;
  text-align: center;
}

.form-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
  flex: 1;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-card:hover {
  border-color: rgba(200,168,75,0.3);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.form-card h2 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input[type="text"], input[type="number"] {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus, input[type="number"]:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(200,168,75,0.12);
}
input::placeholder { color: var(--text-dim); opacity: 0.7; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(145deg, #d4b050, #a07830);
  color: #120e00;
  border: none;
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(200,168,75,0.25);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(200,168,75,0.35); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.2); }

.btn-rules, .btn-sm {
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-rules:hover, .btn-sm:hover { color: var(--gold); border-color: var(--gold-dim); background: rgba(200,168,75,0.06); }

.btn-warn {
  color: #e07050;
  border-color: #703020;
}
.btn-warn:hover { color: #ff8060; border-color: #e07050; }

.btn-copy {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gold);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-copy:hover { background: rgba(200,168,75,0.15); }

/* ── Waiting Room ──────────────────────────────────────────────────────────── */
#screen-waiting {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1f4a2e 0%, #0a1810 100%);
}

.waiting-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
  padding: 24px 16px;
}

.waiting-header {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.logo-small {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.room-code-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  width: 100%;
  justify-content: center;
}
.room-code-label { color: var(--text-dim); font-size: 0.85rem; letter-spacing: 0.1em; }
.room-code-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.25em;
  font-family: monospace;
}

.player-list {
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
}

.player-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}
.player-list-item .pip { font-size: 0.7rem; }
.player-list-item.host { border-left: 3px solid var(--gold); }
.player-list-item .disconnected { color: #666; font-size: 0.75rem; }

.waiting-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

select {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
}
select:focus { border-color: var(--gold); }

.wait-status { color: var(--text-dim); font-size: 0.9rem; }

/* ── Game Screen ───────────────────────────────────────────────────────────── */
#screen-game {
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* Top bar */
#top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
#top-bar::-webkit-scrollbar { display: none; }
.top-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 3px 9px;
  flex-shrink: 0;
  white-space: nowrap;
}
.top-label { color: var(--text-dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.top-item > span:not(.top-label) { font-weight: 700; color: var(--gold); font-size: 0.92rem; }
.trump-sym { font-size: 1.15rem; }
.trump-info .hearts, .trump-info .diamonds { color: #e05050; }
.trump-info .spades, .trump-info .clubs { color: var(--text); }
.ml-auto { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; background: none; border: none; padding: 0; }

/* Game body layout */
#game-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Side seats */
.side-seats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 8px 4px;
  width: 110px;
  flex-shrink: 0;
}

/* Center column */
#center-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

#table-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 8px;
  min-height: 0;
}

/* Top seats */
#seat-top {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  flex-shrink: 0;
}

/* Felt table */
#felt-table {
  flex: 1;
  width: 100%;
  max-width: 520px;
  background:
    radial-gradient(ellipse at 38% 38%, rgba(255,255,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, var(--felt-light) 0%, var(--felt) 55%, var(--felt-dark) 100%);
  border-radius: 50%;
  border: 3px solid rgba(200,168,75,0.35);
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.45),
    inset 0 0 20px rgba(0,0,0,0.2),
    0 10px 40px rgba(0,0,0,0.7),
    0 0 0 6px rgba(200,168,75,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 160px;
  max-height: 400px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

#trick-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

#trick-label {
  position: absolute;
  bottom: 12px;
  color: rgba(200,168,75,0.5);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* Action area */
#action-area {
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
}

.action-msg {
  color: var(--gold);
  font-size: 0.9rem;
  text-align: center;
  min-height: 1.2em;
}

.action-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  width: 100%;
  max-width: 380px;
}
.action-panel.hidden { display: none; }

.bid-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}
input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
  height: 4px;
}
.bid-number {
  width: 80px;
  text-align: center;
}
.bid-btns {
  display: flex;
  gap: 10px;
}

/* My hand area */
#my-hand-area {
  padding: 6px 12px 8px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  min-height: 110px;
}

#my-hand {
  display: flex;
  gap: 0;
  justify-content: flex-start;
  align-items: flex-end;
  min-height: 100px;
  padding: 0 10px;
}

/* Right panel */
#right-panel {
  width: 185px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  overflow: hidden;
}

#score-panel, #log-panel {
  padding: 10px;
  overflow-y: auto;
}
#score-panel { border-bottom: 1px solid var(--border); max-height: 50%; }
#log-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 6px;
}
#game-log {
  flex: 1;
  overflow-y: auto;
}

.panel-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  margin-bottom: 8px;
  font-weight: 600;
}

/* Score table */
#score-table { display: flex; flex-direction: column; gap: 3px; }
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.score-row:hover { background: rgba(255,255,255,0.04); }
.score-row.top-scorer { background: rgba(200,168,75,0.13); }
.score-row .s-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; color: var(--text); }
.score-row.top-scorer .s-name { color: var(--gold); }
.score-row .s-val { font-weight: 700; font-size: 0.88rem; flex-shrink: 0; margin-left: 4px; }
.score-row .s-val.positive { color: #5dc07c; }
.score-row .s-val.negative { color: #e06060; }

/* ── Log / Scorecard tab bar ────────────────────────────────────────────────── */
.log-tab-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.log-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 4px 0 5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font);
}
.log-tab:hover { color: var(--text); }
.log-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.sc-hidden { display: none !important; }

/* ── Scorecard pane ─────────────────────────────────────────────────────────── */
#scorecard-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
}

.sc-empty {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-align: center;
  padding: 16px 0;
  font-style: italic;
}

.sc-entry {
  border-radius: 7px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 3px solid transparent;
  background: rgba(255,255,255,0.03);
  font-size: 0.72rem;
}
.sc-entry.sc-success {
  border-left-color: #5dc07c;
  background: rgba(60,160,80,0.07);
}
.sc-entry.sc-fail {
  border-left-color: #e06060;
  background: rgba(180,50,50,0.07);
}

.sc-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sc-hand-num {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.sc-result {
  font-weight: 800;
  font-size: 0.78rem;
}
.sc-result.sc-won  { color: #5dc07c; }
.sc-result.sc-lost { color: #e06060; }

.sc-bidder {
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-label {
  color: var(--text-dim);
  opacity: 0.7;
  flex-shrink: 0;
}
.sc-val { color: var(--text); font-weight: 600; }

.sc-trump {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
}
.sc-trump.red { color: #e05050; }

/* Game log */
#game-log { display: flex; flex-direction: column; gap: 3px; }
.log-entry {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  line-height: 1.4;
}
.log-entry.partner-reveal { color: #a0d080; font-weight: 600; }
.log-entry.trick-win { color: var(--gold); }

/* ── Player Seat Cards ──────────────────────────────────────────────────────── */
.player-seat {
  background: rgba(8,22,14,0.9);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 0.78rem;
  min-width: 110px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.player-seat:empty { display: none; }
.player-seat.active-turn {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(200,168,75,0.35), 0 2px 8px rgba(0,0,0,0.4);
  background: rgba(200,168,75,0.05);
}
.player-seat.revealed-partner { border-color: #5dc07c; box-shadow: 0 0 8px rgba(93,192,124,0.25); }
.player-seat.double-partner { border-color: #a0e070; box-shadow: 0 0 10px rgba(160,224,112,0.3); }
.player-seat.is-me { border-color: #5580d8; }
.player-seat.disconnected { opacity: 0.35; }

.seat-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat-score { color: var(--text-dim); font-size: 0.72rem; }
.seat-cards { color: var(--text-dim); font-size: 0.7rem; }
.seat-turn-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 4px;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.seat-partner-badge {
  font-size: 0.65rem;
  color: #5dc07c;
  font-weight: 700;
}
.seat-dealer-badge {
  font-size: 0.65rem;
  color: var(--gold);
}

/* ── Playing Cards ──────────────────────────────────────────────────────────── */
.card {
  width: 64px;
  height: 92px;
  background: linear-gradient(160deg, #fff 0%, #f8f8f8 100%);
  border-radius: var(--radius-card);
  border: 1px solid #e0ddd8;
  box-shadow: var(--card-shadow);
  position: relative;
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 5px;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  user-select: none;
}
.card.red { color: var(--red); }
.card.black { color: #1a1a1a; }

.card-rank-top {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}
.card-suit-top {
  font-size: 0.75rem;
  line-height: 1;
}
.card-center {
  font-size: 1.6rem;
  text-align: center;
  line-height: 1;
}
.card-rank-bot {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  transform: rotate(180deg);
  align-self: flex-end;
}
.card-suit-bot {
  font-size: 0.75rem;
  line-height: 1;
  transform: rotate(180deg);
  align-self: flex-end;
}

/* Hand cards: overlapping fan — overlap set dynamically by JS (fitHandToContainer) */
#my-hand .card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
#my-hand .card:hover { transform: translateY(-16px); z-index: 10; box-shadow: 0 10px 24px rgba(0,0,0,0.7); }

#my-hand .card.playable {
  box-shadow: var(--highlight-glow), var(--card-shadow);
}
#my-hand .card.playable:hover {
  transform: translateY(-20px);
  box-shadow: 0 0 18px 5px rgba(240,192,64,0.9), 0 10px 24px rgba(0,0,0,0.7);
}
#my-hand .card.not-playable {
  filter: brightness(0.5) saturate(0.3);
  cursor: not-allowed;
}
#my-hand .card.not-playable:hover { transform: none; }

/* Trick cards (slightly larger than before) */
#trick-area .card {
  width: 62px;
  height: 90px;
  font-size: 0.95em;
}
#trick-area .card .card-center { font-size: 1.5rem; }

/* Card back (for opponent cards) */
.card-back {
  width: 40px;
  height: 56px;
  background: linear-gradient(135deg, #1e4e8e 0%, #0c2050 100%);
  border-radius: 6px;
  border: 1px solid #3868b8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.18);
  flex-shrink: 0;
}

/* ── Modals ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: #0e2218;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.modal-wide { max-width: 640px; }

.modal-box h2 {
  font-size: 1.2rem;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.trump-suit-row, .trump-suit-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.suit-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.suit-btn {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font);
}
.suit-btn:hover { background: rgba(255,255,255,0.12); }
.suit-btn.selected { border-color: var(--gold); background: rgba(200,168,75,0.15); color: var(--gold); }
.suit-btn[data-suit="Hearts"], .suit-btn[data-suit="Diamonds"] { color: #e07070; }
.suit-btn[data-suit="Hearts"].selected, .suit-btn[data-suit="Diamonds"].selected { color: #ff9090; }

.partner-pickers { display: flex; flex-direction: column; gap: 12px; }
.partner-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.partner-picker-row label { color: var(--text-dim); font-size: 0.85rem; min-width: 80px; }
/* Both rows of a duplicated pick get flagged, so it is obvious which two clash */
.partner-picker-row.picker-dup .picker-rank,
.partner-picker-row.picker-dup .picker-suit {
  border-color: #e06060;
  background: rgba(224,96,96,0.12);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}
.btn-primary:disabled:hover { filter: none; box-shadow: none; }
.picker-rank, .picker-suit {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  font-family: var(--font);
}
.picker-rank:focus, .picker-suit:focus { border-color: var(--gold); }

.vote-tally {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.modal-btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Hand result */
#hand-result-body { display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  font-size: 0.9rem;
}
.result-row .r-name { color: var(--text); }
.result-row .r-score.pos { color: #5dc07c; font-weight: 700; }
.result-row .r-score.neg { color: #e06060; font-weight: 700; }
.result-summary {
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}
.result-summary.success { background: rgba(60,160,80,0.2); color: #6de090; }
.result-summary.fail { background: rgba(180,50,50,0.2); color: #e06060; }

/* Game over */
#game-over-scores { display: flex; flex-direction: column; gap: 6px; }
.go-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}
.go-row.winner { background: rgba(200,168,75,0.2); border: 1px solid var(--gold); }
.go-row .go-name { font-weight: 600; }
.go-row .go-score { font-weight: 700; }

/* ── Rules modal ────────────────────────────────────────────────────────────── */

/* Header */
.rules-header {
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.rules-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rules-logo {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(200,168,75,0.4);
}
.rules-logo-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.3em;
}

/* Content shell */
.rules-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.6;
}

/* Section */
.rules-section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rules-section:last-child { border-bottom: none; }

.rules-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.rules-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(200,168,75,0.18);
  border: 1px solid var(--gold-dim);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}

.rules-section p {
  color: var(--text-dim);
  font-size: 0.86rem;
  margin: 0;
}
.rules-section strong { color: var(--text); font-weight: 700; }
.rules-section em { color: var(--gold); font-style: normal; font-weight: 600; }

/* Info grid (deck counts, bid limits) */
.rules-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rules-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 8px 12px;
}
.rules-card-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.rules-card-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}
.rules-card-value.gold { color: var(--gold); font-size: 1rem; }

/* Card removal order */
.rules-removal-order {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.removal-rank {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  background: rgba(200,168,75,0.12);
  border: 1px solid var(--gold-dim);
  border-radius: 5px;
  padding: 2px 8px;
}
.removal-arrow { color: var(--text-dim); font-size: 0.75rem; }

/* Note line */
.rules-note {
  font-size: 0.78rem !important;
  color: var(--text-dim) !important;
  font-style: italic;
  padding: 4px 0 0;
}
.rules-note em { color: var(--gold) !important; font-style: italic; font-weight: 700; }

/* Partner structure table */
.rules-partner-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
}
.rules-partner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(255,255,255,0.03);
  font-size: 0.84rem;
}
.rules-partner-row:nth-child(even) { background: rgba(255,255,255,0.06); }
.partner-players { color: var(--gold); font-weight: 700; }
.partner-detail  { color: var(--text-dim); }

/* Bullet list */
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rules-list li {
  font-size: 0.86rem;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
}
.rules-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--gold-dim);
  font-size: 0.72rem;
  top: 2px;
}
.rules-list strong { color: var(--text); }

/* Callout box (Double Partner) */
.rules-callout {
  background: rgba(200,168,75,0.07);
  border: 1px solid rgba(200,168,75,0.25);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.callout-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 4px;
}

/* Card value table */
.rules-card-values {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
}
.cv-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cv-row:last-child { border-bottom: none; }
.cv-row.highlight { background: rgba(200,168,75,0.1); }
.cv-row.dim { opacity: 0.5; }
.cv-card {
  font-weight: 900;
  color: var(--gold);
  font-size: 1rem;
  text-align: center;
}
.cv-row.highlight .cv-card { font-size: 1.05rem; }
.cv-name { color: var(--text-dim); }
.cv-pts  { font-weight: 700; color: var(--text); white-space: nowrap; }
.cv-row.highlight .cv-pts { color: var(--gold); }

/* Outcome grid (success / fail) */
.rules-outcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rules-outcome {
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rules-outcome.success {
  background: rgba(60,160,80,0.1);
  border: 1px solid rgba(60,160,80,0.3);
}
.rules-outcome.fail {
  background: rgba(180,50,50,0.1);
  border: 1px solid rgba(180,50,50,0.3);
}
.outcome-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.rules-outcome.success .outcome-label { color: #6de090; }
.rules-outcome.success .outcome-label span { color: #6de090; }
.rules-outcome.fail    .outcome-label { color: #e06060; }
.rules-outcome.fail    .outcome-label span { color: #e06060; }
.outcome-detail {
  font-size: 0.82rem;
  color: var(--text-dim);
}
.outcome-detail strong { color: var(--text); }

/* ── Error messages ─────────────────────────────────────────────────────────── */
.error-msg {
  color: #e06060;
  font-size: 0.82rem;
  min-height: 1em;
  text-align: center;
}

/* ── Trump modal hand display ───────────────────────────────────────────────── */
.trump-hand-label {
  margin-top: 14px;
  font-size: 0.8rem;
  color: #aaa;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.trump-hand-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}
.trump-hand-display .card {
  transform: scale(0.72);
  transform-origin: top center;
  margin: -10px -4px;
  cursor: default;
  pointer-events: none;
}

/* ── Group pic on lobby ─────────────────────────────────────────────────────── */
.group-pic {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  border: 2px solid rgba(200,168,75,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.group-pic:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6), 0 0 0 2px rgba(200,168,75,0.35);
}

/* ── Player avatar circle ───────────────────────────────────────────────────── */
.player-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  border: 1.5px solid rgba(255,255,255,0.2);
}
.score-row .player-avatar { width: 20px; height: 20px; font-size: 0.6rem; }

/* ── Status dot (online / offline) ─────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 3px;
  vertical-align: middle;
}
.status-dot.online  { background: #5dc07c; box-shadow: 0 0 4px rgba(93,192,124,0.7); }
.status-dot.offline { background: #666; }

/* ── Seat layout with avatar ────────────────────────────────────────────────── */
.seat-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.seat-info { flex: 1; min-width: 0; }

/* ── Score panel header row ─────────────────────────────────────────────────── */
.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.panel-header-row .panel-title { margin-bottom: 0; }
.btn-xs {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}
.btn-xs:hover { color: var(--gold); border-color: var(--gold); }

/* Score name wrapper */
.s-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  flex: 1;
}
.s-name-wrap .s-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── My-turn pulse on hand area ─────────────────────────────────────────────── */
@keyframes hand-pulse {
  0%, 100% { box-shadow: inset 0 2px 0 rgba(240,192,64,0.0), 0 0 0 rgba(240,192,64,0.0); }
  50%       { box-shadow: inset 0 2px 0 rgba(240,192,64,0.6), 0 -4px 20px rgba(240,192,64,0.25); }
}
#my-hand-area.my-turn-pulse {
  border-top-color: var(--gold);
  animation: hand-pulse 1.4s ease-in-out infinite;
}

/* ── WhatsApp share button ──────────────────────────────────────────────────── */
.btn-whatsapp {
  background: transparent;
  border: 1px solid #1d6b3a;
  color: #4cbb70;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-whatsapp:hover { background: rgba(77,187,112,0.15); }

/* ── Hand history modal ─────────────────────────────────────────────────────── */
.hand-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: var(--text);
}
.hand-hist-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--gold-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}
.hand-hist-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}
.hand-hist-table tr.hist-success td:first-child { border-left: 3px solid #5dc07c; }
.hand-hist-table tr.hist-fail  td:first-child { border-left: 3px solid #e06060; }
.hand-hist-table .pos { color: #5dc07c; font-weight: 600; }
.hand-hist-table .neg { color: #e06060; font-weight: 600; }
.hist-scores { color: var(--text-dim); font-size: 0.75rem; line-height: 1.7; }
.hist-scores .pos { color: #5dc07c; }
.hist-scores .neg { color: #e06060; }

/* ── Bid error inline ───────────────────────────────────────────────────────── */
#bid-error-msg {
  color: #e06060;
  font-size: 0.8rem;
  text-align: center;
  min-height: 1em;
  margin-top: 4px;
}

/* ── Responsive — Desktop ───────────────────────────────────────────────────── */
@media (min-width: 1200px) {
  #right-panel { width: 210px; }
  .score-row .s-name { max-width: 110px; }
  #felt-table { max-width: 560px; }
}

/* ── Responsive — Tablet ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #right-panel { width: 160px; }
  .side-seats { width: 100px; }
  .player-seat { min-width: 96px; }
}

/* ── Responsive — Mobile (<= 640px) ────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Top bar: horizontally scrollable, no wrapping */
  #top-bar {
    gap: 6px;
    padding: 5px 10px;
  }
  .top-item {
    font-size: 0.75rem;
    padding: 3px 7px;
  }
  .top-label { font-size: 0.62rem; }
  .top-item > span:not(.top-label) { font-size: 0.82rem; }

  /* Game body stacks vertically */
  #game-body {
    flex-direction: column;
  }

  /* Hide both side seat columns */
  .side-seats { display: none; }

  /* Top seats: scrollable horizontal strip */
  #seat-top {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 4px 6px;
    gap: 6px;
    scrollbar-width: none;
  }
  #seat-top::-webkit-scrollbar { display: none; }

  .player-seat {
    min-width: 96px;
    max-width: 120px;
    flex-shrink: 0;
    font-size: 0.72rem;
  }

  /* Center column: takes all remaining height */
  #center-column {
    flex: 1;
    min-height: 0;
  }

  /* Felt table: smaller */
  #felt-table {
    min-height: 120px;
    max-height: 240px;
  }

  /* My hand: compact */
  #my-hand-area {
    min-height: 85px;
    padding: 5px 8px 7px;
  }

  /* Right panel: full-width horizontal strip at bottom */
  #right-panel {
    width: 100%;
    height: 148px;
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
  }

  /* Score panel: left column of the strip */
  #score-panel {
    width: 130px;
    flex-shrink: 0;
    max-height: none;
    height: 100%;
    border-bottom: none;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 8px;
  }

  /* Log panel: right column */
  #log-panel {
    flex: 1;
    padding: 6px 8px;
    overflow: hidden;
    min-width: 0;
  }

  /* Cards smaller on mobile */
  .card { width: 46px; height: 68px; }
  .card-center { font-size: 1.2rem; }
  .card-rank-top, .card-rank-bot { font-size: 0.72rem; }
  .card-suit-top, .card-suit-bot { font-size: 0.66rem; }

  /* Trick cards */
  #trick-area .card { width: 44px; height: 64px; }

  /* Score row tighter */
  .score-row { padding: 4px 4px; font-size: 0.74rem; }
  .score-row .s-name { max-width: 68px; }
  .score-row .s-val { font-size: 0.8rem; }
  .score-row .player-avatar { width: 17px; height: 17px; font-size: 0.55rem; }

  /* Panel title smaller */
  .panel-title { font-size: 0.62rem; margin-bottom: 5px; }
  .panel-header-row { margin-bottom: 5px; }

  /* Log entries */
  .log-entry { font-size: 0.7rem; }
  .log-tab { font-size: 0.62rem; padding: 3px 0 4px; }

  /* Modal */
  .modal-box { padding: 18px 14px; max-width: 96vw; }
  .modal-wide { max-width: 96vw; }

  /* Action panel */
  .action-panel { padding: 10px 12px; }

  /* Lobby: single column */
  .lobby-cards { flex-direction: column; align-items: stretch; }
  .form-card { min-width: unset; max-width: 100%; }
  .logo-title { font-size: clamp(2rem, 11vw, 3rem); }
  .group-pic-wrap { padding: 10px 14px; }
  .group-pic { width: 70px; height: 70px; }
}
