/* Pakistani Ludo – premium green & white theme (HDK Labs) */
:root {
  --green-deep: #0a3d2e;
  --green-mid: #0f5c42;
  --green-bright: #1a8f64;
  --green-glow: #2dd4a0;
  --cream: #f7f3e8;
  --white: #ffffff;
  --gold: #d4a017;
  --gold-light: #f5d76e;
  --ink: #0b1f18;
  --muted: #a8c4b8;
  --card: rgba(255,255,255,0.08);
  --line: rgba(255,255,255,0.14);
  --red: #e63946;
  --blue: #1d6fd8;
  --yellow: #f4c430;
  --green-token: #22a06b;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--green-deep);
  color: var(--cream);
  font-family: var(--font);
  overscroll-behavior: none;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(45,212,160,0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(212,160,23,0.12), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(26,143,100,0.25), transparent 45%),
    linear-gradient(165deg, #062820 0%, #0a3d2e 40%, #0c4a36 70%, #083528 100%);
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.hidden { display: none !important; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* Islamic geometric subtle pattern overlay */
.geo-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0.07;
  background-image:
    repeating-linear-gradient(60deg, transparent, transparent 18px, rgba(255,255,255,0.4) 18px, rgba(255,255,255,0.4) 19px),
    repeating-linear-gradient(-60deg, transparent, transparent 18px, rgba(255,255,255,0.35) 18px, rgba(255,255,255,0.35) 19px),
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(212,160,23,0.3) 18px, rgba(212,160,23,0.3) 19px);
}

.screen {
  position: relative; z-index: 1;
  min-height: 100dvh;
  padding: calc(16px + var(--safe-t)) 18px calc(20px + var(--safe-b));
  display: flex; flex-direction: column;
}

/* ========== HOME ========== */
.home-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.coin-pill {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(212,160,23,0.25), rgba(245,215,110,0.12));
  border: 1px solid rgba(245,215,110,0.45);
  border-radius: 999px; padding: 8px 14px 8px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}
.coin-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a0, #d4a017 55%, #9a6b00);
  box-shadow: 0 2px 8px rgba(212,160,23,0.5), inset 0 -2px 4px rgba(0,0,0,0.25);
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 800; color: #5a3a00;
}
.coin-amt { font-weight: 800; font-size: 1.05rem; color: var(--gold-light); letter-spacing: 0.02em; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 1.2rem;
  backdrop-filter: blur(8px);
}

.brand-hero {
  text-align: center;
  padding: 18px 8px 10px;
  position: relative;
}
.crescent-badge {
  width: 88px; height: 88px; margin: 0 auto 14px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.35), transparent 45%),
    linear-gradient(145deg, #1a8f64 0%, #0f5c42 50%, #0a3d2e 100%);
  border: 2px solid rgba(245,215,110,0.55);
  box-shadow:
    0 12px 36px rgba(0,0,0,0.4),
    0 0 0 4px rgba(26,143,100,0.2),
    inset 0 2px 8px rgba(255,255,255,0.2);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.crescent-badge::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg, transparent 0deg 8deg, rgba(255,255,255,0.04) 8deg 10deg);
  opacity: 0.6;
}
.crescent-glyph {
  font-size: 2.6rem; line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
  position: relative; z-index: 1;
}
.brand-hero h1 {
  margin: 0; font-size: 1.85rem; font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff 0%, #e8f5ef 40%, #c8e6d6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 20px rgba(45,212,160,0.3);
}
.brand-hero .tagline {
  margin: 6px 0 0;
  color: var(--muted); font-size: 0.88rem; font-weight: 500;
}
.brand-hero .urdu {
  margin: 4px 0 0;
  color: var(--gold-light); font-size: 1.05rem; opacity: 0.9;
  font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', serif;
}

