/* Yamb (Jamb) Styling - Modern Dark Glassmorphic Design */

:root {
  --bg-main: #090c13;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.45);
  
  --gold-primary: #f59e0b;
  --gold-light: #fef08a;
  --gold-glow: rgba(245, 158, 11, 0.35);
  --emerald-accent: #10b981;
  --blue-accent: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --die-size: 58px;
  --radius-card: 18px;
  --radius-die: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

/* User Request: NUMBERS FONT MATCHING "COLUMN TOTAL" ('Cinzel', serif) */
.font-cinzel,
.score-cell,
.subtotal-cell,
.col-total-cell,
.gt-value,
.status-val,
.fs-val,
.fb-val,
.rolls-badge {
  font-family: 'Cinzel', serif !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
}

/* Ambient Background Glow */
.ambient-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
}

.glow-gold {
  width: 500px;
  height: 500px;
  background: var(--gold-primary);
  top: -100px;
  left: 10%;
}

.glow-blue {
  width: 600px;
  height: 600px;
  background: #3b82f6;
  bottom: -150px;
  right: 5%;
}

.glow-purple {
  width: 450px;
  height: 450px;
  background: #8b5cf6;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* TOP NAVIGATION HEADER (Matching Poker EXACTLY) */
.top-nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gold-primary, #f59e0b);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.brand-link:hover {
  transform: scale(1.02);
}

