/* Battle Ludo - Aeroplane Chess TV View Stylesheet (Maximized 4x Screen Fill) */
:root {
  --bg-primary: #080b16;
  --bg-panel: rgba(12, 16, 28, 0.9);
  --border-neon: rgba(0, 204, 214, 0.4);
  --text-main: #f4f7fc;
  --text-muted: #95a3b8;
  --accent-gold: #ffd60a;
  --accent-cyan: #00ccd6;
  --accent-red: #ff3b30;
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
}

/* Background Image Layer */
#bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.6s ease-in-out;
  z-index: 1;
}

/* Contrast Vignette to pop board */
#bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(8, 11, 22, 0.35) 0%, rgba(4, 6, 12, 0.85) 100%);
  pointer-events: none;
  z-index: 2;
}

#tv-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 3;
}

/* BRANDING & UNIFIED WINDOW HEADERS */
.left-window-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.game-title {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, #ffffff 0%, #00ccd6 50%, #38acff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 16px rgba(0, 204, 214, 0.4);
}

.game-subtitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.left-window-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.room-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.room-badge span {
  color: var(--accent-gold);
}

/* Active Turn & Countdown Timer Header in Right Window */
.right-window-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.turn-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 12px;
  gap: 10px;
}

.turn-status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.turn-player-name {
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-phase-indicator {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Notification Toast */
#game-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 59, 48, 0.95);
  color: #fff;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  z-index: 30;
  display: none;
  animation: fadeInDown 0.25s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Header Right: Timer, Dice HUD & Connection */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.connection-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(52, 199, 89, 0.15);
  border: 1px solid rgba(52, 199, 89, 0.3);
  color: #34c759;
  display: flex;
  align-items: center;
  gap: 6px;
}

.turn-timer-widget {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 4;
}

.timer-circle-progress {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 125.6;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s linear, stroke 0.3s;
}

.timer-seconds-text {
  position: absolute;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}

.dice-hud-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dice-box {
  width: 42px;
  height: 42px;
  background: #ffffff;
  color: #121624;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dice-box.active-die {
  border: 3px solid var(--accent-gold);
  box-shadow: 0 0 16px rgba(255, 214, 10, 0.8);
  transform: scale(1.08);
}

.dice-box.rolling {
  animation: diceRollAnim 0.35s infinite linear;
}

@keyframes diceRollAnim {
  0% { transform: rotate(-10deg) scale(1.05); }
  50% { transform: rotate(10deg) scale(0.95); }
  100% { transform: rotate(-10deg) scale(1.05); }
}

/* STRICT 3-WINDOW TELEVISION LAYOUT (100% FULL-HEIGHT VIEWPORT) */
#main-view.three-window-layout {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: 285px 1fr 310px;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  gap: 10px;
  padding: 8px 10px;
}

/* Smaller windows: slim the side panels so the board keeps most of the width */
@media (max-width: 1280px) {
  #main-view.three-window-layout { grid-template-columns: 220px 1fr 240px; }
  #main-view.three-window-layout.many-players { grid-template-columns: 220px 1fr 190px; }
}

@media (max-width: 900px) {
  #main-view.three-window-layout { grid-template-columns: 170px 1fr 190px; }
  #main-view.three-window-layout.many-players { grid-template-columns: 170px 1fr 160px; }
}

/* 5-7 players: narrower right player pane, full height kept */
#main-view.three-window-layout.many-players {
  grid-template-columns: 285px 1fr 235px;
}

/* 1. LEFT WINDOW: Dynamic Action Steps & Rule Explainer */
#window-left-guide {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 5;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.1px;
  color: var(--accent-cyan);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  flex-shrink: 0;
}

.panel-title-icon {
  font-size: 18px;
}

.guide-step-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
  border-left: 5px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.step-card-badge {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.step-card-headline {
  font-size: clamp(16px, 2vh, 19px);
  font-weight: 900;
  line-height: 1.25;
  color: #ffffff;
}

.step-card-body {
  font-size: clamp(12px, 1.5vh, 14px);
  font-weight: 600;
  line-height: 1.45;
  color: #d2deec;
}

.guide-rules-summary {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: clamp(11px, 1.3vh, 13px);
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: auto;
  flex-shrink: 0;
}

.rules-summary-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.rules-summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rules-summary-list li strong {
  color: #fff;
}

/* 2. CENTER WINDOW: Main Gameboard Canvas */
#window-center-board {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(6, 8, 16, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 4;
}