.daily-banner {
  margin: 14px 0 18px;
  background:
    linear-gradient(135deg, rgba(212,160,23,0.28), rgba(26,143,100,0.35));
  border: 1px solid rgba(245,215,110,0.4);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.daily-banner .gift {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(145deg, #f5d76e, #d4a017);
  display: grid; place-items: center; font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(212,160,23,0.4);
  flex-shrink: 0;
}
.daily-banner .txt { flex: 1; min-width: 0; }
.daily-banner .txt strong { display: block; font-size: 0.95rem; }
.daily-banner .txt span { font-size: 0.78rem; color: var(--muted); }
.daily-banner .claim {
  background: linear-gradient(135deg, #f5d76e, #d4a017);
  color: #3d2800; font-weight: 800; font-size: 0.78rem;
  padding: 10px 14px; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(212,160,23,0.35);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.mode-grid {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}
.mode-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  box-shadow: 0 8px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
}
.mode-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent-bar, var(--green-glow));
  border-radius: 4px 0 0 4px;
}
.mode-card.online { --accent-bar: linear-gradient(180deg, #f5d76e, #d4a017); }
.mode-card.online { border-color: rgba(245,215,110,0.35); }
.mode-card.bots { --accent-bar: var(--green-glow); }
.mode-card.pass { --accent-bar: #5b9fff; }
.mode-ico {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.7rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  flex-shrink: 0;
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.08);
}
.mode-card h3 { margin: 0; font-size: 1.12rem; font-weight: 800; }
.mode-card p { margin: 3px 0 0; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.mode-card .chev { margin-left: auto; opacity: 0.45; font-size: 1.2rem; }

.home-foot {
  margin-top: 16px;
  display: flex; gap: 10px;
}
.foot-btn {
  flex: 1;
  padding: 14px 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 700; font-size: 0.85rem;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.foot-btn span { font-size: 1.25rem; }
.credit {
  text-align: center; margin-top: 14px;
  font-size: 0.72rem; color: rgba(168,196,184,0.65);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ========== LOBBY ========== */
.lobby-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.back-btn {
  width: 42px; height: 42px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 1.15rem;
}
.lobby-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; flex: 1; }
.lobby-head .badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--gold-light);
  background: rgba(212,160,23,0.2); border: 1px solid rgba(245,215,110,0.35);
  padding: 6px 10px; border-radius: 999px;
}

.room-code-card {
  text-align: center;
  padding: 22px 18px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245,215,110,0.18), transparent 60%),
    linear-gradient(160deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid rgba(245,215,110,0.35);
  box-shadow: 0 10px 32px rgba(0,0,0,0.28);
  margin-bottom: 18px;
}
.room-code-card .label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 8px;
}
.room-code {
  font-size: 2.4rem; font-weight: 900; letter-spacing: 0.28em;
  color: var(--gold-light);
  text-shadow: 0 0 24px rgba(245,215,110,0.45);
  font-variant-numeric: tabular-nums;
  padding-left: 0.28em;
}
.room-code-card .hint {
  margin-top: 10px; font-size: 0.8rem; color: var(--muted);
}
.share-row {
  display: flex; gap: 8px; margin-top: 14px; justify-content: center;
}
.share-row button {
  padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 0.82rem;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line);
}
.share-row button.primary {
  background: linear-gradient(135deg, #1a8f64, #0f5c42);
  border-color: rgba(45,212,160,0.4);
  box-shadow: 0 4px 14px rgba(26,143,100,0.35);
}

.players-title {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 0 0 10px;
}
.player-slots {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.player-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}
.player-slot.filled {
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border-color: rgba(45,212,160,0.3);
}
.player-slot.host {
  border-color: rgba(245,215,110,0.45);
  box-shadow: 0 0 0 1px rgba(245,215,110,0.15);
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 2px 6px rgba(255,255,255,0.25);
  border: 2px solid rgba(255,255,255,0.35);
  flex-shrink: 0;
  position: relative;
}
.avatar.red { background: radial-gradient(circle at 35% 30%, #ff6b75, #e63946 60%, #a01824); }
.avatar.green { background: radial-gradient(circle at 35% 30%, #4ade80, #22a06b 60%, #0f5c42); }
.avatar.yellow { background: radial-gradient(circle at 35% 30%, #ffe066, #f4c430 60%, #b8860b); color: #3d2800; }
.avatar.blue { background: radial-gradient(circle at 35% 30%, #60a5fa, #1d6fd8 60%, #0e3d8a); }
.avatar.empty {
  background: rgba(255,255,255,0.06);
  border: 2px dashed rgba(255,255,255,0.2);
  color: var(--muted); font-size: 1.3rem; font-weight: 400;
  box-shadow: none;
}
.slot-info { flex: 1; min-width: 0; }
.slot-info .name { font-weight: 800; font-size: 1rem; }
.slot-info .meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.host-tag {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: #3d2800;
  background: linear-gradient(135deg, #f5d76e, #d4a017);
  padding: 4px 8px; border-radius: 8px;
}
.you-tag {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--green-deep);
  background: var(--green-glow); padding: 4px 8px; border-radius: 8px;
}
.waiting-tag { color: var(--muted); font-size: 0.75rem; font-style: italic; }

.lobby-opts {
  margin: 16px 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.88rem;
}
.toggle {
  width: 48px; height: 28px; border-radius: 999px;
  background: rgba(255,255,255,0.12); position: relative;
  border: 1px solid var(--line);
}
.toggle.on { background: linear-gradient(135deg, #1a8f64, #2dd4a0); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(20px); }

.start-btn {
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  font-size: 1.1rem; font-weight: 900;
  letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(135deg, #f5d76e 0%, #d4a017 50%, #b8860b 100%);
  color: #2a1a00;
  box-shadow: 0 8px 28px rgba(212,160,23,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.25);
}
.start-btn:disabled {
  opacity: 0.45; filter: grayscale(0.3);
}

.emoji-bar {
  display: flex; gap: 8px; justify-content: center; margin-top: 14px;
}
.emoji-bar button {
  width: 44px; height: 44px; border-radius: 14px; font-size: 1.35rem;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line);
}

/* ========== GAME BOARD ========== */
.game-screen {
  padding: calc(10px + var(--safe-t)) 10px calc(12px + var(--safe-b));
}
.game-top {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; padding: 0 4px;
}
.game-top .back-btn { width: 38px; height: 38px; border-radius: 12px; font-size: 1rem; }
.turn-banner {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  font-weight: 700; font-size: 0.85rem;
}
.turn-banner .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 8px currentColor;
}
.players-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
}
.players-strip:has(.p-chip:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.players-strip:has(.p-chip:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-chip {
  padding: 6px 4px; border-radius: 12px; text-align: center;
  background: rgba(0,0,0,0.25); border: 1px solid transparent;
  font-size: 0.68rem;
  min-width: 0;
  overflow: hidden;
}
.p-chip.active {
  border-color: rgba(245,215,110,0.6);
  background: rgba(245,215,110,0.12);
  box-shadow: 0 0 16px rgba(245,215,110,0.2);
}
.p-chip .av {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 4px;
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 2px 6px rgba(0,0,0,0.3);
}
.p-chip .av.red { background: radial-gradient(circle at 35% 30%, #ff6b75, #e63946); }
.p-chip .av.green { background: radial-gradient(circle at 35% 30%, #4ade80, #22a06b); }
.p-chip .av.yellow { background: radial-gradient(circle at 35% 30%, #ffe066, #f4c430); }
.p-chip .av.blue { background: radial-gradient(circle at 35% 30%, #60a5fa, #1d6fd8); }
.p-chip .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-chip .home-count { color: var(--muted); font-size: 0.62rem; margin-top: 1px; }

.board-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
  padding: 4px;
}
.board {
  width: min(100%, 92vw, 420px);
  aspect-ratio: 1;
  position: relative;
  border-radius: 16px;
  background:
    linear-gradient(145deg, #1a5c45 0%, #0f3d2e 100%);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.45),
    0 0 0 3px rgba(245,215,110,0.35),
    0 0 0 6px rgba(10,61,46,0.8),
    inset 0 2px 0 rgba(255,255,255,0.1);
  overflow: hidden;
}
.board-inner {
  position: absolute; inset: 3.2%;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  gap: 1.5px;
  background: #0a2e24;
  border-radius: 8px;
  padding: 1.5px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}

.cell {
  border-radius: 2px;
  background: #f0ebe0;
  position: relative;
  min-width: 0; min-height: 0;
}
.cell.path { background: linear-gradient(145deg, #f7f3e8, #e8e0d0); }
.cell.safe {
  background: linear-gradient(145deg, #fff8e7, #f0e0b8);
}
.cell.safe::after {
  content: '★';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(6px, 1.8vw, 11px);
  color: #c9a227; opacity: 0.85;
  pointer-events: none;
}
.cell.red-path { background: linear-gradient(145deg, #ff8a93, #e63946); }
.cell.green-path { background: linear-gradient(145deg, #5ee09a, #22a06b); }
.cell.yellow-path { background: linear-gradient(145deg, #ffe66d, #f4c430); }
.cell.blue-path { background: linear-gradient(145deg, #7ab8ff, #1d6fd8); }
.cell.dark { background: transparent; }

/* Yards (home bases) - 6x6 corner areas */
.yard {
  position: absolute;
  width: 40%; height: 40%;
  border-radius: 10px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.25);
  z-index: 2;
}
.yard-inner {
  width: 70%; height: 70%;
  border-radius: 12px;
  background: rgba(255,255,255,0.94);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.2),
    inset 0 2px 8px rgba(255,255,255,0.8);
  position: relative;
  display: block;
  padding: 0;
  grid-template-columns: none;
  grid-template-rows: none;
  gap: 0;
}
.yard-slot {
  position: absolute;
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: rgba(0,0,0,0.10);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.14);
  display: grid;
  place-items: center;
  overflow: visible;
  box-sizing: border-box;
}
.yard-slot:nth-child(1) { left: 10%; top: 10%; }
.yard-slot:nth-child(2) { right: 10%; top: 10%; left: auto; }
.yard-slot:nth-child(3) { left: 10%; bottom: 10%; top: auto; }
.yard-slot:nth-child(4) { right: 10%; bottom: 10%; left: auto; top: auto; }
.yard-slot .yard-token {
  width: 78%;
  height: 78%;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
  z-index: 3;
  pointer-events: auto;
  position: relative;
  margin: 0;
  transform: none;
}
.yard-slot .yard-token .token-3d {
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  position: relative !important;
  transform: none !important;
}
.yard-slot .yard-token.selectable {
  filter: drop-shadow(0 0 8px #ffe566) drop-shadow(0 0 14px #f5d76e);
  cursor: pointer;
  animation: pulse-glow 1.1s ease-in-out infinite;
  outline: 2px solid rgba(245,215,110,0.85);
  outline-offset: 2px;
  border-radius: 50%;
}
.yard.red {
  top: 3.2%; left: 3.2%;
  background: linear-gradient(145deg, #ff5c6a, #c81e2c);
  border: 2px solid rgba(255,255,255,0.25);
}
.yard.green {
  top: 3.2%; right: 3.2%;
  background: linear-gradient(145deg, #3dca7e, #168a55);
  border: 2px solid rgba(255,255,255,0.25);
}
.yard.yellow {
  bottom: 3.2%; right: 3.2%;
  background: linear-gradient(145deg, #ffd84a, #d4a80f);
  border: 2px solid rgba(255,255,255,0.25);
}
.yard.blue {
  bottom: 3.2%; left: 3.2%;
  background: linear-gradient(145deg, #4a9aff, #1557b8);
  border: 2px solid rgba(255,255,255,0.25);
}

/* Center home diamond */
.center-home {
  position: absolute;
  left: 40%; top: 40%;
  width: 20%; height: 20%;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  clip-path: none;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.center-home .tri {
  position: relative;
}
.center-home .tri.red {
  background: linear-gradient(135deg, #ff6b75, #e63946);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  grid-column: 1 / 3; grid-row: 1;
}
.center-home .tri.green {
  background: linear-gradient(225deg, #4ade80, #22a06b);
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
  grid-column: 2; grid-row: 1 / 3;
}
.center-home .tri.yellow {
  background: linear-gradient(45deg, #ffe066, #f4c430);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  grid-column: 1; grid-row: 1 / 3;
}
.center-home .tri.blue {
  background: linear-gradient(315deg, #60a5fa, #1d6fd8);
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
  grid-column: 1 / 3; grid-row: 2;
}
/* Simpler center: 4 triangles meeting */
.center-x {
  position: absolute;
  left: 40%; top: 40%;
  width: 20%; height: 20%;
  z-index: 3;
  background:
    conic-gradient(
      from -45deg at 50% 50%,
      #22a06b 0deg 90deg,
      #f4c430 90deg 180deg,
      #1d6fd8 180deg 270deg,
      #e63946 270deg 360deg
    );
  /* top=green, right=yellow, bottom=blue, left=red */
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 0 8px rgba(0,0,0,0.2);
  border-radius: 3px;
}
.center-x::after {
  content: '☪';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(14px, 4vw, 22px);
  color: rgba(255,255,255,0.95);
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  background: radial-gradient(circle, rgba(10,61,46,0.55) 0%, transparent 70%);
}

/* Tokens */
.token {
  width: 100%; height: 100%;
  border-radius: 50%;
  position: relative;
  box-shadow:
    0 3px 6px rgba(0,0,0,0.4),
    inset 0 -3px 5px rgba(0,0,0,0.25),
    inset 0 3px 5px rgba(255,255,255,0.45);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.token::before {
  content: '';
  position: absolute;
  top: 12%; left: 18%;
  width: 40%; height: 28%;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  filter: blur(0.5px);
}
.token.red { background: radial-gradient(circle at 35% 28%, #ff8a93, #e63946 55%, #8b1520); }
.token.green { background: radial-gradient(circle at 35% 28%, #6eeba4, #22a06b 55%, #0a5c38); }
.token.yellow { background: radial-gradient(circle at 35% 28%, #ffe88a, #f4c430 55%, #a07a08); }
.token.blue { background: radial-gradient(circle at 35% 28%, #8ec5ff, #1d6fd8 55%, #0c3d8a); }
.token.glow {
  box-shadow:
    0 0 0 2px rgba(245,215,110,0.8),
    0 0 12px rgba(245,215,110,0.6),
    0 3px 6px rgba(0,0,0,0.4),
    inset 0 -3px 5px rgba(0,0,0,0.25),
    inset 0 3px 5px rgba(255,255,255,0.45);
  animation: pulse-glow 1.2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.token-on-board {
  position: absolute;
  width: 5.2%; height: 5.2%;
  z-index: 5;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.35));
}
.token-on-board .token { width: 100%; height: 100%; }

/* Dice panel */
.game-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px; padding: 0 4px;
}
.dice-panel {
  display: flex; align-items: center; gap: 14px;
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.dice {
  width: 64px; height: 64px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffef8, #e8e0d0);
  box-shadow:
    0 8px 20px rgba(0,0,0,0.35),
    inset 0 2px 4px rgba(255,255,255,0.9),
    inset 0 -3px 6px rgba(0,0,0,0.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 10px;
  gap: 2px;
  flex-shrink: 0;
  border: 2px solid rgba(212,160,23,0.4);
}
.pip {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #333, #111);
  margin: auto;
  opacity: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.dice[data-face="1"] .pip:nth-child(5) { opacity: 1; }
.dice[data-face="2"] .pip:nth-child(1),
.dice[data-face="2"] .pip:nth-child(9) { opacity: 1; }
.dice[data-face="3"] .pip:nth-child(1),
.dice[data-face="3"] .pip:nth-child(5),
.dice[data-face="3"] .pip:nth-child(9) { opacity: 1; }
.dice[data-face="4"] .pip:nth-child(1),
.dice[data-face="4"] .pip:nth-child(3),
.dice[data-face="4"] .pip:nth-child(7),
.dice[data-face="4"] .pip:nth-child(9) { opacity: 1; }
.dice[data-face="5"] .pip:nth-child(1),
.dice[data-face="5"] .pip:nth-child(3),
.dice[data-face="5"] .pip:nth-child(5),
.dice[data-face="5"] .pip:nth-child(7),
.dice[data-face="5"] .pip:nth-child(9) { opacity: 1; }
.dice[data-face="6"] .pip:nth-child(1),
.dice[data-face="6"] .pip:nth-child(3),
.dice[data-face="6"] .pip:nth-child(4),
.dice[data-face="6"] .pip:nth-child(6),
.dice[data-face="6"] .pip:nth-child(7),
.dice[data-face="6"] .pip:nth-child(9) { opacity: 1; }

.dice-info { flex: 1; }
.dice-info .who { font-weight: 800; font-size: 0.95rem; }
.dice-info .hint { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.roll-btn {
  padding: 12px 18px; border-radius: 14px;
  font-weight: 900; font-size: 0.85rem; text-transform: uppercase;
  background: linear-gradient(135deg, #f5d76e, #d4a017);
  color: #2a1a00;
  box-shadow: 0 4px 14px rgba(212,160,23,0.4);
  letter-spacing: 0.04em;
}
.react-fab {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 1.4rem;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* Floating reaction */
.float-emoji {
  position: absolute;
  font-size: 1.8rem;
  z-index: 20;
  animation: float-up 2s ease-out forwards;
  pointer-events: none;
}
@keyframes float-up {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

/* Shot-specific: force phone frame sizing */
body.shot {
  width: 1080px;
  height: 1920px;
  overflow: hidden;
}
body.shot #app {
  max-width: none;
  width: 1080px;
  height: 1920px;
  min-height: 1920px;
}
body.shot .screen {
  min-height: 1920px;
  height: 1920px;
  padding: 48px 52px 56px;
}
body.shot .brand-hero h1 { font-size: 3.4rem; }
body.shot .brand-hero .tagline { font-size: 1.35rem; }
body.shot .brand-hero .urdu { font-size: 1.6rem; }
body.shot .crescent-badge { width: 160px; height: 160px; border-radius: 44px; margin-bottom: 28px; }
body.shot .crescent-glyph { font-size: 4.5rem; }
body.shot .mode-card { padding: 28px 28px; border-radius: 32px; gap: 22px; }
body.shot .mode-ico { width: 96px; height: 96px; border-radius: 28px; font-size: 2.8rem; }
body.shot .mode-card h3 { font-size: 1.85rem; }
body.shot .mode-card p { font-size: 1.2rem; }
body.shot .coin-pill { padding: 14px 24px 14px 14px; gap: 12px; }
body.shot .coin-icon { width: 52px; height: 52px; font-size: 1.3rem; }
body.shot .coin-amt { font-size: 1.7rem; }
body.shot .icon-btn { width: 72px; height: 72px; border-radius: 22px; font-size: 1.8rem; }
body.shot .daily-banner { padding: 22px 24px; border-radius: 28px; gap: 18px; margin: 28px 0 36px; }
body.shot .daily-banner .gift { width: 80px; height: 80px; border-radius: 22px; font-size: 2.4rem; }
body.shot .daily-banner .txt strong { font-size: 1.5rem; }
body.shot .daily-banner .txt span { font-size: 1.15rem; }
body.shot .daily-banner .claim { padding: 16px 22px; font-size: 1.15rem; border-radius: 16px; }
body.shot .foot-btn { padding: 22px 14px; border-radius: 22px; font-size: 1.25rem; }
body.shot .foot-btn span { font-size: 1.9rem; }
body.shot .credit { font-size: 1.1rem; margin-top: 28px; }
body.shot .mode-grid { gap: 20px; }

body.shot .lobby-head h2 { font-size: 2.1rem; }
body.shot .back-btn { width: 68px; height: 68px; border-radius: 20px; font-size: 1.7rem; }
body.shot .lobby-head .badge { font-size: 1.05rem; padding: 10px 16px; }
body.shot .room-code { font-size: 4rem; }
body.shot .room-code-card { padding: 40px 28px; border-radius: 36px; }
body.shot .room-code-card .label { font-size: 1.1rem; }
body.shot .room-code-card .hint { font-size: 1.2rem; }
body.shot .share-row button { padding: 16px 26px; font-size: 1.2rem; border-radius: 16px; }
body.shot .players-title { font-size: 1.15rem; margin-bottom: 16px; }
body.shot .player-slot { padding: 20px 22px; border-radius: 26px; gap: 18px; }
body.shot .avatar { width: 80px; height: 80px; font-size: 1.8rem; }
body.shot .slot-info .name { font-size: 1.6rem; }
body.shot .slot-info .meta { font-size: 1.15rem; }
body.shot .host-tag, body.shot .you-tag { font-size: 0.95rem; padding: 6px 12px; }
body.shot .lobby-opts { padding: 22px; font-size: 1.35rem; border-radius: 22px; }
body.shot .toggle { width: 72px; height: 40px; }
body.shot .toggle::after { width: 30px; height: 30px; top: 4px; left: 4px; }
body.shot .toggle.on::after { transform: translateX(30px); }
body.shot .start-btn { padding: 28px; font-size: 1.7rem; border-radius: 26px; }
body.shot .emoji-bar button { width: 70px; height: 70px; border-radius: 20px; font-size: 2rem; }
body.shot .player-slots { gap: 16px; }

body.shot .game-screen { padding: 36px 28px 40px; }
body.shot .game-top .back-btn { width: 60px; height: 60px; }
body.shot .turn-banner { font-size: 1.35rem; padding: 14px 18px; border-radius: 18px; }
body.shot .turn-banner .dot { width: 16px; height: 16px; }
body.shot .players-strip { gap: 10px; margin-bottom: 16px; }
body.shot .p-chip { padding: 14px 8px; border-radius: 18px; font-size: 1.05rem; }
body.shot .p-chip .av { width: 44px; height: 44px; }
body.shot .p-chip .home-count { font-size: 0.95rem; }
body.shot .board {
  width: 980px;
  max-width: none;
  border-radius: 24px;
}
body.shot .dice { width: 110px; height: 110px; border-radius: 22px; padding: 16px; }
body.shot .pip { width: 16px; height: 16px; }
body.shot .dice-info .who { font-size: 1.5rem; }
body.shot .dice-info .hint { font-size: 1.15rem; }
body.shot .roll-btn { padding: 20px 28px; font-size: 1.3rem; border-radius: 18px; }
body.shot .react-fab { width: 78px; height: 78px; border-radius: 22px; font-size: 2.2rem; }
body.shot .dice-panel { padding: 18px 22px; border-radius: 28px; gap: 20px; }
body.shot .float-emoji { font-size: 3rem; }

/* ========== 3D BOARD / TOKENS / DICE ========== */
.board-stage {
  perspective: 1600px;
  perspective-origin: 50% 42%;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 6px 2px 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}
.board-3d {
  transform: rotateX(12deg) rotateZ(-1deg);
  transform-style: preserve-3d;
  width: min(100%, calc(100vw - 28px), 380px);
  max-width: 100%;
  aspect-ratio: 1;
  position: relative;
  border-radius: 18px;
  background:
    linear-gradient(160deg, #1f6b52 0%, #0d4334 55%, #083528 100%);
  box-shadow:
    0 24px 40px -8px rgba(0,0,0,0.55),
    0 12px 20px rgba(0,0,0,0.35),
    0 0 0 3px rgba(245,215,110,0.4),
    0 0 0 6px rgba(8,40,32,0.9),
    inset 0 2px 0 rgba(255,255,255,0.15);
  overflow: visible;
}
.board-3d::before {
  content: '';
  position: absolute;
  left: 6%; right: 6%; bottom: -14%;
  height: 18%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), transparent 70%);
  filter: blur(8px);
  z-index: -1;
  transform: translateZ(-20px);
}
.board-3d .board-inner {
  inset: 3%;
  border-radius: 10px;
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.45),
    inset 0 2px 4px rgba(255,255,255,0.08);
}
.board-3d .yard {
  box-shadow:
    inset 0 0 28px rgba(0,0,0,0.35),
    0 6px 14px rgba(0,0,0,0.25);
  transform: translateZ(8px);
}
.board-3d .yard-inner {
  box-shadow:
    0 6px 14px rgba(0,0,0,0.28),
    inset 0 3px 8px rgba(255,255,255,0.85),
    inset 0 -4px 8px rgba(0,0,0,0.08);
}
.board-3d .center-x {
  transform: translateZ(12px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.45), inset 0 0 10px rgba(0,0,0,0.25);
  border-radius: 6px;
}

/* 3D pawn-style tokens */
.token-3d {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  background: transparent !important;
  filter: drop-shadow(0 6px 4px rgba(0,0,0,0.45));
}
.token-3d .base {
  position: absolute;
  left: 8%; right: 8%; bottom: 0;
  height: 28%;
  border-radius: 50%;
  background: inherit;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.35),
    inset 0 -3px 4px rgba(0,0,0,0.35),
    0 2px 3px rgba(0,0,0,0.3);
}
.token-3d .stem {
  position: absolute;
  left: 28%; right: 28%;
  bottom: 22%;
  height: 38%;
  border-radius: 40% 40% 30% 30%;
  background: inherit;
  box-shadow:
    inset 3px 0 4px rgba(255,255,255,0.25),
    inset -3px 0 5px rgba(0,0,0,0.3);
}
.token-3d .head {
  position: absolute;
  left: 18%; right: 18%;
  top: 0;
  height: 52%;
  border-radius: 50%;
  background: inherit;
  box-shadow:
    inset 0 -4px 6px rgba(0,0,0,0.3),
    inset 0 4px 6px rgba(255,255,255,0.45),
    0 2px 4px rgba(0,0,0,0.25);
}
.token-3d .head::after {
  content: '';
  position: absolute;
  top: 14%; left: 20%;
  width: 36%; height: 28%;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}
.token-3d.red .base, .token-3d.red .stem, .token-3d.red .head {
  background: radial-gradient(circle at 35% 28%, #ff8a93, #e63946 50%, #8b1520);
}
.token-3d.green .base, .token-3d.green .stem, .token-3d.green .head {
  background: radial-gradient(circle at 35% 28%, #6eeba4, #22a06b 50%, #0a5c38);
}
.token-3d.yellow .base, .token-3d.yellow .stem, .token-3d.yellow .head {
  background: radial-gradient(circle at 35% 28%, #ffe88a, #f4c430 50%, #a07a08);
}
.token-3d.blue .base, .token-3d.blue .stem, .token-3d.blue .head {
  background: radial-gradient(circle at 35% 28%, #8ec5ff, #1d6fd8 50%, #0c3d8a);
}
.token-3d.glow {
  filter: drop-shadow(0 0 8px rgba(245,215,110,0.9)) drop-shadow(0 6px 4px rgba(0,0,0,0.45));
  animation: pulse-glow 1.2s ease-in-out infinite;
}
.token-on-board .token-3d { width: 100%; height: 130%; top: -20%; position: relative; }

/* CSS 3D die */
.dice-3d-wrap {
  width: 72px; height: 72px;
  perspective: 400px;
  flex-shrink: 0;
}
.dice-cube {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg);
}
.dice-face {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, #fffef8, #ebe3d4);
  border-radius: 12px;
  border: 2px solid rgba(180,150,80,0.35);
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.8), inset 0 -3px 6px rgba(0,0,0,0.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 11px; gap: 2px;
}
.dice-face .pip {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #333, #0a0a0a);
  margin: auto; opacity: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.dice-face.front { transform: translateZ(36px); }
.dice-face.back { transform: rotateY(180deg) translateZ(36px); }
.dice-face.right { transform: rotateY(90deg) translateZ(36px); background: linear-gradient(145deg, #f0ebe0, #d8d0c0); }
.dice-face.left { transform: rotateY(-90deg) translateZ(36px); background: linear-gradient(145deg, #f0ebe0, #d8d0c0); }
.dice-face.top { transform: rotateX(90deg) translateZ(36px); background: linear-gradient(145deg, #fff, #efe8d8); }
.dice-face.bottom { transform: rotateX(-90deg) translateZ(36px); background: linear-gradient(145deg, #ddd5c4, #c8bfae); }

.dice-face[data-face="1"] .pip:nth-child(5),
.dice-face[data-face="2"] .pip:nth-child(1),
.dice-face[data-face="2"] .pip:nth-child(9),
.dice-face[data-face="3"] .pip:nth-child(1),
.dice-face[data-face="3"] .pip:nth-child(5),
.dice-face[data-face="3"] .pip:nth-child(9),
.dice-face[data-face="4"] .pip:nth-child(1),
.dice-face[data-face="4"] .pip:nth-child(3),
.dice-face[data-face="4"] .pip:nth-child(7),
.dice-face[data-face="4"] .pip:nth-child(9),
.dice-face[data-face="5"] .pip:nth-child(1),
.dice-face[data-face="5"] .pip:nth-child(3),
.dice-face[data-face="5"] .pip:nth-child(5),
.dice-face[data-face="5"] .pip:nth-child(7),
.dice-face[data-face="5"] .pip:nth-child(9),
.dice-face[data-face="6"] .pip:nth-child(1),
.dice-face[data-face="6"] .pip:nth-child(3),
.dice-face[data-face="6"] .pip:nth-child(4),
.dice-face[data-face="6"] .pip:nth-child(6),
.dice-face[data-face="6"] .pip:nth-child(7),
.dice-face[data-face="6"] .pip:nth-child(9) { opacity: 1; }

/* Voice / chat FABs */
.comm-fabs {
  display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0;
}
.comm-fab {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 1.25rem;
  display: grid; place-items: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.comm-fab.mic-on {
  background: linear-gradient(145deg, #1a8f64, #0f5c42);
  border-color: rgba(45,212,160,0.5);
  box-shadow: 0 0 14px rgba(45,212,160,0.35);
}
.comm-fab.mic-off { opacity: 0.85; }
.comm-fab .badge-n {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #e63946; color: #fff; font-size: 0.65rem; font-weight: 800;
  display: grid; place-items: center;
  border: 2px solid var(--green-deep);
}
.p-chip .mic-ind {
  font-size: 0.7rem; margin-top: 2px; opacity: 0.85;
}
.p-chip .mic-ind.muted { opacity: 0.4; filter: grayscale(1); }

/* Chat panel */
.chat-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(4, 20, 16, 0.45);
  display: flex; flex-direction: column; justify-content: flex-end;
  backdrop-filter: blur(2px);
}
.chat-panel {
  height: 50%;
  background:
    linear-gradient(180deg, rgba(18,55,44,0.98), rgba(8,35,28,0.99));
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  padding: 14px 14px calc(14px + var(--safe-b));
}
.chat-panel .chat-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.chat-panel .chat-head h3 { margin: 0; flex: 1; font-size: 1.05rem; font-weight: 800; }
.chat-panel .chat-head .close {
  width: 36px; height: 36px; border-radius: 12px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.chat-tabs {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.chat-tabs button {
  flex: 1; padding: 8px; border-radius: 12px; font-size: 0.78rem; font-weight: 700;
  background: rgba(255,255,255,0.06); border: 1px solid transparent;
  color: var(--muted);
}
.chat-tabs button.on {
  background: rgba(45,212,160,0.15);
  border-color: rgba(45,212,160,0.4);
  color: var(--cream);
}
.chat-msgs {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 10px;
}
.chat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.35;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
}
.chat-bubble.me {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(26,143,100,0.45), rgba(15,92,66,0.5));
  border-color: rgba(45,212,160,0.3);
}
.chat-bubble .who {
  font-size: 0.68rem; font-weight: 800; color: var(--gold-light);
  margin-bottom: 2px;
}
.chat-bubble.me .who { color: var(--green-glow); }
.quick-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.quick-row button {
  padding: 8px 11px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--line);
  color: var(--cream);
}
.quick-row button.urdu {
  font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', serif;
  font-size: 0.85rem;
}
.emoji-quick {
  display: flex; gap: 6px; margin-bottom: 10px; justify-content: space-between;
}
.emoji-quick button {
  flex: 1; height: 40px; border-radius: 12px; font-size: 1.2rem;
  background: rgba(255,255,255,0.07); border: 1px solid var(--line);
}
.chat-input-row {
  display: flex; gap: 8px; align-items: center;
}
.chat-input-row .field {
  flex: 1; padding: 12px 14px; border-radius: 14px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--line);
  color: var(--muted); font-size: 0.85rem;
}
.chat-input-row .send {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, #f5d76e, #d4a017);
  color: #2a1a00; font-size: 1.2rem; font-weight: 800;
  display: grid; place-items: center;
}

/* Voice strip in chat / game */
.voice-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line);
  margin-bottom: 10px;
  font-size: 0.78rem;
}
.voice-strip .mic-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: linear-gradient(145deg, #1a8f64, #0f5c42);
  border: 1px solid rgba(45,212,160,0.4);
}
.voice-strip .mic-btn.off {
  background: rgba(230,57,70,0.35);
  border-color: rgba(230,57,70,0.5);
}
.voice-avs { display: flex; gap: 6px; flex: 1; }
.voice-avs .va {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  position: relative;
  font-size: 0.55rem; font-weight: 800; color: #fff;
  display: grid; place-items: center;
}
.voice-avs .va.red { background: #e63946; }
.voice-avs .va.green { background: #22a06b; }
.voice-avs .va.yellow { background: #f4c430; color: #3d2800; }
.voice-avs .va.blue { background: #1d6fd8; }
.voice-avs .va.speaking { box-shadow: 0 0 0 2px rgba(45,212,160,0.8); }
.voice-avs .va .m {
  position: absolute; bottom: -4px; right: -4px;
  font-size: 0.55rem; background: #111; border-radius: 50%;
  width: 14px; height: 14px; display: grid; place-items: center;
}

/* ========== PUBLIC TABLES ========== */
.pub-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.pub-head h2 { margin: 0; flex: 1; font-size: 1.25rem; font-weight: 800; }
.seg {
  display: flex; background: rgba(0,0,0,0.28); border-radius: 14px;
  padding: 4px; border: 1px solid var(--line); margin-bottom: 14px;
}
.seg button {
  flex: 1; padding: 10px 8px; border-radius: 11px;
  font-weight: 800; font-size: 0.82rem; color: var(--muted);
}
.seg button.on {
  background: linear-gradient(135deg, #1a8f64, #0f5c42);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,143,100,0.35);
}
.table-list { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.table-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  text-align: left;
}
.table-card .mini-board {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  background:
    conic-gradient(#e63946 0 90deg, #22a06b 90deg 180deg, #1d6fd8 180deg 270deg, #f4c430 270deg 360deg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 0 0 2px rgba(255,255,255,0.25);
  position: relative;
}
.table-card .mini-board::after {
  content: '☪';
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 0.9rem; background: rgba(10,61,46,0.35); border-radius: 12px;
}
.table-card .info { flex: 1; min-width: 0; }
.table-card .info .tname { font-weight: 800; font-size: 0.98rem; }
.table-card .info .tmeta { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }
.seats-dots { display: flex; gap: 4px; margin-top: 6px; }
.seats-dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
}
.seats-dots i.filled.red { background: #e63946; }
.seats-dots i.filled.green { background: #22a06b; }
.seats-dots i.filled.yellow { background: #f4c430; }
.seats-dots i.filled.blue { background: #1d6fd8; }
.table-card .join {
  padding: 10px 14px; border-radius: 12px; font-weight: 800; font-size: 0.8rem;
  background: linear-gradient(135deg, #f5d76e, #d4a017);
  color: #2a1a00;
  box-shadow: 0 4px 12px rgba(212,160,23,0.35);
  flex-shrink: 0;
}
.table-card.full .join {
  background: rgba(255,255,255,0.08); color: var(--muted);
  box-shadow: none;
}
.create-row {
  display: flex; gap: 10px; margin-top: 14px;
}
.create-row button {
  flex: 1; padding: 16px 12px; border-radius: 16px; font-weight: 800; font-size: 0.88rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.07);
}
.create-row button.primary {
  background: linear-gradient(135deg, #1a8f64, #0f5c42);
  border-color: rgba(45,212,160,0.4);
  box-shadow: 0 6px 18px rgba(26,143,100,0.35);
}

/* Shot scaling for new UI */
body.shot .board-stage { perspective: 2200px; padding: 20px 10px 40px; }
body.shot .board-3d {
  width: 920px; max-width: none;
  transform: rotateX(26deg) rotateZ(-2deg) translateY(-12px);
  border-radius: 28px;
}
body.shot .dice-3d-wrap { width: 120px; height: 120px; }
body.shot .dice-face { border-radius: 18px; padding: 18px; }
body.shot .dice-face .pip { width: 15px; height: 15px; }
body.shot .dice-face.front { transform: translateZ(60px); }
body.shot .dice-face.back { transform: rotateY(180deg) translateZ(60px); }
body.shot .dice-face.right { transform: rotateY(90deg) translateZ(60px); }
body.shot .dice-face.left { transform: rotateY(-90deg) translateZ(60px); }
body.shot .dice-face.top { transform: rotateX(90deg) translateZ(60px); }
body.shot .dice-face.bottom { transform: rotateX(-90deg) translateZ(60px); }
body.shot .comm-fab { width: 78px; height: 78px; border-radius: 22px; font-size: 1.9rem; }
body.shot .comm-fab .badge-n { width: 28px; height: 28px; font-size: 0.95rem; }
body.shot .chat-panel { height: 48%; padding: 28px 28px 36px; border-radius: 40px 40px 0 0; }
body.shot .chat-panel .chat-head h3 { font-size: 1.7rem; }
body.shot .chat-panel .chat-head .close { width: 56px; height: 56px; border-radius: 18px; font-size: 1.4rem; }
body.shot .chat-tabs button { padding: 14px; font-size: 1.2rem; border-radius: 16px; }
body.shot .chat-bubble { padding: 16px 18px; border-radius: 22px; font-size: 1.3rem; }
body.shot .chat-bubble .who { font-size: 1rem; }
body.shot .quick-row button { padding: 14px 18px; font-size: 1.1rem; }
body.shot .quick-row button.urdu { font-size: 1.25rem; }
body.shot .emoji-quick button { height: 64px; font-size: 1.9rem; border-radius: 18px; }
body.shot .chat-input-row .field { padding: 20px 22px; font-size: 1.3rem; border-radius: 20px; }
body.shot .chat-input-row .send { width: 72px; height: 72px; border-radius: 20px; font-size: 1.8rem; }
body.shot .voice-strip { padding: 16px 18px; border-radius: 20px; font-size: 1.2rem; gap: 12px; }
body.shot .voice-strip .mic-btn { width: 64px; height: 64px; border-radius: 18px; font-size: 1.8rem; }
body.shot .voice-avs .va { width: 44px; height: 44px; font-size: 0.85rem; }
body.shot .voice-avs .va .m { width: 20px; height: 20px; font-size: 0.7rem; }
body.shot .pub-head h2 { font-size: 2.1rem; }
body.shot .seg { padding: 6px; border-radius: 20px; margin-bottom: 22px; }
body.shot .seg button { padding: 16px; font-size: 1.25rem; border-radius: 16px; }
body.shot .table-card { padding: 22px; border-radius: 26px; gap: 18px; }
body.shot .table-card .mini-board { width: 84px; height: 84px; border-radius: 18px; }
body.shot .table-card .mini-board::after { font-size: 1.4rem; border-radius: 18px; }
body.shot .table-card .info .tname { font-size: 1.55rem; }
body.shot .table-card .info .tmeta { font-size: 1.15rem; }
body.shot .seats-dots i { width: 16px; height: 16px; }
body.shot .table-card .join { padding: 16px 22px; font-size: 1.2rem; border-radius: 16px; }
body.shot .create-row button { padding: 24px 16px; font-size: 1.35rem; border-radius: 22px; }
body.shot .table-list { gap: 16px; }
body.shot .p-chip .mic-ind { font-size: 1.05rem; }

/* --- live app extras --- */
.bot-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #1e293b;
  color: #fbbf24;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
}
.perm-tag { color: var(--gold-light); }
.fill-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 8px 0 12px;
}
.chat-panel, .chat-drawer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
}
.chat-drawer {
  position: absolute;
  left: 12px; right: 12px; bottom: 110px;
  max-height: 240px;
  z-index: 20;
  background: rgba(8,40,30,0.96);
}
.chat-log { overflow-y: auto; flex: 1; font-size: 0.85rem; }
.chat-line { margin: 4px 0; opacity: 0.95; }
.chat-line strong { color: var(--gold-light); margin-right: 6px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0,0,0,0.25); color: inherit; padding: 10px 12px;
}
.chat-form button {
  padding: 10px 14px; border-radius: 12px;
  background: var(--green-bright); font-weight: 700;
}
.lobby-actions { margin-top: 12px; }
.lobby-actions .primary, .create-row .primary {
  width: 100%; padding: 14px; border-radius: 16px;
  background: linear-gradient(135deg, var(--green-bright), var(--green-mid));
  font-weight: 800; font-size: 1rem;
}
.code-pill { font-size: 0.85rem; opacity: 0.85; cursor: pointer; }
.seat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0;
}
.seat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; text-align: center; min-height: 110px;
}
.seat.filled { border-color: rgba(45,212,160,0.45); }
.seat-token { height: 48px; display: grid; place-items: center; }
.seat-name { font-weight: 700; font-size: 0.9rem; }
.seat-status { font-size: 0.75rem; opacity: 0.7; }
.token-on-board.selectable { cursor: pointer; z-index: 5; filter: drop-shadow(0 0 6px #f5d76e); }
.icon-btn.on { outline: 2px solid var(--gold); }
#toast { transition: opacity .3s; opacity: 0; }
.create-row { display: flex; gap: 10px; margin-top: 12px; }
.create-row button {
  flex: 1; padding: 14px 10px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); font-weight: 700;
}

/* Per-player mic icons */
.mic-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.35);
  font-size: 0.85rem;
  vertical-align: middle;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  transition: box-shadow .15s, background .15s, transform .15s;
}
.mic-ico.live { border-color: rgba(45,212,160,0.55); }
.mic-ico.speaking {
  background: rgba(45,212,160,0.35);
  border-color: #2dd4a0;
  box-shadow: 0 0 0 0 rgba(45,212,160,0.7);
  animation: micPulse 1s ease-out infinite;
}
.mic-ico.muted {
  opacity: 0.85;
  background: rgba(80,20,20,0.55);
  border-color: rgba(230,57,70,0.7);
  filter: grayscale(0.2);
}
.mic-ico.off { opacity: 0.55; }
.mic-ico.local.muted { outline: 1px dashed rgba(245,215,110,0.6); }
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(45,212,160,0.65); transform: scale(1); }
  70% { box-shadow: 0 0 0 8px rgba(45,212,160,0); transform: scale(1.08); }
  100% { box-shadow: 0 0 0 0 rgba(45,212,160,0); transform: scale(1); }
}
.pc-name .mic-ico, .seat-name .mic-ico { position: relative; top: -1px; }

/* ===== LIVE GAME FIXES (board + phone fit) ===== */
.tokens-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  transform: translateZ(24px);
  transform-style: preserve-3d;
}
.tokens-layer .token-on-board {
  pointer-events: auto;
  transform: translate(-50%, -50%) translateZ(4px);
}

.cell.start-red::after,
.cell.start-green::after,
.cell.start-yellow::after,
.cell.start-blue::after {
  content: '▶';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(7px, 2vw, 12px);
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  pointer-events: none;
  font-weight: 900;
}
.cell.start-red::after { transform: rotate(0deg); }      /* toward center → */
.cell.start-green::after { transform: rotate(90deg); }   /* down */
.cell.start-yellow::after { transform: rotate(180deg); } /* left */
.cell.start-blue::after { transform: rotate(-90deg); }   /* up */

.game-screen.screen-game,
.screen.game-screen {
  padding: calc(6px + var(--safe-t)) 10px calc(14px + var(--safe-b));
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.game-screen .game-top {
  flex-shrink: 0;
  margin-bottom: 4px;
}
.game-title {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Override earlier overflow-x chips row */
.players-row { display: none !important; }
.screen-game .players-strip,
.game-screen .players-strip {
  flex-shrink: 0;
  margin-bottom: 4px;
}
.p-chip .bot-badge {
  display: inline-block;
  font-size: 0.55rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  vertical-align: middle;
  margin-left: 2px;
}
.p-chip .mic-ico {
  width: 20px; height: 20px; font-size: 0.7rem; margin-left: 2px;
}
.p-chip .nm {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 0;
}

.game-screen .game-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 0;
  text-align: left;
}
.game-screen .dice-panel {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  box-sizing: border-box;
  overflow: visible;
}
.game-screen .dice-btn {
  background: none;
  padding: 0;
  flex-shrink: 0;
}
.game-screen .dice-btn:disabled { opacity: 0.55; }
.game-screen .dice-3d-wrap { width: 58px; height: 58px; }

.board .board-inner,
.board-3d .board-inner {
  position: absolute;
  inset: 3%;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  gap: 1.5px;
  background: #0a2e24;
  border-radius: 8px;
  padding: 1.5px;
  z-index: 1;
}

/* Phone widths 360–430 */
@media (max-width: 430px) {
  .board-3d {
    width: min(100%, calc(100vw - 24px));
    transform: rotateX(10deg);
  }
  .players-strip { gap: 4px; }
  .p-chip { padding: 4px 2px; font-size: 0.58rem; }
  .p-chip .av { width: 22px; height: 22px; margin-bottom: 2px; }
  .p-chip .home-count { font-size: 0.55rem; }
  .p-chip .bot-badge { font-size: 0.5rem; padding: 0 3px; }
}
@media (max-width: 360px) {
  .board-3d { transform: rotateX(8deg); }
  .game-screen .dice-3d-wrap { width: 56px; height: 56px; }
}

.chat-drawer {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 42%;
  background: rgba(8,35,28,0.98);
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  padding: 12px;
  z-index: 40;
  display: flex; flex-direction: column;
}
.chat-drawer.hidden { display: none !important; }
.chat-line { margin-bottom: 6px; }
.chat-form { display: flex; gap: 8px; margin-top: 8px; }
.chat-form input {
  flex: 1; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.35); color: var(--cream);
}
.chat-form button {
  padding: 10px 14px; border-radius: 12px; font-weight: 800;
  background: linear-gradient(135deg, #f5d76e, #d4a017); color: #2a1a00;
}

/* ===== POLISH v5: dice / board / shop / timer ===== */
/* Contained dice holder — no spill */
.dice-holder {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.14), transparent 55%),
    linear-gradient(145deg, rgba(0,0,0,0.35), rgba(0,0,0,0.18));
  border: 1px solid rgba(245,215,110,0.35);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  overflow: hidden;
  box-sizing: border-box;
  padding: 8px;
}
.game-screen .dice-panel {
  overflow: hidden;
  align-items: center;
  padding: 10px 12px;
  gap: 10px;
}
.game-screen .dice-btn {
  background: none;
  padding: 0;
  border: none;
  flex-shrink: 0;
  line-height: 0;
}
.game-screen .dice-3d-wrap,
.dice-holder .dice-3d-wrap {
  width: 36px !important;
  height: 36px !important;
  perspective: 320px;
  margin: 0 auto;
}
.dice-holder .dice-cube {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg);
}
.dice-holder .dice-face {
  padding: 6px;
  border-radius: 8px;
  border-width: 1.5px;
}
.dice-holder .dice-face .pip {
  width: 6px;
  height: 6px;
}
.dice-holder .dice-face.front { transform: translateZ(20px); }
.dice-holder .dice-face.back { transform: rotateY(180deg) translateZ(20px); }
.dice-holder .dice-face.right { transform: rotateY(90deg) translateZ(20px); }
.dice-holder .dice-face.left { transform: rotateY(-90deg) translateZ(20px); }
.dice-holder .dice-face.top { transform: rotateX(90deg) translateZ(20px); }
.dice-holder .dice-face.bottom { transform: rotateX(-90deg) translateZ(20px); }

@keyframes dice-tumble {
  0%   { transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg) translateY(0) scale(1); }
  12%  { transform: rotateX(120deg) rotateY(-80deg) rotateZ(40deg) translateY(-10px) scale(1.05); }
  28%  { transform: rotateX(260deg) rotateY(140deg) rotateZ(-60deg) translateY(-4px) scale(1.02); }
  45%  { transform: rotateX(400deg) rotateY(-200deg) rotateZ(120deg) translateY(-12px) scale(1.06); }
  62%  { transform: rotateX(520deg) rotateY(280deg) rotateZ(-40deg) translateY(-2px) scale(1.01); }
  78%  { transform: rotateX(calc(var(--rx, 720deg) * 0.85)) rotateY(calc(var(--ry, 720deg) * 0.85)) rotateZ(calc(var(--rz, 360deg) * 0.7)) translateY(-8px) scale(1.04); }
  90%  { transform: rotateX(var(--rx, 720deg)) rotateY(var(--ry, 720deg)) rotateZ(var(--rz, 360deg)) translateY(2px) scale(0.98); }
  100% { transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg) translateY(0) scale(1); }
}
.dice-cube.dice-rolling {
  animation: dice-tumble 0.92s cubic-bezier(.22,.7,.25,1) forwards;
}
.dice-cube.dice-land {
  transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg) !important;
  transition: transform 0.15s ease-out;
}

/* Dice skin themes */
.dice-skin-classic .dice-face { background: linear-gradient(145deg, #fffef8, #ebe3d4); }
.dice-skin-gold .dice-face {
  background: linear-gradient(145deg, #ffe566, #d4a017 55%, #a67c00);
  border-color: rgba(120,80,0,0.45);
}
.dice-skin-gold .dice-face .pip { background: radial-gradient(circle at 35% 30%, #4a2c00, #1a0c00); }
.dice-skin-wood .dice-face {
  background:
    repeating-linear-gradient(90deg, rgba(80,40,10,0.08) 0 2px, transparent 2px 5px),
    linear-gradient(145deg, #c48a48 0%, #8b5a2b 100%);
}
.dice-skin-neon .dice-face {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border-color: rgba(0,255,200,0.7);
  box-shadow: inset 0 0 12px rgba(0,255,200,0.25), 0 0 8px rgba(0,255,200,0.35);
}
.dice-skin-neon .dice-face .pip {
  background: radial-gradient(circle at 35% 30%, #7fffd4, #00ffc8);
  box-shadow: 0 0 4px #00ffc8;
}
.dice-skin-crystal .dice-face {
  background: linear-gradient(145deg, rgba(200,230,255,0.85), rgba(140,180,255,0.55));
  border-color: rgba(255,255,255,0.6);
  backdrop-filter: blur(2px);
}
.dice-skin-crystal .dice-face .pip { background: radial-gradient(circle at 35% 30%, #2a4a8a, #0a1a40); }
.dice-skin-pakistan .dice-face {
  background: linear-gradient(145deg, #01411C, #0a6b36 60%, #01411C);
  border-color: rgba(255,255,255,0.35);
}
.dice-skin-pakistan .dice-face .pip {
  background: radial-gradient(circle at 35% 30%, #fff, #e8e8e8);
}
.dice-skin-pakistan .dice-face.front::before {
  content: '☪';
  position: absolute;
  top: 2px; right: 3px;
  font-size: 8px;
  opacity: 0.55;
  color: #fff;
}

/* Board fill available space + vertical centre */
.board-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}
.board-3d {
  width: min(100%, calc(100vw - 16px), calc(100dvh - 210px));
  max-width: 640px;
  transform: rotateX(8deg);
}
@media (min-width: 900px) {
  .board-3d {
    width: min(100%, calc(100dvh - 200px), 560px);
    transform: rotateX(6deg);
  }
}
@media (max-width: 430px) {
  .board-3d {
    width: min(100%, calc(100vw - 14px), calc(100dvh - 200px));
    transform: rotateX(8deg);
  }
}

/* Path/yard tokens centred — square body, no tall offset */
.tokens-layer .token-on-board {
  width: 5.6%;
  height: 5.6%;
  transform: translate(-50%, -50%) translateZ(4px);
}
.token-on-board .token-3d {
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  position: relative;
}

/* Turn timer ring on active chip */
.p-chip {
  position: relative;
}
.p-chip .timer-ring {
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  pointer-events: none;
  background: conic-gradient(#f5d76e calc(var(--t, 100) * 1%), rgba(255,255,255,0.12) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
  box-shadow: 0 0 10px rgba(245,215,110,0.35);
}
.p-chip.active .timer-ring { opacity: 1; }
.p-chip .timer-ring.urgent {
  background: conic-gradient(#e63946 calc(var(--t, 100) * 1%), rgba(255,255,255,0.08) 0);
  animation: ringPulse 0.45s ease-in-out infinite;
}
@keyframes ringPulse {
  50% { filter: brightness(1.25); }
}

/* Coin fly animation */
.coin-fly {
  position: fixed;
  z-index: 9999;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe566, #d4a017);
  border: 2px solid #a67c00;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  pointer-events: none;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 900; color: #4a2c00;
  transition: transform 0.85s cubic-bezier(.2,.8,.2,1), opacity 0.85s;
}
.coin-toast {
  position: fixed; left: 50%; top: 28%;
  transform: translateX(-50%);
  background: rgba(8,40,32,0.92);
  border: 1px solid rgba(245,215,110,0.5);
  color: #f5d76e;
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 800;
  z-index: 9998;
  animation: coinToastIn 1.6s ease forwards;
}
@keyframes coinToastIn {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -12px); }
}

/* Dice Shop */
.shop-screen { gap: 12px; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 12px;
}
.shop-card {
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.shop-card.equipped {
  border-color: rgba(245,215,110,0.75);
  box-shadow: 0 0 0 1px rgba(245,215,110,0.35), 0 8px 20px rgba(0,0,0,0.3);
}
.shop-card .preview {
  width: 72px; height: 72px;
  display: grid; place-items: center;
}
.shop-card .preview .dice-holder {
  width: 72px !important;
  height: 72px !important;
  padding: 14px !important;
  overflow: visible !important;
  clip-path: none !important;
  contain: none !important;
}
.shop-card .preview .dice-holder .dice-3d-wrap {
  width: 40px !important;
  height: 40px !important;
}
.shop-card .preview .dice-holder .dice-face.front { transform: translateZ(20px) !important; }
.shop-card .preview .dice-holder .dice-face.back { transform: rotateY(180deg) translateZ(20px) !important; }
.shop-card .preview .dice-holder .dice-face.right { transform: rotateY(90deg) translateZ(20px) !important; }
.shop-card .preview .dice-holder .dice-face.left { transform: rotateY(-90deg) translateZ(20px) !important; }
.shop-card .preview .dice-holder .dice-face.top { transform: rotateX(90deg) translateZ(20px) !important; }
.shop-card .preview .dice-holder .dice-face.bottom { transform: rotateX(-90deg) translateZ(20px) !important; }
.shop-card h3 { font-size: 0.9rem; margin: 0; }
.shop-card .price { font-size: 0.8rem; color: var(--muted); }
.shop-card .price.owned { color: #5ee09a; }
.shop-card button {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, #f5d76e, #d4a017);
  color: #2a1a00;
}
.shop-card button:disabled {
  opacity: 0.55;
  background: rgba(255,255,255,0.12);
  color: var(--cream);
}
.shop-card button.equip-btn {
  background: linear-gradient(135deg, #3dca7e, #168a55);
  color: #fff;
}

/* ===== DICE TUMBLE FIX v6b ===== */
.dice-holder {
  width: 68px !important;
  height: 68px !important;
  overflow: hidden !important;
  padding: 12px !important;
}
.dice-holder .dice-3d-wrap {
  width: 36px !important;
  height: 36px !important;
}
.dice-holder .dice-face.front { transform: translateZ(18px) !important; }
.dice-holder .dice-face.back { transform: rotateY(180deg) translateZ(18px) !important; }
.dice-holder .dice-face.right { transform: rotateY(90deg) translateZ(18px) !important; }
.dice-holder .dice-face.left { transform: rotateY(-90deg) translateZ(18px) !important; }
.dice-holder .dice-face.top { transform: rotateX(90deg) translateZ(18px) !important; }
.dice-holder .dice-face.bottom { transform: rotateX(-90deg) translateZ(18px) !important; }
.dice-holder .dice-cube.dice-rolling {
  animation: dice-tumble 0.96s cubic-bezier(.18,.75,.22,1) both !important;
}
.game-screen .dice-panel { overflow: hidden !important; }


/* ===== AUDIT FIX v8/v9: contained but VISIBLE 3D tumble ===== */
.dice-holder {
  width: 88px !important;
  height: 88px !important;
  overflow: hidden !important;
  padding: 16px !important;
  contain: paint !important;
  clip-path: inset(0 round 16px);
  transform: translateZ(0);
  perspective: 320px;
  transition: box-shadow 0.2s;
}
.dice-holder.is-rolling {
  box-shadow: inset 0 0 0 2px rgba(245,215,110,0.65), 0 0 16px rgba(245,215,110,0.35);
}
.dice-holder .dice-3d-wrap {
  width: 36px !important;
  height: 36px !important;
  perspective: none !important;
  overflow: visible;
}
.dice-holder .dice-cube {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg);
}
.dice-holder .dice-face {
  padding: 5px !important;
  border-radius: 7px !important;
  backface-visibility: hidden;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}
.dice-holder .dice-face .pip {
  width: 6px !important;
  height: 6px !important;
}
.dice-holder .dice-face.front { transform: translateZ(18px) !important; }
.dice-holder .dice-face.back { transform: rotateY(180deg) translateZ(18px) !important; }
.dice-holder .dice-face.right { transform: rotateY(90deg) translateZ(18px) !important; }
.dice-holder .dice-face.left { transform: rotateY(-90deg) translateZ(18px) !important; }
.dice-holder .dice-face.top { transform: rotateX(90deg) translateZ(18px) !important; }
.dice-holder .dice-face.bottom { transform: rotateX(-90deg) translateZ(18px) !important; }
.game-screen .dice-panel,
.game-screen .dice-btn {
  overflow: hidden !important;
}
/* Stronger selectable ring so "tap glowing token" is obvious */
.yard-slot .yard-token.selectable::after,
.token-on-board.selectable::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid #ffe566;
  box-shadow: 0 0 10px #f5d76e, inset 0 0 6px rgba(245,215,110,0.5);
  pointer-events: none;
  animation: pulse-glow 1.1s ease-in-out infinite;
}
@keyframes dice-tumble {
  0%   { transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg) translateY(0) scale(1); }
  18%  { transform: rotateX(200deg) rotateY(-140deg) rotateZ(80deg) translateY(-5px) scale(1.04); }
  40%  { transform: rotateX(420deg) rotateY(200deg) rotateZ(-90deg) translateY(-2px) scale(1.02); }
  62%  { transform: rotateX(640deg) rotateY(-260deg) rotateZ(140deg) translateY(-6px) scale(1.05); }
  82%  { transform: rotateX(820deg) rotateY(320deg) rotateZ(-50deg) translateY(1px) scale(0.98); }
  100% { transform: rotateX(-22deg) rotateY(-28deg) rotateZ(8deg) translateY(0) scale(1); }
}
.finish-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.finish-actions .primary-btn,
button.primary-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #f5d76e, #d4a017);
  color: #2a1a00;
  border: none;
  cursor: pointer;
}


/* Compact coin pill in game header */
.game-top .coin-pill.compact {
  padding: 4px 10px 4px 6px;
  gap: 6px;
  font-size: 0.78rem;
  margin-right: 4px;
}
.game-top .coin-pill.compact .coin-icon {
  width: 22px; height: 22px; font-size: 0.7rem;
}
.game-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}


/* Stronger mid-tumble visibility */
.dice-holder.is-rolling .dice-3d-wrap {
  width: 42px !important;
  height: 42px !important;
}
