/* Offline Tailwind-style Utilities + Royal Ludo King Theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 50% 20%, #1e3a8a 0%, #0f172a 60%, #020617 100%);
  color: #f8fafc;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Utilities */
.container { max-width: 1180px; margin: 0 auto; padding: 0.65rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-semibold { font-weight: 600; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.invisible { visibility: hidden; pointer-events: none; }

/* Royal Glass Cards */
.card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.95));
  border: 1.5px solid rgba(251, 191, 36, 0.25);
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.input {
  background: #0b1222;
  border: 1.5px solid #334155;
  color: #f8fafc;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  outline: none;
  font-size: 0.9rem;
}
.input:focus { border-color: #fbbf24; }

/* Royal Buttons */
.btn {
  border: none;
  cursor: pointer;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  border-radius: 0.65rem;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 55%, #d97706 100%);
  color: #1e1b4b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255,255,255,0.6);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.06); }
.btn-blue {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
.btn-red {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  color: #fff;
}
.btn-slate {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
}
.btn-slate:hover:not(:disabled) { background: #334155; }

/* Theme Color Badges */
.c-red { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; }
.c-green { background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; }
.c-yellow { background: linear-gradient(135deg, #facc15, #ca8a04); color: #111827; }
.c-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; }

/* ===== ARENA SHELL (INDEX & CONTROLLER) ===== */
.arena-shell {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.corner-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

/* Main Game Corner Pods (index.html) */
.player-pod {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
  border: 2px solid #334155;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  min-height: 76px;
}

.player-pod.pod-right { flex-direction: row-reverse; }
.player-pod.pod-right .pod-meta { text-align: right; align-items: flex-end; }

.player-pod.pod-red { border-left: 4px solid #ef4444; }
.player-pod.pod-green { border-right: 4px solid #22c55e; }
.player-pod.pod-blue { border-left: 4px solid #3b82f6; }
.player-pod.pod-yellow { border-right: 4px solid #eab308; }

.player-pod.active-turn {
  border-color: #fde047 !important;
  box-shadow: 0 0 18px rgba(253, 224, 71, 0.45), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.player-pod.exited-pod {
  opacity: 0.48;
  filter: grayscale(0.75);
}

.pod-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.pod-name {
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pod-leave-btn {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.38);
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
}
.pod-leave-btn:hover:not(:disabled) { background: #dc2626; color: #fff; }
.pod-leave-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ===== CONTROLLER OUTER BOUNDARY FRAME (DOUBLE BEZEL AROUND BOARD) ===== */
.ctrl-outer-frame {
  padding: 7px;
  border-radius: 20px;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 52%, #172554 100%);
  border: 2.5px solid #f59e0b;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(253, 224, 71, 0.22);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-outer-frame .board-frame {
  padding: 6px;
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 3px rgba(255, 255, 255, 0.45);
}

.ctrl-rim-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ctrl-rim-slot {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 11px;
  background: rgba(11, 18, 34, 0.88);
  border: 1.5px solid #334155;
  min-width: 0;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.ctrl-rim-slot.rim-red { border-top: 3px solid #ef4444; }
.ctrl-rim-slot.rim-green { border-top: 3px solid #22c55e; }
.ctrl-rim-slot.rim-blue { border-bottom: 3px solid #3b82f6; }
.ctrl-rim-slot.rim-yellow { border-bottom: 3px solid #eab308; }

.ctrl-rim-slot.active-turn {
  border-color: #fde047 !important;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.35);
}

.ctrl-rim-slot.exited-pod {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.rim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.rim-player-info {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.rim-name {
  font-size: 0.74rem;
  font-weight: 800;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rim-right-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Auto Pill Button */
.rim-auto-btn {
  height: 23px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.12s;
}
.rim-auto-btn.active {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  color: #ffffff;
  border-color: #7dd3fc;
  box-shadow: 0 0 7px rgba(56, 189, 248, 0.45);
}
.rim-auto-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Lock Every Turn Checkbox Pill */
.rim-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 23px;
  padding: 0 6px;
  border-radius: 6px;
  background: #1e293b;
  border: 1px solid #475569;
  font-size: 0.68rem;
  font-weight: 800;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.12s;
}
.rim-lock-pill input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: #f59e0b;
  cursor: pointer;
}
.rim-lock-pill.locked-on {
  background: rgba(245, 158, 11, 0.22);
  border-color: #fbbf24;
  color: #fde047;
}

/* Single Row 1-6 Digit Buttons */
.rim-nums-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}

.rim-num-btn {
  height: 29px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #162033;
  color: #f1f5f9;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s, background 0.12s, border-color 0.12s;
}
.rim-num-btn:active { transform: scale(0.92); }
.rim-num-btn:hover:not(:disabled) { border-color: #fbbf24; color: #fde047; }
.rim-num-btn.active {
  background: linear-gradient(180deg, #fde047, #f59e0b);
  color: #0f172a;
  border-color: #fde047;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}
.rim-num-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ===== REALTIME DICE DIGIT CENTERED INSIDE PLAYER YARD ===== */
.yard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  place-items: center;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.yard-dice-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 33%;
  height: 33%;
  border-radius: 26%;
  background: linear-gradient(145deg, #f8fafc, #e2e8f0);
  color: #0f172a;
  border: 2.5px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: clamp(0.9rem, 4.2vw, 1.55rem);
  line-height: 1;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.28), inset 0 1px 2px rgba(255, 255, 255, 0.9);
  z-index: 4;
  pointer-events: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.yard-dice-badge.yd-red { border-color: #dc2626; }
.yard-dice-badge.yd-green { border-color: #16a34a; }
.yard-dice-badge.yd-yellow { border-color: #ca8a04; }
.yard-dice-badge.yd-blue { border-color: #2563eb; }

.yard-dice-badge.has-turn {
  background: linear-gradient(145deg, #fef08a, #f59e0b);
  border-color: #78350f;
  color: #0f172a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85), 0 3px 8px rgba(0, 0, 0, 0.35);
}

.yard-dice-badge.is-six {
  color: #b91c1c;
}

.yard-dice-badge.is-exited {
  background: #1e293b;
  color: #f87171;
  border-color: #ef4444;
  font-size: clamp(0.65rem, 2.5vw, 0.9rem);
}

.yard-dice-badge.is-won {
  background: linear-gradient(145deg, #fde047, #d97706);
  color: #1e1b4b;
  border-color: #ffffff;
  font-size: clamp(0.7rem, 2.8vw, 1rem);
}

.yard-dice-badge.pop-flash {
  animation: yardDicePop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes yardDicePop {
  0%   { transform: translate(-50%, -50%) scale(1.42); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* Status Banner */
.status-bar {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 0.75rem;
  padding: 0.42rem 0.8rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fde047;
}

.recent-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

/* ===== ROYAL LUDO KING BOARD ===== */
.board-frame {
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fbbf24 0%, #92400e 48%, #f59e0b 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 2px 4px rgba(255,255,255,0.5);
  width: 100%;
  margin: 0 auto;
}

.board-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.25);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  width: 100%;
  height: 100%;
}

.cell {
  border: 0.75px solid #cbd5e1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.cell-white { background: #ffffff; }
.cell-red { background: #dc2626; border-color: #b91c1c; }
.cell-green { background: #16a34a; border-color: #15803d; }
.cell-yellow { background: #eab308; border-color: #ca8a04; }
.cell-blue { background: #2563eb; border-color: #1d4ed8; }

.cell-star svg { width: 68%; height: 68%; opacity: 0.4; }
.cell-start svg { width: 68%; height: 68%; opacity: 0.92; }
.cell-arrow { font-size: 0.9rem; font-weight: 900; line-height: 1; }

/* 4 Corner Royal Home Yards */
.yard {
  position: absolute;
  width: 40%;
  height: 40%;
  padding: 5%;
  pointer-events: none;
  z-index: 2;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.yard-red { top: 0; left: 0; background: linear-gradient(135deg, #ef4444, #b91c1c); border-right: 2px solid #7f1d1d; border-bottom: 2px solid #7f1d1d; }
.yard-green { top: 0; right: 0; background: linear-gradient(135deg, #22c55e, #15803d); border-left: 2px solid #14532d; border-bottom: 2px solid #14532d; }
.yard-yellow { bottom: 0; right: 0; background: linear-gradient(135deg, #facc15, #ca8a04); border-left: 2px solid #854d0e; border-top: 2px solid #854d0e; }
.yard-blue { bottom: 0; left: 0; background: linear-gradient(135deg, #3b82f6, #1d4ed8); border-right: 2px solid #1e3a8a; border-top: 2px solid #1e3a8a; }

.yard.active-yard {
  box-shadow: inset 0 0 0 4px rgba(254, 240, 138, 0.95);
  animation: yardGlow 1.1s ease-in-out infinite alternate;
}
.yard.exited-yard { filter: grayscale(0.85) brightness(0.65); }
@keyframes yardGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.16); }
}

.yard-spot {
  width: 58%;
  height: 58%;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.22);
  opacity: 0.35;
}

/* Center Home Triangles */
.home-center {
  position: absolute;
  left: 40%;
  top: 40%;
  width: 20%;
  height: 20%;
  z-index: 3;
  border: 2px solid #1e293b;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-center svg { width: 100%; height: 100%; display: block; }
.home-crown {
  position: absolute;
  width: 38%;
  height: 38%;
  background: radial-gradient(circle, #fef08a, #d97706);
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
  font-size: 0.95rem;
}

/* ===== 3D PAWN TOKENS + ANIMATIONS ===== */
.tokens-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.token {
  position: absolute;
  width: 5.7%;
  height: 5.7%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2.5px solid #ffffff;
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.48), inset 0 3px 5px rgba(255, 255, 255, 0.55), inset 0 -3px 5px rgba(0, 0, 0, 0.35);
  transition: left 0.14s cubic-bezier(0.25, 0.8, 0.25, 1), top 0.14s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 12;
}
.token::after {
  content: '';
  width: 44%;
  height: 44%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.token-red { background: radial-gradient(circle at 32% 30%, #f87171, #dc2626 60%, #7f1d1d); }
.token-green { background: radial-gradient(circle at 32% 30%, #4ade80, #16a34a 60%, #14532d); }
.token-yellow { background: radial-gradient(circle at 32% 30%, #fef08a, #eab308 60%, #854d0e); border-color: #fffbeb; }
.token-blue { background: radial-gradient(circle at 32% 30%, #60a5fa, #2563eb 60%, #1e3a8a); }

.token.exited-token { opacity: 0.22; filter: grayscale(1); pointer-events: none; }

.token.hopping { z-index: 30; animation: tokenHop 0.14s ease-out; }
@keyframes tokenHop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -88%) scale(1.26); box-shadow: 0 14px 16px rgba(0,0,0,0.38); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.token.retreating {
  transition: left 0.045s linear, top 0.045s linear !important;
  z-index: 40;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.95), 0 6px 14px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -58%) scale(1.12) !important;
}

.token.captured-enter-yard {
  transition: left 0.28s ease-in, top 0.28s ease-in !important;
  z-index: 38;
  animation: yardDrop 0.28s ease-in;
}
@keyframes yardDrop {
  0%   { transform: translate(-50%, -70%) scale(1.18); opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.token.movable {
  cursor: pointer;
  z-index: 25;
  animation: pulseMovable 0.65s ease-in-out infinite alternate;
}
@keyframes pulseMovable {
  0%   { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.95), 0 5px 10px rgba(0,0,0,0.5); }
  100% { transform: translate(-50%, -62%) scale(1.28); box-shadow: 0 0 0 6px rgba(253, 224, 71, 0.7), 0 10px 14px rgba(0,0,0,0.55); }
}

/* ===== PERSONAL CORNER 3D DICE (INDEX.HTML) ===== */
.dice-cube {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 65%, #cbd5e1 100%);
  border-radius: 12px;
  border: 2.5px solid #64748b;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.9), inset 0 -3px 5px rgba(100, 116, 139, 0.35);
  cursor: default;
  user-select: none;
  opacity: 0.45;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;
}
.dice-cube.active-dice {
  opacity: 1;
  border-color: #fbbf24;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.65), 0 6px 14px rgba(0, 0, 0, 0.45);
  animation: diceReadyPulse 1s ease-in-out infinite alternate;
}
.dice-cube.active-dice:hover { transform: scale(1.08); }
@keyframes diceReadyPulse {
  from { box-shadow: 0 0 8px rgba(251, 191, 36, 0.5), 0 5px 12px rgba(0,0,0,0.4); }
  to   { box-shadow: 0 0 22px rgba(253, 224, 71, 0.9), 0 5px 12px rgba(0,0,0,0.4); }
}
.dice-cube.current-shown { opacity: 1; border-color: #fbbf24; }
.dice-cube.rolling {
  opacity: 1;
  border-color: #fde047;
  animation: diceTumble 0.17s linear infinite !important;
}
@keyframes diceTumble {
  0%   { transform: rotate(0deg) scale(1.08); }
  25%  { transform: rotate(-16deg) scale(0.95) translateY(-3px); }
  50%  { transform: rotate(16deg) scale(1.1) translateY(2px); }
  75%  { transform: rotate(-10deg) scale(0.98) translateY(-2px); }
  100% { transform: rotate(0deg) scale(1.08); }
}
.dice-cube.landed {
  opacity: 1;
  border-color: #fbbf24;
  animation: diceLand 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes diceLand {
  0%   { transform: scale(1.24); }
  100% { transform: scale(1); }
}
.pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #334155, #020617);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
  visibility: hidden;
}
.pip.show { visibility: visible; }
.pip.red-pip { background: radial-gradient(circle at 35% 35%, #f87171, #b91c1c); width: 10.5px; height: 10.5px; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: blink 1.1s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Mobile Fine-Tuning */
@media (max-width: 520px) {
  .container { padding: 0.35rem; }
  .corner-row { gap: 0.4rem; }
  .player-pod { padding: 0.4rem 0.45rem; min-height: 66px; }
  .dice-cube { width: 46px; height: 46px; padding: 6px; }
  .pip { width: 7.5px; height: 7.5px; }
  .pip.red-pip { width: 9px; height: 9px; }

  .ctrl-outer-frame { padding: 5px; gap: 5px; border-radius: 16px; }
  .ctrl-rim-row { gap: 4px; }
  .ctrl-rim-slot { padding: 4px; gap: 4px; }
  .rim-name { font-size: 0.68rem; }
  .rim-auto-btn { height: 21px; padding: 0 5px; font-size: 0.62rem; }
  .rim-lock-pill { height: 21px; padding: 0 4px; font-size: 0.62rem; }
  .rim-lock-pill input[type="checkbox"] { width: 12px; height: 12px; }
  .rim-nums-row { gap: 2px; }
  .rim-num-btn { height: 27px; font-size: 0.78rem; }
}