:root {
  --bg-deep: #09102c;
  --bg-mid: #132158;
  --bg-card: rgba(20, 34, 86, 0.85);
  --border-glass: rgba(255, 255, 255, 0.14);
  --gold: #ffd147;
  --gold-dark: #d97706;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --red: #ef4444;
  --red-dark: #b91c1c;
  --green: #22c55e;
  --green-dark: #15803d;
  --yellow: #facc15;
  --yellow-dark: #ca8a04;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
}

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

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #1d3582 0%, #0a1233 55%, #060b21 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOP BAR */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(8, 14, 42, 0.9);
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: transform 0.15s;
}
.profile-pill:hover { transform: translateY(-1px); }

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd147, #f59e0b);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.lvl-badge {
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
}

.xp-track {
  width: 90px;
  height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

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

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 209, 71, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.currency-pill.gems { border-color: rgba(56, 189, 248, 0.45); }
.plus-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conn-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.conn-pill.offline {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.16); }

/* MAIN LOBBY */
.main-content {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 90px;
}

.tab-panel { display: none; animation: fadeIn 0.2s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 26px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(124, 58, 237, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  margin-bottom: 22px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crown-glow {
  font-size: 34px;
  filter: drop-shadow(0 0 10px rgba(255, 209, 71, 0.7));
}
.brand-title h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 32px;
  letter-spacing: 1px;
}
.brand-title h1 span { color: var(--gold); }
.hero-sub {
  color: #cbd5e1;
  font-size: 13px;
  margin: 6px 0 14px;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.14s, filter 0.14s;
}
.chip-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.chip-btn.gold { background: linear-gradient(135deg, #fbbf24, #d97706); color: #1e1b4b; }
.chip-btn.emerald { background: linear-gradient(135deg, #34d399, #059669); }
.chip-btn.glass { background: rgba(255,255,255,0.14); border: 1px solid var(--border-glass); }

.equipped-dice-preview {
  background: rgba(9, 16, 44, 0.55);
  border: 1px solid var(--border-glass);
  padding: 12px 18px;
  border-radius: 16px;
  text-align: center;
}
.mini-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.dice-badge-preview { font-weight: 700; color: var(--gold); font-size: 14px; }

/* MODE CARDS */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 16px;
}

.mode-card {
  position: relative;
  border-radius: 22px;
  padding: 22px 20px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 14px 28px rgba(0,0,0,0.3);
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 36px rgba(0,0,0,0.45);
}
.card-blue { background: linear-gradient(155deg, #2563eb, #1e3a8a); }
.card-purple { background: linear-gradient(155deg, #9333ea, #4c1d95); }
.card-amber { background: linear-gradient(155deg, #f59e0b, #b45309); }
.card-emerald { background: linear-gradient(155deg, #10b981, #065f46); }

.mode-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  letter-spacing: 0.6px;
}
.mode-icon { font-size: 38px; margin-top: 4px; }
.mode-card h3 { font-size: 20px; font-weight: 700; }
.mode-card p { font-size: 12.5px; color: rgba(255,255,255,0.86); flex: 1; }
.play-pill {
  margin-top: 8px;
  align-self: flex-start;
  border: none;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}

/* SECTION HEADERS & LISTS */
.section-header { margin-bottom: 18px; }
.section-header h2 { font-size: 22px; margin-bottom: 4px; }
.section-header p { font-size: 13px; color: var(--text-muted); }
.row-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

.dice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
}
.dice-shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dice-shop-card.equipped { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 209, 71, 0.22); }
.dice-swatch {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}

/* CLUBS */
.clubs-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}
@media (max-width: 780px) { .clubs-layout { grid-template-columns: 1fr; } }

.clubs-list { display: flex; flex-direction: column; gap: 10px; }
.club-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.club-item.active { border-color: var(--gold); background: rgba(37, 99, 235, 0.25); }
.club-left { display: flex; align-items: center; gap: 12px; }
.club-badge { font-size: 28px; }

.club-chat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  height: 380px;
}
.club-chat-header {
  padding: 12px 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-glass);
}
.club-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.club-msg {
  background: rgba(255,255,255,0.06);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}
.club-msg-meta { font-size: 11px; color: var(--gold); font-weight: 600; margin-bottom: 2px; }
.club-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border-glass);
}
.club-chat-form input, .inline-form input, .ingame-chat-form input {
  flex: 1;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  padding: 8px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
}

/* FRIENDS & LEADERBOARD */
.inline-form { display: flex; gap: 8px; }
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.friend-card, .lb-row {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.leaderboard-list { display: flex; flex-direction: column; gap: 10px; }
.lb-rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.lb-row.top-1 .lb-rank { background: #fbbf24; color: #1e1b4b; }
.lb-row.top-2 .lb-rank { background: #cbd5e1; color: #0f172a; }
.lb-row.top-3 .lb-rank { background: #d97706; color: #fff; }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: rgba(8, 14, 42, 0.95);
  border-top: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 40;
}
.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 12px;
}
.nav-item span { font-size: 20px; }
.nav-item.active { color: var(--gold); background: rgba(255, 209, 71, 0.1); }

/* GAME VIEW */
.game-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 20px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.game-info-left { display: flex; align-items: center; gap: 10px; }
.match-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.match-mode-tag, .match-prize-tag, .four-tap-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border-glass);
}
.match-prize-tag { color: var(--gold); border-color: rgba(255, 209, 71, 0.4); }
.four-tap-pill {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(217, 119, 6, 0.25));
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
}

.game-stage {
  display: grid;
  grid-template-columns: minmax(300px, 600px) 320px;
  justify-content: center;
  align-items: start;
  gap: 20px;
}
@media (max-width: 960px) {
  .game-stage { grid-template-columns: 1fr; justify-items: center; }
  .game-controls-panel { width: 100%; max-width: 560px; }
}

.board-wrapper {
  position: relative;
  width: 100%;
  max-width: 580px;
  padding: 48px 6px;
}

.player-hud {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 19, 52, 0.92);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 5px 10px;
  z-index: 15;
  min-width: 148px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.player-hud.active-turn {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(255, 209, 71, 0.55);
  transform: scale(1.04);
}
.hud-red { top: 0; left: 6px; border-left: 4px solid var(--red); }
.hud-green { top: 0; right: 6px; border-right: 4px solid var(--green); }
.hud-blue { bottom: 0; left: 6px; border-left: 4px solid var(--blue); }
.hud-yellow { bottom: 0; right: 6px; border-right: 4px solid var(--yellow); }

.hud-avatar { font-size: 22px; }
.hud-info { flex: 1; min-width: 0; }
.hud-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-sub { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.hud-timer { font-size: 11px; font-weight: 800; color: var(--gold); }
.hud-gift-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 13px;
}

/* 15x15 LUDO BOARD */
.ludo-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 6px solid #1e293b;
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
}

.board-cell {
  border: 0.5px solid #cbd5e1;
  position: relative;
  display: grid;
  place-items: center;
  font-size: 13px;
  user-select: none;
}

.cell-red { background: #ef4444; color: #fff; }
.cell-green { background: #22c55e; color: #fff; }
.cell-yellow { background: #facc15; color: #1e293b; }
.cell-blue { background: #3b82f6; color: #fff; }
.cell-safe { background: #f1f5f9; color: #64748b; }
.cell-safe.cell-red { background: #ef4444; color: #fff; }
.cell-safe.cell-green { background: #22c55e; color: #fff; }
.cell-safe.cell-yellow { background: #facc15; color: #1e293b; }
.cell-safe.cell-blue { background: #3b82f6; color: #fff; }

.base-overlay {
  position: absolute;
  width: 40%;
  height: 40%;
  padding: 8%;
  display: grid;
  place-items: center;
  z-index: 2;
}
.base-red { top: 0; left: 0; background: var(--red); }
.base-green { top: 0; right: 0; background: var(--green); }
.base-yellow { bottom: 0; right: 0; background: var(--yellow); }
.base-blue { bottom: 0; left: 0; background: var(--blue); }

.base-inner {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 18%;
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.18);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  place-items: center;
  padding: 12%;
  gap: 14%;
}

.base-pad {
  width: 82%;
  height: 82%;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.12);
}
.base-red .base-pad { background: rgba(239, 68, 68, 0.22); }
.base-green .base-pad { background: rgba(34, 197, 94, 0.22); }
.base-yellow .base-pad { background: rgba(250, 204, 21, 0.28); }
.base-blue .base-pad { background: rgba(59, 130, 246, 0.22); }

.center-home {
  position: absolute;
  top: 40%;
  left: 40%;
  width: 20%;
  height: 20%;
  z-index: 2;
  background: conic-gradient(
    from -45deg,
    var(--green) 0deg 90deg,
    var(--yellow) 90deg 180deg,
    var(--blue) 180deg 270deg,
    var(--red) 270deg 360deg
  );
  border: 2px solid #1e293b;
  display: grid;
  place-items: center;
}
.center-crown {
  font-size: 20px;
  background: rgba(255,255,255,0.92);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* TOKENS */
.tokens-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.ludo-token {
  position: absolute;
  width: 5.6%;
  height: 5.6%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45), inset 0 -3px 5px rgba(0,0,0,0.25);
  transition: top 0.22s ease, left 0.22s ease, transform 0.16s ease;
  pointer-events: auto;
  cursor: default;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}
.ludo-token.token-red { background: radial-gradient(circle at 30% 30%, #f87171, #dc2626); }
.ludo-token.token-green { background: radial-gradient(circle at 30% 30%, #4ade80, #16a34a); }
.ludo-token.token-yellow { background: radial-gradient(circle at 30% 30%, #fef08a, #eab308); color: #1e293b; }
.ludo-token.token-blue { background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb); }

.ludo-token.selectable {
  cursor: pointer;
  z-index: 20 !important;
  animation: pulseToken 0.75s infinite alternate;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9), 0 0 18px rgba(255, 209, 71, 0.95);
}

@keyframes pulseToken {
  from { transform: translate(-50%, -50%) scale(1.06); }
  to { transform: translate(-50%, -50%) scale(1.24); }
}

.token-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #0f172a;
  color: #ffd147;
  font-size: 9px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid #fff;
}

/* CONTROLS PANEL & 3D DICE */
.game-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dice-control-card, .ingame-chat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 16px;
}

.turn-banner {
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.dice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dice-touch-area {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
  border: 2px solid rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  perspective: 400px;
  transition: transform 0.1s, box-shadow 0.15s;
}
.dice-touch-area.can-roll {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(255, 209, 71, 0.45);
}
.dice-touch-area:active { transform: scale(0.94); }
.dice-touch-area.charged-6 {
  border-color: #fde047;
  box-shadow: 0 0 32px rgba(250, 204, 21, 0.9);
}

.dice-cube {
  width: 56px;
  height: 56px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.dice-cube.rolling {
  animation: spinDice 0.32s linear infinite;
}
@keyframes spinDice {
  0% { transform: rotateX(0deg) rotateY(0deg); }
  50% { transform: rotateX(180deg) rotateY(180deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

.dice-cube.show-1 { transform: rotateX(0deg) rotateY(0deg); }
.dice-cube.show-2 { transform: rotateX(-90deg) rotateY(0deg); }
.dice-cube.show-3 { transform: rotateX(0deg) rotateY(-90deg); }
.dice-cube.show-4 { transform: rotateX(0deg) rotateY(90deg); }
.dice-cube.show-5 { transform: rotateX(90deg) rotateY(0deg); }
.dice-cube.show-6 { transform: rotateX(180deg) rotateY(0deg); }

.face {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  place-items: center;
}
.face-1 { transform: translateZ(28px); }
.face-6 { transform: rotateY(180deg) translateZ(28px); }
.face-3 { transform: rotateY(90deg) translateZ(28px); }
.face-4 { transform: rotateY(-90deg) translateZ(28px); }
.face-2 { transform: rotateX(90deg) translateZ(28px); }
.face-5 { transform: rotateX(-90deg) translateZ(28px); }

.pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1e293b;
}
.pip.tl { grid-area: 1 / 1; }
.pip.tr { grid-area: 1 / 3; }
.pip.ml { grid-area: 2 / 1; }
.pip.center { grid-area: 2 / 2; }
.pip.mr { grid-area: 2 / 3; }
.pip.bl { grid-area: 3 / 1; }
.pip.br { grid-area: 3 / 3; }

/* Dice Skins */
.skin-gold .face { background: linear-gradient(135deg, #fef08a, #eab308); border-color: #b45309; }
.skin-gold .pip { background: #451a03; }
.skin-ruby .face { background: linear-gradient(135deg, #ef4444, #991b1b); border-color: #fca5a5; }
.skin-ruby .pip { background: #fff; }
.skin-emerald .face { background: linear-gradient(135deg, #34d399, #065f46); border-color: #a7f3d0; }
.skin-emerald .pip { background: #fff; }
.skin-neon .face { background: #0f172a; border-color: #38bdf8; box-shadow: inset 0 0 10px rgba(56,189,248,0.5); }
.skin-neon .pip { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }
.skin-diamond .face { background: linear-gradient(135deg, #e0f2fe, #7dd3fc); border-color: #fff; }
.skin-diamond .pip { background: #0369a1; }
.skin-obsidian .face { background: linear-gradient(135deg, #334155, #020617); border-color: #94a3b8; }
.skin-obsidian .pip { background: #f43f5e; }
.skin-rainbow .face { background: linear-gradient(135deg, #f472b6, #a78bfa, #38bdf8); border-color: #fff; }
.skin-rainbow .pip { background: #fff; }

.tap-charge-dots { display: flex; gap: 8px; }
.tap-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.12s, transform 0.12s;
}
.tap-dot.lit {
  background: var(--gold);
  transform: scale(1.25);
  box-shadow: 0 0 8px var(--gold);
}
.dice-hint { font-size: 12px; color: var(--text-muted); text-align: center; }

/* INGAME CHAT */
.quick-reactions, .quick-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.react-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 16px;
  cursor: pointer;
}
.phrase-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: #e2e8f0;
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
}
.ingame-messages {
  height: 130px;
  overflow-y: auto;
  background: rgba(0,0,0,0.22);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ingame-chat-form { display: flex; gap: 6px; }

/* FLOATING EFFECTS */
.floating-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}
.float-pop {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  font-weight: 800;
  text-shadow: 0 4px 12px rgba(0,0,0,0.6);
  animation: floatUp 1.6s ease forwards;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -130%) scale(1); }
}

/* MODALS & TOASTS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}
.modal-box {
  width: 100%;
  max-width: 440px;
  background: #111c4a;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.seg-group { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  flex: 1;
  min-width: 75px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn.active { background: var(--gold); color: #1e1b4b; border-color: var(--gold); }
.modal-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-family: inherit;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--gold);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
