/* style.css — Nine-Card Don — Poker-Room Layout */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1a1a1a;
  --bg-light: #252525;
  --felt: #2a7a3a;
  --felt-dark: #1d5a28;
  --felt-edge: #1a4a22;
  --wood: #5c3a1e;
  --wood-light: #8b6914;
  --wood-dark: #3d2410;
  --surface: #2a4a2a;
  --accent: #c9a84c;
  --accent-hover: #dabe6a;
  --text: #f0e6d0;
  --text-dim: #a0946e;
  --green: #4caf50;
  --gold: #c9a84c;
  --ns-color: #5dade2;
  --ew-color: #e8985a;
  --danger: #c0392b;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

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

/* --- LOBBY --- */
#lobby-screen {
  background: radial-gradient(ellipse at center, #2a5a2a 0%, var(--bg) 100%);
}

.lobby-container {
  margin: auto;
  text-align: center;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
}

.lobby-container h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.6rem;
  margin-bottom: 0.2rem;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  letter-spacing: 1px;
}

.lobby-container h1::before {
  content: '\2660 \2665 \2666 \2663';
  display: block;
  font-size: 1.2rem;
  color: var(--text-dim);
  opacity: 0.4;
  letter-spacing: 8px;
  margin-bottom: 0.3rem;
}

.subtitle {
  color: var(--text-dim);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--wood);
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.25);
}

.code-input {
  width: 110px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--wood-light) 100%);
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: #333;
  color: var(--text);
  border: 1px solid var(--wood);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--wood-dark);
  border-color: var(--wood-light);
}

.lobby-paths {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  width: 100%;
}

.path-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: -0.3rem;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  width: 100%;
}

.join-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

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

.error-msg {
  color: var(--danger);
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* --- Queue overlay --- */
.queue-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  text-align: center;
  gap: 0.8rem;
}

.queue-overlay.visible {
  display: flex;
}

.queue-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--text-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.queue-text {
  font-size: 1.2rem;
  color: var(--text);
}

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