.brand-logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.nav-divider {
  color: var(--text-muted, #94a3b8);
  opacity: 0.4;
  font-size: 1.1rem;
}

.nav-sublink {
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.nav-sublink:hover {
  color: #fff;
}

/* The exact Poker pill badge style */
.game-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--gold-primary, #f59e0b);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 12px;
  border-radius: 20px;
  font-family: 'Cinzel', serif;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.conn-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.conn-dot.multiplayer {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.nav-icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.mode-btn {
  color: var(--blue-accent);
  border-color: rgba(56, 189, 248, 0.35);
}

.mode-btn:hover {
  background: rgba(56, 189, 248, 0.15);
}

.lb-btn {
  color: var(--gold-primary);
  border-color: rgba(245, 158, 11, 0.35);
}

.lb-btn:hover {
  background: rgba(245, 158, 11, 0.15);
}

.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.google-login-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.skibidi-user-pill {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--gold-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
}

/* Multiplayer Active Room Bar */
.mp-room-bar {
  background: rgba(14, 20, 32, 0.95);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 60px;
  z-index: 90;
  backdrop-filter: blur(12px);
}

.mp-bar-left, .mp-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mp-room-badge {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  color: var(--blue-accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.mp-players-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.mp-turn-indicator {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  animation: pulseGold 2s infinite ease-in-out;
}

.sheet-tabs {
  display: flex;
  gap: 6px;
}

.sheet-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.sheet-tab-btn.active {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px var(--gold-glow);
}

.mp-leave-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.mp-leave-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Main Layout */
.game-main {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.game-layout-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

/* Left Section: Controls & Dice Tray */
.dice-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 80px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.status-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.status-val {
  font-size: 1.15rem;
  color: var(--text-main);
}

.highlight-gold {
  color: var(--gold-primary) !important;
  text-shadow: 0 0 12px var(--gold-glow);
}

.rolls-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 24px;
}

.rolls-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.rolls-dots .dot.active {
  background: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
  border-color: var(--gold-light);
}

/* Announcement Banner */
.announce-banner {
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.banner-idle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.banner-can-announce {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--blue-accent);
  animation: pulseBlue 2s infinite ease-in-out;
}

.banner-announced {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  box-shadow: 0 0 20px var(--gold-glow);
  animation: pulseGold 2s infinite ease-in-out;
}

@keyframes pulseBlue {
  0%, 100% { border-color: rgba(56, 189, 248, 0.4); }
  50% { border-color: rgba(56, 189, 248, 0.9); }
}

@keyframes pulseGold {
  0%, 100% { border-color: rgba(245, 158, 11, 0.5); }
  50% { border-color: rgba(245, 158, 11, 1); }
}

.banner-icon {
  font-size: 1.15rem;
}

/* 6 Dice Tray */
.dice-tray {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 12px;
  background: rgba(9, 12, 19, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5);
}

.die-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.die-btn {
  width: var(--die-size);
  height: var(--die-size);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  perspective: 600px;
  outline: none;
  position: relative;
}

.die-face {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #ffffff 0%, #e2e8f0 100%);
  border-radius: var(--radius-die);
  box-shadow: 
    0 6px 14px rgba(0, 0, 0, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.9),
    inset 0 -3px 5px rgba(0, 0, 0, 0.18);
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid transparent;
}

.die-wrapper.locked .die-face {
  border: 2.5px solid var(--gold-primary);
  box-shadow: 
    0 0 16px var(--gold-glow),
    0 6px 14px rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(255, 255, 255, 0.9);
  transform: translateY(-3px) scale(1.04);
}

.die-wrapper:not(.locked) .die-btn:hover .die-face {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
}

/* Die Rolling Animation */
.die-face.rolling {
  animation: diceRollAnimation 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes diceRollAnimation {
  0% { transform: rotate(0deg) scale(0.9); }
  25% { transform: rotate(-25deg) translateY(-8px) scale(1.1); }
  50% { transform: rotate(30deg) translateY(-4px) scale(1.05); }
  75% { transform: rotate(-10deg) translateY(-2px); }
  100% { transform: rotate(0deg) scale(1); }
}

/* Pips */
.pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1e293b 50%, #0f172a 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 1px rgba(255, 255, 255, 0.3);
  place-self: center;
}

.die-1 .pip-center { grid-area: 2 / 2 / 3 / 3; }
.die-2 .pip-top-left { grid-area: 1 / 1 / 2 / 2; }
.die-2 .pip-bottom-right { grid-area: 3 / 3 / 4 / 4; }
.die-3 .pip-top-left { grid-area: 1 / 1 / 2 / 2; }
.die-3 .pip-center { grid-area: 2 / 2 / 3 / 3; }
.die-3 .pip-bottom-right { grid-area: 3 / 3 / 4 / 4; }
.die-4 .pip-top-left { grid-area: 1 / 1 / 2 / 2; }
.die-4 .pip-top-right { grid-area: 1 / 3 / 2 / 4; }
.die-4 .pip-bottom-left { grid-area: 3 / 1 / 4 / 2; }
.die-4 .pip-bottom-right { grid-area: 3 / 3 / 4 / 4; }
.die-5 .pip-top-left { grid-area: 1 / 1 / 2 / 2; }
.die-5 .pip-top-right { grid-area: 1 / 3 / 2 / 4; }
.die-5 .pip-center { grid-area: 2 / 2 / 3 / 3; }
.die-5 .pip-bottom-left { grid-area: 3 / 1 / 4 / 2; }
.die-5 .pip-bottom-right { grid-area: 3 / 3 / 4 / 4; }
.die-6 .pip-top-left { grid-area: 1 / 1 / 2 / 2; }
.die-6 .pip-top-right { grid-area: 1 / 3 / 2 / 4; }
.die-6 .pip-mid-left { grid-area: 2 / 1 / 3 / 2; }
.die-6 .pip-mid-right { grid-area: 2 / 3 / 3 / 4; }
.die-6 .pip-bottom-left { grid-area: 3 / 1 / 4 / 2; }
.die-6 .pip-bottom-right { grid-area: 3 / 3 / 4 / 4; }

.die-lock-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s;
}

.die-wrapper.locked .die-lock-tag {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-primary);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Roll Button & Action Bar */
.roll-action-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-roll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  color: #000;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-roll-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.5);
  filter: brightness(1.06);
}

.cta-roll-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.cta-roll-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.rolls-badge {
  background: #000;
  color: var(--gold-primary);
  font-size: 0.85rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cancel-announce-btn {
  width: 100%;
  padding: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-announce-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
}

.controls-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}

.quick-tools {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.tool-btn {
  flex: 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

/* Right Section: Score Sheet Card */
.sheet-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.sheet-header-title {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.sheet-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-title {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.sheet-player-tag {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
}

.sheet-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* The Yamb Table */
.yamb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
}

.col-head {
  padding: 10px 8px;
  background: rgba(14, 20, 32, 0.8);
  border: 1px solid var(--border-subtle);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  color: var(--gold-primary);
  border-radius: 6px;
}

.col-figure {
  text-align: left;
  padding-left: 14px;
  width: 220px;
}

.col-title {
  font-size: 0.88rem;
  font-weight: 800;
}

.col-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1;
  margin-top: 2px;
}

/* Category Label Rows */
.row-cat td {
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

/* Data Rows */
.row-data td {
  padding: 8px 12px;
  font-size: 0.92rem;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
}

.cell-label {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
}

.dice-icon {
  font-size: 1.15rem;
  margin-right: 6px;
  vertical-align: middle;
  color: var(--gold-primary);
}

/* Score Cells */
.score-cell {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: default;
  user-select: none;
}

/* Playable / Valid Cell State */
.score-cell.playable {
  cursor: pointer;
  background: rgba(245, 158, 11, 0.06);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  color: var(--text-muted);
}

.score-cell.playable:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--gold-primary);
  box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.25);
  transform: scale(1.02);
}

/* Score Preview / Ghost Value */
.score-cell.preview-score {
  color: var(--gold-light);
  font-style: italic;
}

/* Announced Cell in Column N */
.score-cell.announced {
  background: rgba(245, 158, 11, 0.22) !important;
  border: 2px solid var(--gold-primary) !important;
  color: var(--gold-primary) !important;
  box-shadow: 0 0 14px var(--gold-glow);
  animation: cellPulse 1.8s infinite ease-in-out;
}

@keyframes cellPulse {
  0%, 100% { border-color: rgba(245, 158, 11, 0.5); }
  50% { border-color: rgba(245, 158, 11, 1); }
}

/* Permanently Filled Cell */
.score-cell.filled {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.score-cell.scratched {
  color: #ef4444 !important;
  text-decoration: line-through;
  opacity: 0.65;
}

/* Subtotal Rows (Sum 1, Difference, Sum 3) */
.row-subtotal td {
  padding: 8px 12px;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 0.88rem;
}

.cell-subtotal-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subtotal-title {
  color: var(--blue-accent);
}

.subtotal-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 400;
}

.subtotal-cell {
  text-align: center;
  font-size: 1.05rem;
  color: var(--blue-accent);
}

/* Column Total Row */
.row-col-total td {
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  font-size: 0.92rem;
}

.cell-total-label {
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.col-total-cell {
  text-align: center;
  font-size: 1.15rem;
  color: var(--gold-primary);
}

/* Grand Total Banner */
.grand-total-banner {
  margin-top: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.25) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 24px var(--gold-glow);
}

.grand-total-left {
  display: flex;
  flex-direction: column;
}

.gt-label {
  font-size: 1.25rem;
  color: var(--gold-primary);
  letter-spacing: 1.5px;
}

.gt-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.gt-value {
  font-size: 2.3rem;
  color: #fff;
  text-shadow: 0 0 20px var(--gold-glow);
}

/* MODE SELECTION MODAL STYLES */
.mode-dialog {
  max-width: 560px;
}

.mode-modal-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.google-notice-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px solid var(--gold-primary);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 4px 20px var(--gold-glow);
}

.notice-badge {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.notice-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.modal-google-bar {
  margin-top: 10px;
}

.google-login-btn-prominent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1e293b;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.2s;
}

.google-login-btn-prominent:hover {
  transform: translateY(-2px);
  background: #f1f5f9;
}

.signed-in-pill {
  font-size: 0.84rem;
  color: #10b981;
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.mode-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.25s;
}

.mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-3px);
}

