:root {
  --desk: #cfdcd3;
  --desk-speck: rgba(34, 38, 58, 0.06);
  --ink: #22263a;
  --muted: #586073;
  --surface: #e4ece6;
  --panel: rgba(240, 245, 241, 0.94);
  --line: rgba(34, 38, 58, 0.18);
  --pink: #e2337f;
  --green: #1f9d6b;
  --orange: #e9772c;
  --teal: #2a9d91;
  --error: #b3123f;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #1e2233;
    --desk-speck: rgba(255, 255, 255, 0.05);
    --ink: #eef0f6;
    --muted: #a3a9bb;
    --surface: #292e43;
    --panel: rgba(36, 41, 60, 0.95);
    --line: rgba(238, 240, 246, 0.16);
    --green: #3fcf93;
    --orange: #ff9a52;
    --teal: #45c9bb;
    --error: #ff7aa2;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --desk: #1e2233;
  --desk-speck: rgba(255, 255, 255, 0.05);
  --ink: #eef0f6;
  --muted: #a3a9bb;
  --surface: #292e43;
  --panel: rgba(36, 41, 60, 0.95);
  --line: rgba(238, 240, 246, 0.16);
  --green: #3fcf93;
  --orange: #ff9a52;
  --teal: #45c9bb;
  --error: #ff7aa2;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --desk: #cfdcd3;
  --desk-speck: rgba(34, 38, 58, 0.06);
  --ink: #22263a;
  --muted: #586073;
  --surface: #e4ece6;
  --panel: rgba(240, 245, 241, 0.94);
  --line: rgba(34, 38, 58, 0.18);
  --pink: #e2337f;
  --green: #1f9d6b;
  --orange: #e9772c;
  --teal: #2a9d91;
  --error: #b3123f;
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: inherit;
}

html {
  height: 100%;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--desk);
  background-image: radial-gradient(var(--desk-speck) 1px, transparent 1.2px);
  background-size: 7px 7px;
  color: var(--ink);
  font: 400 16px/1.5 Rubik, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

.hero {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: clamp(16px, 3.5vw, 32px) clamp(20px, 5vw, 56px) 0;
  pointer-events: auto;
}

h1 {
  font: 900 clamp(28px, 4.5vw, 50px)/0.95 Unbounded, "Arial Black", sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
}

.rules {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 38ch;
  font-size: 14px;
  line-height: 1.45;
}