.queue-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* --- AI seat styles --- */
.ai-player {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ai-badge {
  font-size: 0.9rem;
}

.ai-seat {
  border-color: var(--gold) !important;
}

.add-ai-btn {
  padding: 0.35rem 0.6rem;
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s, border-color 0.2s;
}

.add-ai-btn:hover {
  background: rgba(201, 168, 76, 0.25);
  border-color: var(--gold);
}

.remove-ai-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.remove-ai-btn:hover {
  color: var(--danger);
}

.seat-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* --- ROOM --- */
#room-screen {
  background: radial-gradient(ellipse at center, #2a5a2a 0%, var(--bg) 100%);
}

.room-container {
  margin: auto;
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
}

.room-container h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

#room-code-display {
  color: var(--gold);
  letter-spacing: 4px;
  font-size: 2rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.partnerships {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.team-ns { color: var(--ns-color); font-weight: 600; }
.team-ew { color: var(--ew-color); font-weight: 600; }

.seats-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.team-group {
  background: rgba(0,0,0,0.2);
  border: 2px solid #444;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 180px;
}

.team-group-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.team-seats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.team-amp {
  color: var(--text-dim);
  font-size: 1rem;
}

.teams-vs {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.seat-slot {
  background: rgba(0,0,0,0.25);
  border: 2px solid #555;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: center;
  transition: border-color 0.3s;
  min-width: 80px;
}

.seat-slot.occupied {
  border-color: var(--green);
}

.seat-slot.disconnected {
  border-color: var(--danger);
  opacity: 0.7;
}

.seat-player {
  font-weight: 600;
  font-size: 1rem;
}

.sit-btn {
  padding: 0.5rem 1rem;
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.sit-btn:hover {
  background: var(--wood-dark);
  border-color: var(--gold);
}

/* ============================
   GAME LAYOUT — Poker style
   ============================ */
.game-layout {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  grid-template-areas:
    "infobar"
    "table"
    "hand";
  background: var(--bg);
}

/* --- Top info bar --- */
.info-bar {
  grid-area: infobar;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 0.35rem 1rem;
  background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
  border-bottom: 1px solid #333;
  flex-wrap: wrap;
  min-height: 36px;
}

.info-bar-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  white-space: nowrap;
  position: relative;
}

.info-label {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.info-sep {
  color: #555;
  font-size: 0.7rem;
}

.team-label {
  font-weight: 600;
  font-size: 0.8rem;
}

.score-value {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--gold);
  transition: transform 0.15s;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  position: relative;
}

/* Score flash */
@keyframes scoreFlash {
  0%   { transform: scale(1); color: var(--gold); }
  30%  { transform: scale(1.5); color: #fff; text-shadow: 0 0 16px var(--gold); }
  100% { transform: scale(1); color: var(--gold); }
}

.score-flash {
  animation: scoreFlash 0.8s ease-out;
}

@keyframes scoreFlashBig {
  0%   { transform: scale(1); color: var(--gold); }
  20%  { transform: scale(2); color: #fff; text-shadow: 0 0 30px var(--gold), 0 0 60px var(--accent); }
  50%  { transform: scale(1.6); color: #ffe8a0; text-shadow: 0 0 20px var(--gold); }
  100% { transform: scale(1); color: var(--gold); }
}

.score-flash-big {
  animation: scoreFlashBig 1.2s ease-out;
}

@keyframes scoreDeltaFloat {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

.score-delta {
  position: absolute;
  right: -14px;
  top: -8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  animation: scoreDeltaFloat 1.2s ease-out forwards;
  pointer-events: none;
}

.progress-bar {
  width: 50px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease-out;
  width: 0%;
}

.progress-ns {
  background: linear-gradient(90deg, var(--ns-color), #85c1e9);
}
.progress-ew {
  background: linear-gradient(90deg, var(--ew-color), #f0b27a);
}

.trump-value {
  font-size: 1.1rem;
}

.hand-pts {
  font-weight: 700;
  color: var(--gold);
}

/* --- Table area — the green felt ellipse --- */
.table-area {
  grid-area: table;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

/* The felt ellipse */
.table-area::before {
  content: '';
  position: absolute;
  top: 6%;
  left: 4%;
  right: 4%;
  bottom: 6%;
  background: radial-gradient(ellipse at center, #35923f 0%, var(--felt) 40%, var(--felt-dark) 75%, var(--felt-edge) 100%);
  border-radius: 50%;
  border: 10px solid var(--wood);
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.25),
    0 0 0 3px var(--wood-light),
    0 4px 20px rgba(0,0,0,0.6);
}

/* Subtle felt texture */
.table-area::after {
  content: '';
  position: absolute;
  top: 6%;
  left: 4%;
  right: 4%;
  bottom: 6%;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* --- Player positions around the table --- */
.player-area {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  z-index: 2;
}

.player-area .player-name {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.5);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.player-area.active-player .player-name {
  color: var(--gold);
  background: rgba(60,30,10,0.7);
  border: 1px solid var(--gold);
  text-shadow: 0 0 6px rgba(201,168,76,0.3);
}

.player-area .player-cards {
  display: flex;
  gap: 0;
}

.player-area .player-cards .card {
  margin-left: -14px;
}

.player-area .player-cards .card:first-child {
  margin-left: 0;
}

/* Position: Top — at top center of ellipse */
.pos-top {
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
}

/* Position: Left — left side of ellipse */
.pos-left {
  left: 3%;
  top: 45%;
  transform: translateY(-50%);
}

/* Position: Right — right side of ellipse */
.pos-right {
  right: 3%;
  top: 45%;
  transform: translateY(-50%);
}

/* --- Trick area (center of table) --- */
.trick-area {
  position: relative;
  width: 220px;
  height: 140px;
  z-index: 2;
}

.trick-card {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trick-top    { top: 0;    left: 50%; transform: translateX(-50%); }
.trick-bottom { bottom: 0;  left: 50%; transform: translateX(-50%); }
.trick-left   { left: 10px; top: 50%; transform: translateY(-50%); }
.trick-right  { right: 10px; top: 50%; transform: translateY(-50%); }

/* --- Turn indicator --- */
.turn-indicator {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.25rem 0.8rem;
  background: rgba(0,0,0,0.6);
  border-radius: 10px;
  white-space: nowrap;
  z-index: 3;
}

.turn-indicator.my-turn {
  color: var(--gold);
  background: rgba(60,30,10,0.8);
  font-weight: 600;
  border: 1px solid var(--gold);
  box-shadow: 0 0 8px rgba(201,168,76,0.2);
}

/* --- My hand (bottom bar) --- */
.my-area {
  grid-area: hand;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.5rem;
  background: linear-gradient(180deg, #252525, #1a1a1a);
  border-top: 1px solid #333;
}

.my-seat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.my-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.my-hand .card {
  margin-left: -6px;
}

.my-hand .card:first-child {
  margin-left: 0;
}

/* --- Game message toast --- */
.game-message {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: rgba(0,0,0,0.85);
  color: var(--text);
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--gold);
  font-size: 0.85rem;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 300;
  pointer-events: none;
}

.game-message.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Hand summary overlay --- */
.hand-summary {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  flex-direction: column;
  text-align: center;
  padding: 2rem;
}

.hand-summary.visible {
  display: flex;
}

.hand-summary h2 {
  font-family: Georgia, 'Times New Roman', serif;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hand-scores {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.score-detail {
  flex: 1;
  min-width: 0;
}

.score-detail h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.tricks-list {
  margin-bottom: 0.75rem;
}

.trick-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.85rem !important;
}

.trick-row:last-child {
  border-bottom: none;
}

.trick-num {
  font-size: 0.7rem !important;
  color: var(--text-dim) !important;
  min-width: 1.5rem;
}

.trick-card-mini {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 0.85rem !important;
  padding: 0 2px;
}

.trick-card-mini.is-trump {
  text-shadow: 0 0 4px rgba(201,168,76,0.5);
}

.trick-pts {
  font-size: 0.7rem !important;
  color: var(--gold) !important;
  margin-left: auto;
  font-weight: 600;
}

.no-tricks {
  font-size: 0.8rem !important;
  font-style: italic;
  opacity: 0.5;
  padding: 0.3rem 0;
}

.team-summary {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 0.4rem;
  margin-top: 0.3rem;
}

.team-summary div {
  font-size: 0.8rem !important;
  color: var(--text-dim) !important;
  padding: 0.1rem 0;
}

.score-total {
  color: var(--gold) !important;
  font-weight: 600;
  font-size: 1rem !important;
  margin-top: 0.3rem;
}

.set-warning {
  color: var(--danger);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.game-bonus-line {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

.running-scores {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--gold);
}

.game-winner {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--gold);
  font-size: 2rem;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
}

/* --- CUT CEREMONY OVERLAY --- */
.cut-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  flex-direction: column;
  text-align: center;
  padding: 2rem;
}

.cut-overlay.visible {
  display: flex;
}

.cut-overlay h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.cut-cards {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.cut-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.cut-team-label {
  font-weight: 600;
  font-size: 1rem;
}

.cut-vs {
  font-size: 1.2rem;
  color: var(--text-dim);
  font-weight: 600;
}

.cut-result {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
}

.cut-choose-area {
  margin-top: 0.5rem;
}

.cut-choose-prompt {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.cut-choose-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.cut-waiting {
  color: var(--text-dim);
  font-size: 1rem;
}

.cut-chosen {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
}

/* ============================
   RESPONSIVE
   ============================ */

.card, .btn, .sit-btn {
  touch-action: manipulation;
}

/* Narrow screens (<768px) — compact info bar */
@media (max-width: 768px) {
  .info-bar {
    gap: 0.6rem;
    padding: 0.3rem 0.5rem;
  }

  .info-bar-group {
    font-size: 0.7rem;
    gap: 0.25rem;
  }

  .score-value {
    font-size: 1rem;
  }

  .progress-bar {
    width: 30px;
  }

  .my-hand .card {
    margin-left: -6px;
  }

  .my-area {
    padding: 0.3rem;
    padding-bottom: max(0.3rem, env(safe-area-inset-bottom));
  }

  .table-area::before,
  .table-area::after {
    top: 4%;
    left: 2%;
    right: 2%;
    bottom: 4%;
  }

  .pos-top { top: 2%; }
  .pos-left { left: 1%; }
  .pos-right { right: 1%; }

  .trick-area {
    width: 180px;
    height: 120px;
  }
}

/* Phone (<520px) */
@media (max-width: 520px) {
  html, body {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .lobby-container {
    padding: 1.5rem 1rem;
  }

  .lobby-container h1 {
    font-size: 1.8rem;
  }

  .lobby-container h1::before {
    font-size: 1rem;
    letter-spacing: 6px;
  }

  .seats-grid {
    flex-direction: column;
    gap: 0.8rem;
  }

  .team-group {
    min-width: unset;
    padding: 0.75rem 1rem;
  }

  .seat-slot {
    padding: 0.5rem 0.7rem;
  }

  .info-bar {
    gap: 0.4rem;
    padding: 0.25rem 0.4rem;
  }

  .info-bar-group {
    font-size: 0.65rem;
    gap: 0.2rem;
  }

  .info-label {
    font-size: 0.6rem;
  }

  .score-value {
    font-size: 0.9rem;
  }

  .trump-value {
    font-size: 0.9rem;
  }

  .progress-bar {
    width: 24px;
    height: 3px;
  }

  .trick-area {
    width: 150px;
    height: 100px;
  }

  .player-area .player-name {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
  }

  .player-area .player-cards .card {
    margin-left: -12px;
  }

  .turn-indicator {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    bottom: 5%;
  }

  .my-hand {
    padding: 0 4px;
  }

  .my-hand .card {
    margin-left: -6px;
  }

  .my-area {
    padding: 0.25rem 0.2rem;
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom));
  }

  .my-seat-label {
    font-size: 0.65rem;
  }

  .hand-summary,
  .cut-overlay {
    padding: 1rem;
  }

  .hand-summary h2,
  .cut-overlay h2 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
  }

  .hand-scores {
    gap: 1rem;
  }

  .score-detail h3 { font-size: 0.95rem; }
  .score-detail div { font-size: 0.8rem; }
  .running-scores { font-size: 1rem; }
  .game-winner { font-size: 1.5rem; }

  .game-message {
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
    top: 40px;
  }

  .cut-cards {
    gap: 1rem;
  }

  .table-area::before,
  .table-area::after {
    top: 3%;
    left: 1%;
    right: 1%;
    bottom: 3%;
    border-width: 6px;
  }

  .table-area::before {
    box-shadow:
      inset 0 0 30px rgba(0,0,0,0.25),
      0 0 0 2px var(--wood-light),
      0 3px 12px rgba(0,0,0,0.5);
  }
}

/* Very small phones (<380px) */
@media (max-width: 380px) {
  .lobby-container h1 { font-size: 1.5rem; }

  .trick-area {
    width: 120px;
    height: 80px;
  }

  .hand-scores {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
  .info-bar {
    padding: 0.2rem 0.5rem;
    gap: 0.8rem;
    min-height: 28px;
  }

  .info-bar-group {
    font-size: 0.7rem;
  }

  .score-value {
    font-size: 0.95rem;
  }

  .my-area {
    padding: 0.2rem;
  }

  .trick-area {
    width: 180px;
    height: 100px;
  }
}