#board-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* In-game toolbar (board size, fullscreen, pause, exit) */
.board-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100% - 20px);
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(10, 14, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.tb-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.tb-btn:hover { background: rgba(0, 204, 214, 0.35); }
.tb-fit { letter-spacing: 1px; }
.board-toolbar .tb-exit { min-width: 76px; }
.tb-exit { background: rgba(255, 59, 48, 0.28); border-color: rgba(255, 59, 48, 0.6); }
.tb-exit:hover { background: rgba(255, 59, 48, 0.55); }
.tb-exit.confirming { background: #ff3b30; animation: tbPulse 0.8s infinite alternate; }
.tb-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.2); margin: 0 2px; }

@keyframes tbPulse { from { opacity: 1; } to { opacity: 0.6; } }

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 14, 0.7);
  backdrop-filter: blur(4px);
}

.pause-card {
  text-align: center;
  padding: 26px 40px;
  background: rgba(14, 20, 40, 0.95);
  border: 2px solid rgba(0, 204, 214, 0.5);
  border-radius: 18px;
}

.pause-title { font-size: 34px; font-weight: 900; color: #fff; letter-spacing: 2px; }
.pause-sub { margin-top: 6px; font-size: 14px; color: var(--text-muted, #9aa4bd); }
.pause-actions { margin-top: 18px; display: flex; gap: 12px; justify-content: center; }
.pause-resume { background: rgba(52, 199, 89, 0.35); border-color: rgba(52, 199, 89, 0.7); padding: 10px 18px; font-size: 15px; }
.pause-actions .tb-exit { padding: 10px 18px; font-size: 15px; }

/* 3. RIGHT WINDOW: Big 2d6 Dice, Player HUD & Track Completion (NO SCROLL PANE) */
#window-right-players {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 5;
}

.big-dice-stage {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.big-dice-wrapper {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.dice-box.big-dice {
  width: clamp(44px, 5.2vh, 54px);
  height: clamp(44px, 5.2vh, 54px);
  font-size: clamp(22px, 2.8vh, 28px);
  font-weight: 900;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.dice-meta-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
}

.players-vertical-roster {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: clamp(3px, 0.6vh, 6px);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.roster-player-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: clamp(3px, 0.6vh, 7px) 9px;
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.4vh, 4px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s, background 0.25s;
  flex-shrink: 1;
  min-height: 0;
}

.roster-player-card.active-turn {
  transform: scale(1.015);
  border-color: var(--accent-gold);
  background: rgba(255, 214, 10, 0.08);
  box-shadow: 0 0 18px rgba(255, 214, 10, 0.35);
}

.roster-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-progress-bar-wrap {
  width: 100%;
  height: clamp(5px, 0.7vh, 8px);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1px;
}

.track-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.player-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
  font-weight: 800;
  color: #fff;
}

.player-info-text {
  display: flex;
  flex-direction: column;
}

.player-info-name {
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 5px;
  text-transform: uppercase;
  font-weight: 700;
}

.tag-cpu { background: rgba(168, 50, 230, 0.25); color: #cc80ff; }
.tag-team { background: rgba(0, 204, 214, 0.25); color: #66e5eb; }

.player-score-trophies {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.inventory-icons {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.inv-icon {
  font-size: 18px;
}

/* LOBBY MODAL */
#lobby-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 20, 0.94);
  backdrop-filter: blur(16px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 24px 40px;
  overflow-y: auto;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.lobby-title-wrap h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 204, 214, 0.5);
}

.lobby-title-wrap p {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 4px;
}

.lobby-content-grid {
  display: grid;
  grid-template-columns: 300px 1fr 400px;
  gap: 24px;
  flex: 1;
}

.join-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.qr-frame {
  width: 230px;
  height: 230px;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scan-prompt {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.url-preview-pill {
  font-size: 12px;
  color: var(--accent-cyan);
  background: rgba(0, 204, 214, 0.12);
  padding: 5px 12px;
  border-radius: 16px;
  word-break: break-all;
  margin-top: 6px;
  font-family: monospace;
}

.roster-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-head {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 480px;
}

.slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.slot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slot-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.slot-name {
  font-size: 14px;
  font-weight: 700;
}

.slot-status-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 600;
}

.status-connected { background: rgba(52, 199, 89, 0.2); color: #34c759; }
.status-cpu { background: rgba(168, 50, 230, 0.2); color: #cc80ff; }
.status-shared { background: rgba(0, 204, 214, 0.2); color: #00ccd6; }
.status-waiting { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.slot-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Dropdown lists: opaque dark background, readable highlight (selected/hovered option) */
select {
  color-scheme: dark;
}

select option {
  background-color: #151a2e;
  color: #ffffff;
}

select option:checked,
select option:hover {
  background-color: #00ccd6;
  color: #07101c;
}

.select-slot-role,
.select-slot-team {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  outline: none;
}

.settings-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 540px;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.setting-explainer {
  font-size: 11px;
  color: var(--text-muted);
}

.setting-control select,
.setting-control input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent-cyan); }
input:checked + .slider:before { transform: translateX(18px); }

.start-action-row {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  padding: 10px 0 2px;
  background: linear-gradient(to top, rgba(8, 11, 20, 0.98) 60%, rgba(8, 11, 20, 0));
  z-index: 5;
}

/* Lobby on small or short screens: the whole overlay scrolls (touch and wheel), the grid stacks, Start stays in view */
#lobby-overlay { overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
@media (max-width: 1100px) {
  #lobby-overlay { padding: 16px 16px 8px; }
  .lobby-header { flex-wrap: wrap; gap: 10px; }
  .lobby-content-grid { grid-template-columns: 1fr; gap: 14px; flex: none; }
  .settings-card, .roster-list { max-height: none; overflow-y: visible; }
  .qr-frame { width: 190px; height: 190px; }
  .btn-start-game { width: 100%; }
}
@media (max-height: 700px) and (min-width: 1101px) {
  .settings-card { max-height: calc(100vh - 210px); }
  .roster-list { max-height: calc(100vh - 260px); }
}

.btn-start-game {
  background: linear-gradient(135deg, #00ccd6 0%, #0066ff 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 12px 40px;
  border-radius: 28px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 204, 214, 0.5);
  transition: transform 0.2s;
}

.btn-start-game:hover {
  transform: scale(1.04);
}

/* TOTALS SCREEN */
#totals-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 22, 0.96);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: none;
  flex-direction: column;
  padding: 28px 40px;
  overflow-y: auto;
}

.totals-head {
  text-align: center;
  margin-bottom: 20px;
}

.totals-title {
  font-size: 38px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd60a 0%, #ff7700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.totals-winner-banner {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
}

.totals-duration-tag {
  font-size: 14px;
  color: var(--accent-cyan);
  margin-top: 3px;
  font-weight: 700;
}

.totals-grid-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1050px;
  margin: 0 auto;
  width: 100%;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stats-table th,
.stats-table td {
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-table th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 11px;
}

.stats-table td.player-col {
  text-align: left;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.totals-actions-bar {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.btn-totals-rematch {
  background: linear-gradient(135deg, #00cc44 0%, #00ccd6 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 12px 36px;
  border-radius: 26px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 204, 68, 0.4);
}



/* ---- Left pane: big dice + one big action line ---- */
#window-left-guide .left-window-top { padding: 0; }
#window-left-guide .game-title { font-size: clamp(16px, 2.6vh, 24px); margin: 0; }

.left-dice {
  width: 100%;
  padding: 10px 8px;
  gap: 6px;
}

.left-dice .big-dice-wrapper { width: 100%; gap: 14px; }

.left-dice .dice-box.big-dice {
  flex: 1 1 0;
  min-width: 0;
  max-width: 124px;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  font-size: clamp(34px, 7.5vh, 76px);
  border-radius: 16px;
}

.left-dice .dice-meta-label { font-size: clamp(12px, 1.7vh, 15px); }

.action-card {
  flex: 1;
  min-height: 0;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}

.action-card .step-card-badge { font-size: clamp(12px, 1.8vh, 16px); }

.action-card .step-card-headline {
  font-size: clamp(22px, 4.6vh, 44px);
  line-height: 1.05;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  overflow-wrap: break-word;
  word-break: normal;
}

.action-card .step-card-body {
  font-size: clamp(13px, 2vh, 18px);
  font-weight: 700;
  line-height: 1.25;
}
