/* ============================================================================
 * Vsinger 3D Tour Monopoly · Drop-in UI Theme Kit (v3.2 Mobile Pacing & Center Dice)
 * Targets exact DOM IDs, classes & data-* attributes from dist/index.html + app.js.
 * Safe to load AFTER game.css / mobile.css / vsinger-ui.css / kit-theme.css.
 * ============================================================================ */

:root {
  --vs-primary: #66ccff;
  --vs-primary-dark: #0284c7;
  --vs-primary-soft: rgba(102, 204, 255, 0.22);
  --vs-primary-glow: rgba(102, 204, 255, 0.48);
  --vs-glass-bg: rgba(9, 19, 42, 0.84);
  --vs-glass-border: rgba(102, 204, 255, 0.48);
}

/* 6 Vsinger Role Themes (matched 1:1 to VSingerData.roles[].id) */
[data-role-theme="tianyi"] {
  --vs-primary: #66ccff;
  --vs-primary-dark: #0284c7;
  --vs-primary-soft: rgba(102, 204, 255, 0.22);
  --vs-primary-glow: rgba(102, 204, 255, 0.48);
  --vs-glass-border: rgba(102, 204, 255, 0.50);
}
[data-role-theme="yanhe"] {
  --vs-primary: #8be4c4;
  --vs-primary-dark: #0d9488;
  --vs-primary-soft: rgba(139, 228, 196, 0.20);
  --vs-primary-glow: rgba(139, 228, 196, 0.46);
  --vs-glass-border: rgba(139, 228, 196, 0.50);
}
[data-role-theme="ling"] {
  --vs-primary: #fb6e7e;
  --vs-primary-dark: #be123c;
  --vs-primary-soft: rgba(251, 110, 126, 0.22);
  --vs-primary-glow: rgba(251, 110, 126, 0.48);
  --vs-glass-border: rgba(251, 110, 126, 0.52);
}
[data-role-theme="longya"] {
  --vs-primary: #58c491;
  --vs-primary-dark: #0f766e;
  --vs-primary-soft: rgba(88, 196, 145, 0.22);
  --vs-primary-glow: rgba(88, 196, 145, 0.48);
  --vs-glass-border: rgba(88, 196, 145, 0.50);
}
[data-role-theme="moke"] {
  --vs-primary: #a6adff;
  --vs-primary-dark: #4338ca;
  --vs-primary-soft: rgba(166, 173, 255, 0.22);
  --vs-primary-glow: rgba(166, 173, 255, 0.48);
  --vs-glass-border: rgba(166, 173, 255, 0.50);
}
[data-role-theme="qingxian"] {
  --vs-primary: #ecc675;
  --vs-primary-dark: #b45309;
  --vs-primary-soft: rgba(236, 198, 117, 0.22);
  --vs-primary-glow: rgba(236, 198, 117, 0.46);
  --vs-glass-border: rgba(236, 198, 117, 0.52);
}

/* Enhanced Glass & 3D Tactile Arcade Controls */
#game-shell .vs-glass-panel {
  background: var(--vs-glass-bg);
  border: 1.5px solid var(--vs-glass-border);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#game-shell .button.vs-btn-roll {
  background: linear-gradient(180deg, #e0f2fe 0%, var(--vs-primary) 46%, var(--vs-primary-dark) 100%) !important;
  border: 2.5px solid #fef08a !important;
  color: #ffffff !important;
  font-weight: 900;
  text-shadow: 0 2px 1px rgba(10, 22, 48, 0.65);
  box-shadow: 0 5px 0 rgba(3, 52, 86, 0.92), 0 10px 22px rgba(2, 10, 28, 0.52), 0 0 18px var(--vs-primary-glow), inset 0 2px 0 rgba(255, 255, 255, 0.68);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
}
#game-shell .button.vs-btn-roll:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(3, 52, 86, 0.92), 0 4px 10px rgba(2, 10, 28, 0.42);
}