.mode-card-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  margin-bottom: 12px;
}

.highlight-mp {
  background: rgba(56, 189, 248, 0.2);
  color: var(--blue-accent);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.mode-card-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.mode-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.mode-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.mode-btn-cta {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: 10px;
  color: #000;
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--gold-glow);
}

.mode-btn-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.secondary-cta {
  background: rgba(56, 189, 248, 0.15) !important;
  color: var(--blue-accent) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  box-shadow: none !important;
}

.secondary-cta:hover {
  background: rgba(56, 189, 248, 0.25) !important;
}

.mp-room-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 600;
}

.modal-input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(9, 12, 19, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus {
  border-color: var(--gold-primary);
}

.text-uppercase {
  text-transform: uppercase;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.flex-1 {
  flex: 1;
}

.or-divider {
  text-align: center;
  position: relative;
  margin: 6px 0;
}

.or-divider span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: #111624;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}

.or-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

/* LOBBY MODAL STYLES */
.lobby-dialog {
  max-width: 480px;
}

.lobby-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.room-code-display {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 6px;
  margin: 4px 0 10px;
  text-shadow: 0 0 20px var(--gold-glow);
}

.lobby-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.copy-link-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.share-link-input {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.copy-btn {
  padding: 9px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

.lobby-players-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
}

.lobby-players-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.lobby-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.lobby-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lp-avatar {
  font-size: 1.25rem;
}

.lp-name {
  font-size: 0.92rem;
  font-weight: 600;
}

.lp-host-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-primary);
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.start-match-btn {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  letter-spacing: 1px;
}

.waiting-pulse {
  font-size: 0.88rem;
  color: var(--text-muted);
  animation: pulseGold 2s infinite ease-in-out;
}

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

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

.modal-dialog {
  background: #111624;
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px var(--gold-glow);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-head h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
}

.rules-content h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold-primary);
  margin: 14px 0 6px 0;
  font-size: 1.05rem;
}