.stage {
  position: relative;
  flex: 1 0 auto;
  height: clamp(520px, 86vh, 920px);
  outline: none;
  touch-action: none;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.stage.can-throw {
  cursor: grab;
}

.stage.charging {
  cursor: grabbing;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage:focus-visible::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed var(--pink);
  border-radius: 24px;
  pointer-events: none;
}

/* Scoreboard */
.score {
  position: absolute;
  top: 75px;
  right: clamp(16px, 4vw, 48px);
  z-index: 2;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.player {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 8px 14px 8px 10px;
  min-width: 190px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.player.is-turn {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px var(--pink);
  transform: scale(1.02);
}

.player .count {
  font: 900 30px/1 Unbounded, "Arial Black", sans-serif;
  min-width: 1.4ch;
  text-align: center;
}

.player .name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.player .name i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.player .stack {
  display: flex;
  margin-top: 4px;
  min-height: 18px;
}

.player .stack span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-right: -5px;
  background: center / cover no-repeat;
  border: 1.5px solid var(--panel);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Status bar */
.status {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 3vh, 32px);
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  max-width: min(92%, 580px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Power meter */
.meter {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  width: 18px;
  height: 114px;
  border-radius: 12px;
  background: var(--panel);
  border: 2px solid var(--ink);
  overflow: hidden;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.meter.on {
  display: block;
}

.meter .zone {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--green);
  opacity: 0.9;
}

.meter .fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(226, 51, 127, 0.4);
}

.meter .needle {
  position: absolute;
  left: -2px;
  right: -2px;
  height: 4px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateY(50%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Floating labels and toasts */
.toast, .tag {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  font: 700 13px/1 Unbounded, "Arial Black", sans-serif;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  will-change: transform;
}

.toast {
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: var(--desk);
  animation: rise 0.9s ease-out forwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

@keyframes rise {
  from {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -190%) scale(1.1);
  }
}

.tag {
  left: 0;
  top: 0;
  transform: translate3d(-9999px, -9999px, 0);
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.tag.up {
  background: var(--green);
  color: #fff;
  border-color: transparent;
}

/* Top / bottom controls */
.top-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.sound, .action-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.sound:hover, .action-btn:hover {
  transform: scale(1.05);
  border-color: var(--pink);
}

.sound svg, .action-btn svg {
  width: 20px;
  height: 20px;
}

.sound .off {
  display: none;
}

.sound[aria-pressed="false"] .on {
  display: none;
}

.sound[aria-pressed="false"] .off {
  display: block;
}

.bottom-actions {
  position: absolute;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vh, 28px);
  z-index: 3;
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-btn {
  font: 700 12px/1 Unbounded, "Arial Black", sans-serif;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.2s, background-color 0.2s;
}

.lang-btn:hover {
  border-color: var(--pink);
}

/* Modal / Game over overlay */
.over {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 22, 34, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.over.on {
  display: flex;
}

.over .card {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 28px;
  padding: 32px 36px;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.2);
  animation: popIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.over h2 {
  font: 900 30px/1.1 Unbounded, "Arial Black", sans-serif;
  margin: 0 0 12px;
}

.over p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

/* Buttons */
button {
  font: 500 14px/1 Rubik, Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

button.primary {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  font-weight: 700;
  font-family: Unbounded, "Arial Black", sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
}

button:hover {
  border-color: var(--pink);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}

/* Settings Drawer (Tune) */
.settings-drawer {
  position: absolute;
  top: clamp(16px, 3.5vw, 32px);
  left: clamp(20px, 5vw, 56px);
  z-index: 5;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 16px 20px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  display: none;
}

.settings-drawer.open {
  display: block;
  animation: popIn 0.25s ease-out;
}

.settings-drawer h3 {
  margin: 0 0 14px;
  font: 900 16px/1 Unbounded, "Arial Black", sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.tune-body {
  display: grid;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
}

.row input[type="range"] {
  width: 100%;
  accent-color: var(--pink);
}

.row input[type="color"] {
  width: 44px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  padding: 2px;
  justify-self: end;
  cursor: pointer;
}

.row select {
  width: 100%;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 500 12px Rubik, sans-serif;
  padding: 2px 6px;
  justify-self: end;
  cursor: pointer;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  header {
    padding: 14px 16px 0;
  }
  .score {
    top: 75px;
    right: 14px;
  }
  .player {
    min-width: 140px;
    padding: 6px 10px;
  }
  .player .count {
    font-size: 24px;
  }
  .rules {
    display: none;
  }
  .bottom-actions {
    right: 14px;
    bottom: 14px;
  }
}

/* ================= TOP NAVIGATION BAR ================= */
.top-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

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

.brand h1 {
  font: 900 24px/1 Unbounded, "Arial Black", sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.nav-tab {
  font: 700 12px/1 Unbounded, "Arial Black", sans-serif;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.nav-tab:hover {
  color: var(--ink);
  background: rgba(0,0,0,0.04);
}

.nav-tab.active {
  color: #fff;
  background: var(--pink);
  box-shadow: 0 2px 8px rgba(226, 51, 127, 0.35);
}

.user-currencies {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 13px/1 Unbounded, "Arial Black", sans-serif;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}

.currency-pill.coin {
  color: #d97706;
}

.currency-pill.trophy {
  color: #2563eb;
}

.daily-btn {
  font: 700 11px/1 Unbounded, "Arial Black", sans-serif;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.daily-btn:hover {
  transform: scale(1.05);
}

/* ================= MODAL DIALOGS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 18, 28, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 28px;
  width: 720px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: popIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font: 900 20px/1.1 Unbounded, "Arial Black", sans-serif;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

/* ================= INVENTORY & TASO CARDS ================= */
.taso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.taso-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.taso-card:hover {
  transform: translateY(-3px);
  border-color: var(--pink);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.taso-card.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}

.active-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  font: 900 10px/1 Unbounded, "Arial Black", sans-serif;
  background: var(--green);
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.taso-thumb {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 8px 0 12px;
  border: 3px solid var(--ink);
  background: center / cover no-repeat;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  position: relative;
}

.taso-name {
  font: 700 13px/1.2 Unbounded, "Arial Black", sans-serif;
  margin: 0 0 6px;
}

.rarity-pill {
  font: 800 10px/1 Unbounded, "Arial Black", sans-serif;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Durability / Condition bar */
.condition-box {
  width: 100%;
  margin: 6px 0 12px;
}

.condition-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.condition-track {
  width: 100%;
  height: 6px;
  background: rgba(0,0,0,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.condition-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.card-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}

.btn-sm {
  flex: 1;
  font: 700 11px/1 Unbounded, "Arial Black", sans-serif;
  padding: 8px;
  border-radius: 999px;
}

/* ================= SHOP & PACKS ================= */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.pack-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pack-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.pack-icon {
  font-size: 48px;
  margin: 10px 0;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
}

.pack-title {
  font: 900 15px/1.2 Unbounded, "Arial Black", sans-serif;
  margin: 0 0 8px;
}

.pack-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 14px;
  min-height: 34px;
}

.pack-price {
  font: 900 16px/1 Unbounded, "Arial Black", sans-serif;
  color: #d97706;
  margin-bottom: 14px;
}

/* Booster pack opening reveal modal */
.reveal-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 12, 22, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.reveal-modal.open {
  display: flex;
}

.chips-bag {
  width: 220px;
  height: 300px;
  background: linear-gradient(135deg, #e2337f, #ff9a52);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 20px 60px rgba(226, 51, 127, 0.5);
  animation: hoverBag 2s ease-in-out infinite alternate;
  position: relative;
  border: 3px solid #fff;
}

@keyframes hoverBag {
  from { transform: translateY(-8px) rotate(-1deg); }
  to { transform: translateY(8px) rotate(1deg); }
}

.revealed-taso {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: zoomTaso 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes zoomTaso {
  from { transform: scale(0.2) rotate(360deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.revealed-disc {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
  margin-bottom: 18px;
  background: center / cover no-repeat;
}

/* ================= TOURNAMENT BRACKET ================= */
.bracket-wrapper {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 10px 0;
}

.bracket-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 200px;
}

.bracket-col-title {
  font: 900 13px/1 Unbounded, "Arial Black", sans-serif;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 14px;
}

.bracket-match {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 12px;
  position: relative;
}

.match-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
}

.match-team.winner {
  color: var(--pink);
  font-weight: 800;
}

.spectate-btn {
  font: 700 10px/1 Unbounded, "Arial Black", sans-serif;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  margin-top: 6px;
  cursor: pointer;
  width: 100%;
}

/* ================= SPECTATOR BROADCAST OVERLAY ================= */
.broadcast-bar {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  align-items: center;
  gap: 16px;
  background: rgba(20, 24, 38, 0.9);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 10px 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.broadcast-bar.active {
  display: flex;
}

.live-pill {
  font: 900 11px/1 Unbounded, "Arial Black", sans-serif;
  background: #ef4444;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.spectator-commentary {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  background: rgba(18, 22, 34, 0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.spectator-commentary.active {
  display: block;
}

/* ================= LEADERBOARD TABLE ================= */
.table-responsive {
  width: 100%;
  border-collapse: collapse;
}

.table-responsive th, .table-responsive td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.table-responsive th {
  font: 800 11px/1 Unbounded, "Arial Black", sans-serif;
  color: var(--muted);
  text-transform: uppercase;
}

.table-responsive tr.highlight {
  background: rgba(226, 51, 127, 0.08);
  font-weight: 700;
}

/* Screen Shake is now handled smoothly in 3D camera-space via Three.js (zero reflow, 60fps) */
.stage.screen-shake {
  /* no-op: handled in Three.js camera space */
}

/* ================= MOUSE SLIDE GESTURE & MODE STYLES ================= */
.mode-badge-btn {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mode-badge-btn:hover {
  border-color: var(--pink);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(226, 51, 127, 0.15);
}

.gesture-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.gesture-pill {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(18, 22, 34, 0.94);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: Unbounded, "Arial Black", sans-serif;
  font-size: 12px;
  font-weight: 800;
  transform: translate(-50%, -140%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.gesture-pill.active {
  display: flex;
}

.gesture-pill .gesture-icon {
  font-size: 16px;
}

.gesture-speed-bar {
  width: 48px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-left: 4px;
}

.gesture-speed-fill {
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, #ff9a52, #38ef7d);
  border-radius: 999px;
  transition: width 0.08s ease-out;
}

.tech-swipe-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  animation: fadeIn 0.3s ease-out;
  white-space: nowrap;
}

[data-theme="dark"] .tech-swipe-hint {
  background: rgba(24, 28, 42, 0.75);
}

/* ================= IN-GAME BAG DOCK (ÇANTA TASO RAFI) ================= */
.game-bag-dock {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(24, 28, 42, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 5px 12px 5px 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  z-index: 18;
  max-width: calc(100% - 130px);
  pointer-events: auto;
  user-select: none;
  animation: slideUpFade 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.dock-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  padding-right: 10px;
}

.dock-badge {
  font: 800 11px Unbounded, sans-serif;
  color: #fff;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dock-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--pink);
  background: rgba(226, 51, 127, 0.2);
  padding: 1px 6px;
  border-radius: 999px;
}

.dock-tasos {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px;
}

.dock-tasos::-webkit-scrollbar {
  display: none;
}

.dock-taso-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s;
}

.dock-taso-btn:hover {
  transform: translateY(-4px) scale(1.15);
  z-index: 5;
}

.dock-taso-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2.5px solid #8c9ba5;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.dock-taso-btn.is-active .dock-taso-img {
  border-color: #ffd700;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.8), 0 3px 8px rgba(0, 0, 0, 0.4);
}

.dock-active-check {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 15px;
  height: 15px;
  background: #38ef7d;
  color: #111;
  font-size: 10px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dock-taso-pct {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.82);
  padding: 0 3px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* Enhanced Scoreboard Pile Thumbnails */
.player .stack span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-right: -6px;
  background: center / cover no-repeat;
  border: 1.8px solid var(--panel);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: transform 0.15s ease, z-index 0.15s;
}

.player .stack span:hover {
  transform: scale(1.4) translateY(-2px);
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}