/* Single-Row vs Double-Row Roster Extension for #roster */
#game-shell #roster[data-roster-rows="single"] {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
}
#game-shell #roster[data-roster-rows="double"] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
#game-shell #roster[data-roster-rows="double"][data-player-count="5"],
#game-shell #roster[data-roster-rows="double"][data-player-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ==================== DUAL-MODE 3D DICE STAGE (CENTER FOR SELF / BOTTOM FOR OTHERS) ==================== */
.vs-dice-stage {
  position: absolute;
  inset: 0;
  z-index: 34;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(7, 17, 38, 0.72) 0%, rgba(4, 9, 22, 0.35) 60%, transparent 100%);
  backdrop-filter: blur(2px);
  transition: opacity 0.28s ease;
}
.vs-dice-stage.hidden {
  display: none;
}

/* Non-intrusive bottom tray for OTHER players so the player can freely interact with the board/UI */
.vs-dice-stage.mode-bottom {
  inset: auto 10px 8px 10px;
  background: none;
  backdrop-filter: none;
  flex-direction: row;
  justify-content: center;
}

.vs-dice-bottom-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 18px;
  background: rgba(8, 17, 38, 0.92);
  border: 1.5px solid var(--role, var(--vs-primary));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 18px var(--vs-primary-soft);
  backdrop-filter: blur(10px);
}
.vs-dice-stage.mode-bottom .vs-dice-actor-pill {
  padding: 2px 9px;
  font-size: 11px;
  border: none;
  background: transparent;
  box-shadow: none;
}
.vs-dice-stage.mode-bottom .vs-dice-result-badge {
  padding: 3px 10px;
  font-size: 12px;
  box-shadow: 0 3px 0 #78350f;
}

.vs-big-die.compact {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border-width: 2px;
  padding: 6px;
  gap: 2px;
  box-shadow: 0 5px 0 #94a3b8, 0 8px 16px rgba(0, 0, 0, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.95);
}
.vs-big-die.compact .vs-die-pip {
  width: 8px;
  height: 8px;
}
.vs-big-die.compact .vs-die-pip.on.red {
  width: 10px;
  height: 10px;
}

.vs-dice-actor-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(8, 17, 38, 0.92);
  border: 1.5px solid var(--role, var(--vs-primary));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 18px var(--vs-primary-soft);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 16px;
}