.rules-content p, .rules-content ul {
  margin-bottom: 10px;
  color: #cbd5e1;
}

.rules-content ul {
  padding-left: 20px;
}

.rules-content li {
  margin-bottom: 6px;
}

.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.modal-action-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: 1rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-action-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.dual-foot {
  display: flex;
  gap: 12px;
  width: 100%;
}

.dual-foot .modal-action-btn {
  flex: 1;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-subtle) !important;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

/* Victory / Game Over Dialog */
.victory-dialog {
  max-width: 480px;
}

.victory-trophy {
  font-size: 4rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.6));
  animation: bounceTrophy 1.5s infinite alternate ease-in-out;
}

@keyframes bounceTrophy {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.victory-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.final-score-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--gold-primary);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.fs-label {
  display: block;
  font-size: 0.85rem;
  color: var(--gold-primary);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.fs-val {
  font-size: 2.8rem;
  color: #fff;
  text-shadow: 0 0 16px var(--gold-glow);
}

.final-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.fb-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
}

.fb-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.fb-val {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-top: 2px;
}

.google-login-btn-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.google-login-btn-large:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Site Footer & Buy Me A Coffee */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 36px 20px 40px;
  z-index: 10;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.kofi-footer-container {
  margin-bottom: 6px;
}

.kofi-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000000 !important;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.kofi-button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.6);
  filter: brightness(1.05);
}

.kofi-icon {
  font-size: 1.25rem;
  display: inline-block;
  animation: kofi-wiggle 3.5s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes kofi-wiggle {
  0%, 82%, 100% { transform: rotate(0deg); }
  86% { transform: rotate(-12deg); }
  90% { transform: rotate(10deg); }
  94% { transform: rotate(-6deg); }
  97% { transform: rotate(4deg); }
}

.footer-legal {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: underline;
  font-size: 0.82rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #fff;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .game-layout-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .dice-panel {
    position: static;
  }
  
  .sheet-title {
    font-size: 1.4rem;
  }

  .mode-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .top-nav {
    padding: 0 12px;
  }

  .nav-sublink {
    font-size: 0.8rem;
  }

  .brand-link span {
    display: inline;
  }

  .conn-status {
    display: none;
  }

  .dice-panel, .sheet-card {
    padding: 14px;
    border-radius: 14px;
  }

  :root {
    --die-size: 48px;
    --radius-die: 10px;
  }

  .pip {
    width: 8px;
    height: 8px;
  }

  .col-figure {
    width: 130px;
    padding-left: 6px;
  }

  .row-data td, .col-head {
    padding: 6px 3px;
    font-size: 0.78rem;
  }

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

  .gt-label {
    font-size: 1rem;
  }

  .gt-value {
    font-size: 1.8rem;
  }
}
