/* styles.css - Modern, High-Contrast Contract Bridge CSS System */

:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --table-bg: radial-gradient(circle at center, #1b4332 0%, #081c15 100%);
  --table-border: #2d6a4f;
  --felt-green: #113826;
  
  --card-bg: #ffffff;
  --card-border: #cfd8dc;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  
  --suit-red: #d90429;
  --suit-black: #1a1d20;

  --accent-gold: #ffb703;
  --accent-blue: #0284c7;
  --accent-green: #2a9d8f;

  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
  
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
  min-height: 100vh;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header Navbar */
.top-nav {
  height: 56px;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
}

.suit-icon.red { color: var(--suit-red); }
.suit-icon.black { color: #f8fafc; }

.game-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.seat-badge {
  background: #334155;
  padding: 0.25rem 0.6rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-gold);
}

/* Buttons */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-sm { font-size: 0.82rem; padding: 0.35rem 0.7rem; }
.btn-primary { background-color: var(--accent-blue); color: white; }
.btn-primary:hover { background-color: #0369a1; }

.btn-secondary { background-color: #475569; color: white; }
.btn-secondary:hover { background-color: #334155; }

.btn-outline { background: transparent; border: 1px solid #475569; color: var(--text-light); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); }

.btn-dark { background-color: #0f172a; color: #cbd5e1; border: 1px solid #334155; }
.btn-dark:hover { background-color: #1e293b; color: white; }

.btn-danger { background-color: #ef4444; color: white; }
.btn-danger:hover { background-color: #dc2626; }

/* Main Layout Grid */
.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  overflow: hidden;
}

/* Felt Bridge Table */
.bridge-table {
  background: var(--table-bg);
  position: relative;
  display: grid;
  grid-template-rows: 130px 1fr 130px;
  grid-template-columns: 100px 1fr 100px;
  grid-template-areas:
    "top-left     pos-top    top-right"
    "pos-left     center     pos-right"
    "bot-left     pos-bottom bot-right";
  padding: 1rem;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8);
}

/* Player Zones */
.player-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
}

.pos-top    { grid-area: pos-top; flex-direction: column; }
.pos-bottom { grid-area: pos-bottom; flex-direction: column; }
.pos-left   { grid-area: pos-left; flex-direction: column; justify-content: center; }
.pos-right  { grid-area: pos-right; flex-direction: column; justify-content: center; }

.player-header {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.seat-tag {
  font-weight: 700;
  color: var(--accent-gold);
}

.player-name {
  font-weight: 600;
  color: white;
}

.vul-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  background: #475569;
}

.vul-badge.vulnerable {
  background: #dc2626;
  color: white;
}

.role-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
}

/* Hand Containers & Card Fan */
.hand-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

/* Vertical Stacking for Side Hands (Left & Right) */
.pos-left .hand-container,
.pos-right .hand-container {
  flex-direction: column;
  min-height: auto;
  align-items: center;
}

.pos-left .hand-container .hand-card-holder,
.pos-right .hand-container .hand-card-holder {
  margin-left: 0 !important;
  margin-top: -66px;
}

.pos-left .hand-container .hand-card-holder:first-child,
.pos-right .hand-container .hand-card-holder:first-child {
  margin-top: 0 !important;
}

/* Center Table Hub */
.center-hub {
  grid-area: center;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  margin: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  position: relative;
}

.hub-status-bar {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.82rem;
}

.dealer-tag, .phase-tag, .tricks-tracker {
  background: rgba(0, 0, 0, 0.5);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.phase-tag { color: var(--accent-gold); }

.contract-banner {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--accent-gold);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 0 15px rgba(255, 183, 3, 0.2);
}

.turn-indicator {
  font-size: 0.9rem;
  color: #e2e8f0;
  background: rgba(2, 132, 199, 0.3);
  border: 1px solid var(--accent-blue);
  padding: 0.25rem 0.8rem;
  border-radius: 12px;
  margin-top: 0.2rem;
}

/* Trick Played Cards Surface */
.trick-surface {
  position: relative;
  width: 270px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trick-card-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 10;
}

.trick-card-slot.pos-top    { top: 5px; left: calc(50% - 32.5px); }
.trick-card-slot.pos-bottom { bottom: 5px; left: calc(50% - 32.5px); }
.trick-card-slot.pos-left   { left: 10px; top: calc(50% - 55px); }
.trick-card-slot.pos-right  { right: 10px; top: calc(50% - 55px); }

.trick-seat-tag {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.trick-card-slot.winner-slot .playing-card {
  outline: 3px solid var(--accent-gold);
  box-shadow: 0 0 20px var(--accent-gold);
  transform: scale(1.08);
  z-index: 25;
}

.trick-winner-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8);
  z-index: 30;
  pointer-events: none;
}

.dummy-notice-banner {
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  margin-top: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* CRISP PLAYING CARDS DESIGN */
.playing-card {
  width: 65px;
  height: 92px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  position: relative;
  user-select: none;
  cursor: pointer;
  /* Hand cards need a fixed hit target while hovered; animation made the
     overlapping cards appear to bounce as the pointer crossed their edges. */
  transition: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px;
}

.hand-card-holder {
  position: relative;
  flex: 0 0 auto;
  width: 65px;
  height: 92px;
  margin-left: -28px;
}

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

.hand-card-holder:hover {
  z-index: 50;
}

.hand-card-holder > .playing-card {
  position: absolute;
  inset: 0;
  margin: 0;
  transition: none;
}

.hand-card-holder:hover > .playing-card:not(.card-back) {
  transform: translateY(-5px);
}

.playing-card.playable {
  outline: 2px solid var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold);
}

.playing-card.disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Suit Colors */
.playing-card.suit-S, .playing-card.suit-C { color: var(--suit-black); }
.playing-card.suit-H, .playing-card.suit-D { color: var(--suit-red); }

/* Corner Rank + Suit */
.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card-rank {
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-mono);
}

.card-suit-mini {
  font-size: 0.75rem;
}

.corner-top-left {
  align-self: flex-start;
}

.corner-bottom-right {
  align-self: flex-end;
  transform: rotate(180deg);
}

/* Center Suit Icon */
.card-center-suit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  line-height: 1;
}

/* CARD BACK VECTOR DESIGN */
.playing-card.card-back {
  background-color: #1e293b;
  background-image: radial-gradient(#38bdf8 1px, transparent 1px), radial-gradient(#38bdf8 1px, #0f172a 1px);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  border: 2px solid #e2e8f0;
  cursor: default;
}

/* Side Panel */
.side-panel {
  background: var(--bg-card);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.panel-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  padding: 0.85rem;
}

.panel-card h3 {
  font-size: 0.95rem;
  color: var(--accent-gold);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Auction Grid Table */
.auction-grid-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: #1e293b;
  padding: 0.3rem 0;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.auction-grid-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-size: 0.82rem;
  text-align: center;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
}

.bid-item {
  padding: 0.25rem 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.bid-item.pass { color: #94a3b8; }
.bid-item.double { color: #ef4444; font-weight: bold; }
.bid-item.redouble { color: #38bdf8; font-weight: bold; }

/* Score Summary */
.score-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.25rem;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.15rem;
  color: white;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.25rem;
}

/* Non-blocking Bidding Box Overlay */
#bidding-modal {
  background: transparent !important;
  backdrop-filter: none !important;
  pointer-events: none;
  align-items: flex-start;
  padding-top: 30px;
}

#bidding-modal .bidding-dialog {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 2px solid var(--accent-gold);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
  max-width: 480px;
  border-radius: var(--border-radius-lg);
}

.bidding-hand-preview {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  justify-content: center;
}

.hand-suit-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.hand-suit-group.suit-H, .hand-suit-group.suit-D { color: var(--suit-red); }
.hand-suit-group.suit-S, .hand-suit-group.suit-C { color: #f8fafc; }

.player-zone.my-hand-zone .player-header {
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 15px rgba(255, 183, 3, 0.5);
  background: rgba(15, 23, 42, 0.95);
}

.player-zone.my-hand-zone .hand-container .playing-card {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

/* Bidding Box Layout */
.bidding-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 1rem;
}

.btn-bid {
  padding: 0.6rem 0.2rem;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  background: #0f172a;
  border: 1px solid #334155;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-bid:hover:not(:disabled) {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

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

.bidding-special-actions {
  display: flex;
  gap: 10px;
}

.bidding-special-actions .btn-bid {
  flex: 1;
  padding: 0.75rem;
  font-weight: bold;
}

.btn-pass { background: #334155; }
.btn-double { background: #991b1b; }
.btn-redouble { background: #075985; }

/* Seats Picker Modal */
.name-input-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.name-input-group input {
  padding: 0.6rem;
  background: #0f172a;
  border: 1px solid #334155;
  color: white;
  border-radius: 6px;
  font-family: var(--font-main);
}

.seats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1rem;
}

.seat-option-btn {
  background: #0f172a;
  border: 1px solid #334155;
  padding: 0.85rem;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.seat-option-btn:hover:not(:disabled) {
  border-color: var(--accent-gold);
  background: #1e293b;
}

.seat-name { font-weight: 700; color: var(--accent-gold); }
.seat-status { font-size: 0.8rem; color: var(--text-muted); }

/* Running Rubber Bridge score sheet */
.scorecard-dialog {
  width: min(94vw, 720px);
  max-width: none;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.scorecard-dialog .modal-body { overflow: auto; }

.rubber-sheet-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.rubber-sheet-intro strong { color: var(--accent-gold); white-space: nowrap; }

.rubber-running-sheet {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #94a3b8;
  padding: 0.55rem 1rem;
  background: #f8fafc;
  color: #0f172a;
  font-family: var(--font-mono);
}

.rubber-running-sheet::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.55rem;
  bottom: 0.55rem;
  border-left: 2px solid #0f172a;
  pointer-events: none;
}

.running-sheet-header,
.running-score-row,
.running-sheet-total {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
}

.running-sheet-header {
  padding: 0.3rem 0 0.55rem;
  border-bottom: 2px solid #0f172a;
  font-family: var(--font-main);
}

.running-score-entries { display: flex; flex-direction: column; }
.running-score-row { min-height: 30px; align-items: center; }
#score-above-entries .running-score-row { min-height: 0; line-height: 1.25; padding: 0.05rem 0; }
.running-score-row.latest-score { color: #dc2626; font-weight: 700; }
.running-score-row.game-complete { border-bottom: 2px dotted #dc2626; padding-bottom: 0.4rem; }
.running-score-row small {
  grid-column: 1 / -1;
  color: #dc2626;
  font: 700 0.62rem var(--font-main);
  padding: 0.15rem 0 0.2rem;
}

.running-main-line { border-top: 2px solid #0f172a; margin: 0.15rem 0; }

.running-entry-caption { padding: 0.3rem 0 0; color: #64748b; text-align: center; font: 0.68rem var(--font-main); }
.running-entry-caption + .running-score-row { color: #dc2626; font-weight: 700; }
.running-sheet-total { margin-top: 0.45rem; padding-top: 0.5rem; border-top: 3px double #0f172a; font-family: var(--font-main); }
.running-sheet-total > div { display: flex; justify-content: space-around; gap: 0.4rem; }
.running-sheet-total span { color: #475569; font-size: 0.72rem; }
.running-sheet-total strong { color: #dc2626; }

.hand-history-log { margin-top: 1rem; }
.hand-history-log h3 { margin-bottom: 0.4rem; }
.history-deal-row { display: flex; gap: 0.75rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 0.82rem; }
.history-deal-row strong { flex: 0 0 52px; color: var(--accent-gold); }

/* Admin Modal */
.admin-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-section h3 {
  font-size: 0.95rem;
  color: var(--accent-gold);
  margin-bottom: 0.6rem;
}

.admin-login-form {
  display: flex;
  gap: 8px;
}

.admin-login-form input {
  flex: 1;
  padding: 0.5rem;
  background: #0f172a;
  border: 1px solid #334155;
  color: white;
  border-radius: 6px;
}

.admin-seat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-seat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Toast */
.toast-message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-gold);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: none;
  z-index: 300;
  font-weight: 600;
}

.toast-message.active {
  display: block;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  
  .side-panel {
    max-height: 220px;
    flex-direction: row;
  }
  
  .panel-card { flex: 1; }
}

@media (max-width: 640px) {
  .top-nav {
    height: auto;
    min-height: 54px;
    padding: 0.35rem 0.45rem;
    gap: 0.35rem;
  }
  
  .brand { flex: 0 0 auto; gap: 0.2rem; font-size: 1rem; }
  .brand-title { display: none; }
  .header-actions { flex: 1; min-width: 0; justify-content: flex-end; gap: 0.25rem; }
  .header-actions .btn { padding: 0.35rem 0.42rem; font-size: 0.68rem; white-space: nowrap; }
  .seat-badge { padding: 0.2rem 0.35rem; font-size: 0.62rem; white-space: nowrap; }

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }

  .side-panel {
    max-height: none;
    flex-direction: column;
    overflow: visible;
    padding: 0.55rem;
    gap: 0.55rem;
  }

  .panel-card { min-width: 0; padding: 0.65rem; }
  
  .bridge-table {
    grid-template-rows: clamp(88px, 22vw, 110px) minmax(0, 1fr) clamp(92px, 24vw, 118px);
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    min-width: 0;
    padding: 0.2rem;
  }

  .player-zone { min-width: 0; }
  .pos-left .player-header,
  .pos-right .player-header {
    width: 42px;
    justify-content: center;
    padding: 0.2rem 0.1rem;
    margin-bottom: 0.25rem;
    font-size: 0.58rem;
    gap: 0;
  }

  .pos-left .player-name,
  .pos-right .player-name,
  .pos-left .vul-badge,
  .pos-right .vul-badge,
  .pos-left .role-badge,
  .pos-right .role-badge { display: none; }

  .pos-left .hand-container,
  .pos-right .hand-container { width: 100%; }

  .pos-left .hand-container .hand-card-holder,
  .pos-right .hand-container .hand-card-holder {
    width: 28px;
    height: 40px;
    margin-top: -36px;
  }

  .pos-left .hand-container .hand-card-holder:first-child,
  .pos-right .hand-container .hand-card-holder:first-child { margin-top: 0; }

  .pos-top .hand-card-holder,
  .pos-bottom .hand-card-holder {
    width: clamp(28px, calc(13.16vw - 11px), 48px);
    height: clamp(40px, calc(18.63vw - 15.6px), 68px);
    margin-left: clamp(-22px, calc(-5.92vw + 5px), -12px);
  }

  .pos-top .hand-card-holder:first-child,
  .pos-bottom .hand-card-holder:first-child { margin-left: 0; }

  .pos-top .playing-card,
  .pos-bottom .playing-card {
    width: 100%;
    height: 100%;
    padding: 2px 3px;
  }
  
  .pos-left .playing-card,
  .pos-right .playing-card { width: 28px; height: 40px; padding: 1px 2px; }

  .card-rank { font-size: 0.65rem; }
  .card-center-suit { font-size: 0.95rem; }

  .center-hub { min-width: 0; margin: 0.2rem; padding: 0.4rem; }
  .hub-status-bar { flex-wrap: wrap; justify-content: center; gap: 0.25rem; font-size: 0.65rem; }
  .dealer-tag, .phase-tag, .tricks-tracker { padding: 0.2rem 0.35rem; }
  .contract-banner { max-width: 100%; padding: 0.35rem 0.55rem; font-size: 0.82rem; text-align: center; }
  .turn-indicator { max-width: 100%; padding: 0.25rem 0.45rem; font-size: 0.72rem; text-align: center; }
  .trick-surface { width: 100%; height: clamp(110px, 35vw, 180px); }

  .app-container { height: auto; min-height: 100vh; min-height: 100dvh; }
  .game-layout { flex: 1 0 auto; min-height: 68vh; overflow: visible; }
  .scorecard-dialog { width: 96vw; max-height: 86vh; }
  .rubber-sheet-intro { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .rubber-score-column { flex-basis: 128px; min-height: 280px; }
  .history-deal-row { align-items: flex-start; flex-direction: column; gap: 0.1rem; }

}