.vs-dice-arena {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 28px;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.14), rgba(9, 19, 44, 0.86));
  border: 2px solid var(--vs-glass-border);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72), 0 0 36px var(--vs-primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.vs-big-die {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 62%, #cbd5e1 100%);
  border: 3px solid #ffffff;
  box-shadow:
    0 10px 0 #94a3b8,
    0 18px 30px rgba(0, 0, 0, 0.65),
    inset 0 3px 6px rgba(255, 255, 255, 0.95),
    inset 0 -4px 8px rgba(100, 116, 139, 0.35);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 11px;
  gap: 4px;
  place-items: center;
  will-change: transform;
}

.vs-big-die.tumble-left {
  animation: vsDieTumbleL 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}
.vs-big-die.tumble-right {
  animation: vsDieTumbleR 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}
.vs-big-die.landed {
  animation: vsDieSlam 0.38s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.vs-die-pip {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.08s ease, transform 0.08s ease;
}
.vs-die-pip.on {
  opacity: 1;
  transform: scale(1);
  background: radial-gradient(circle at 35% 30%, #1e3a8a, #0f172a);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.8);
}
.vs-die-pip.on.red {
  width: 17px;
  height: 17px;
  background: radial-gradient(circle at 35% 30%, #fb7185, #e11d48 70%, #9f1239);
}

.vs-dice-result-badge {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fef08a 0%, #f59e0b 55%, #b45309 100%);
  border: 2px solid #fef9c3;
  color: #451a03;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 5px 0 #78350f, 0 12px 28px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(12px) scale(0.85);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.vs-dice-result-badge.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes vsDieTumbleL {
  0%   { transform: translateY(0) rotate(0deg) scale(1); }
  25%  { transform: translateY(-22px) rotate(-26deg) scale(1.12); }
  50%  { transform: translateY(4px) rotate(18deg) scale(0.96); }
  75%  { transform: translateY(-14px) rotate(-14deg) scale(1.08); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}
@keyframes vsDieTumbleR {
  0%   { transform: translateY(0) rotate(0deg) scale(1); }
  25%  { transform: translateY(-18px) rotate(28deg) scale(1.1); }
  50%  { transform: translateY(5px) rotate(-20deg) scale(0.95); }
  75%  { transform: translateY(-20px) rotate(16deg) scale(1.12); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}
@keyframes vsDieSlam {
  0%   { transform: scale(1.24) translateY(-16px) rotate(-8deg); }
  55%  { transform: scale(0.94) translateY(3px) rotate(2deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}

/* ==================== READABLE CARD BURST & PERSISTENT EFFECT BAR ==================== */
#game-shell .public-card,
.vs-card-burst {
  border: 2px solid var(--vs-glass-border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.82), 0 0 36px var(--vs-primary-soft);
  backdrop-filter: blur(14px);
}
#game-shell .public-card[data-deck="strategy"],
.vs-card-burst[data-deck="strategy"] {
  border-color: rgba(167, 139, 250, 0.78);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.82), 0 0 36px rgba(139, 92, 246, 0.42);
}

/* Slow, mobile-readable card reveal progress bar */
@keyframes vsReadProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
.vs-card-timer-bar {
  transform-origin: left center;
  animation: vsReadProgress var(--card-hold-ms, 4200ms) linear forwards;
}

/* Clipped Danmaku Stage Overlay (Slower 7.8s mobile-readable scroll) */
.vs-danmaku-stage {
  position: absolute;
  inset: 46px 0 auto 0;
  height: 98px;
  pointer-events: none;
  overflow: hidden;
  z-index: 16;
  contain: paint;
}
.vs-danmaku-pill {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  white-space: nowrap;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: rgba(6, 13, 30, 0.90);
  border: 1.5px solid var(--role, var(--vs-primary));
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  animation: vsDanmakuFly 7.8s linear forwards;
}
.vs-danmaku-pill .vs-avatar-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.vs-danmaku-pill.vs-danmaku-system {
  font-size: 12.5px;
  font-weight: 900;
  padding: 6px 14px;
  z-index: 20;
  border-width: 2px;
  border-color: #facc15;
  background: linear-gradient(90deg, rgba(120, 53, 15, 0.96), rgba(30, 41, 59, 0.95));
  color: #fef9c3;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65), 0 0 18px rgba(250, 204, 21, 0.55);
}
.vs-danmaku-pill.vs-danmaku-system[data-style="info"] {
  border-color: #38bdf8;
  background: linear-gradient(90deg, rgba(12, 74, 110, 0.96), rgba(15, 23, 42, 0.95));
  color: #e0f2fe;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65), 0 0 18px rgba(56, 189, 248, 0.5);
}
.vs-danmaku-pill.vs-danmaku-system[data-style="urgent"] {
  border-color: #fb7185;
  background: linear-gradient(90deg, rgba(159, 18, 57, 0.96), rgba(69, 10, 10, 0.96));
  color: #fff1f2;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.72), 0 0 22px rgba(244, 63, 94, 0.7);
}
.vs-global-notice {
  position: absolute;
  top: var(--cutout-top, 0px);
  left: 0;
  right: 0;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  border-bottom: 1.5px solid rgba(250, 204, 21, 0.65);
  background: linear-gradient(90deg, rgba(120, 53, 15, 0.95), rgba(30, 41, 59, 0.95));
  color: #fef3c7;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.vs-global-notice[data-style="info"] {
  border-bottom-color: rgba(56, 189, 248, 0.65);
  background: linear-gradient(90deg, rgba(12, 74, 110, 0.95), rgba(15, 23, 42, 0.95));
  color: #e0f2fe;
}
.vs-global-notice[data-style="urgent"] {
  border-bottom-color: rgba(251, 113, 133, 0.85);
  background: linear-gradient(90deg, rgba(159, 18, 57, 0.96), rgba(69, 10, 10, 0.96));
  color: #ffe4e6;
}
.vs-global-notice[hidden] {
  display: none !important;
}
@keyframes vsDanmakuFly {
  0% { transform: translateX(410px); opacity: 0.98; }
  100% { transform: translateX(-130%); opacity: 0.98; }
}
