/* ----- TOKENS ----- */
:root {
  --bg-0: #0b1014;
  --bg-1: #11181f;
  --bg-2: #182431;
  --bg-3: #213743;
  --bg-4: #2a3f4f;
  --line: rgba(255,255,255,0.06);
  --line-strong: rgba(255,255,255,0.12);
  --text: #ffffff;
  --text-dim: #b1bad3;
  --text-mute: #6c7a8c;
  --green: #00e701;
  --green-d: #00b300;
  --yellow: #ffb800;
  --red: #ff4757;
  --pink: #ff3a8c;
  --blue: #1fb8ff;
  --purple: #8b5cf6;
  --gold: linear-gradient(135deg, #ffd966 0%, #f5a623 100%);
  --shadow-card: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-pop: 0 24px 60px rgba(0,0,0,0.55);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* ----- TÁCTIL / MÓVIL: sin zoom ni flash al tocar ----- */
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
button, a, label, .nav-item, .case-tile, .game-card, [role="button"] {
  touch-action: manipulation;
}
/* Default text color for buttons we style ourselves */
button { font-family: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
input { font-family: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* ----- SPLASH ----- */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  z-index: 9999;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.splash.hidden {
  opacity: 0;
  pointer-events: none;
}
.splash-video {
  max-width: 70vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  display: block;
  background: var(--bg-0);
}

/* ----- SPLASH ----- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-0);
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.7s ease-out;
  overflow: hidden;
}
.splash.fading {
  opacity: 0;
  pointer-events: none;
}
/* Subtle radial glow behind logo */
.splash::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 102, 0.18) 0%, rgba(245, 166, 35, 0.08) 30%, transparent 70%);
  filter: blur(40px);
  animation: splash-glow 3s ease-in-out infinite alternate;
}
@keyframes splash-glow {
  from { transform: scale(0.95); opacity: 0.8; }
  to { transform: scale(1.05); opacity: 1; }
}
.splash-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  z-index: 1;
}
.splash-logo-wrap {
  width: min(50vmin, 380px);
  height: min(50vmin, 380px);
  display: grid;
  place-items: center;
}
.splash-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  filter:
    url(#zulo-key)
    saturate(1.6)
    brightness(1.6)
    drop-shadow(0 0 24px rgba(255, 217, 102, 0.5))
    drop-shadow(0 0 60px rgba(245, 166, 35, 0.3));
}
.splash-tagline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: splash-fade-in 0.8s 0.4s forwards;
}
@keyframes splash-fade-in {
  to { opacity: 1; }
}
.splash-bar {
  width: 220px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.splash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, transparent, #ffd966 50%, transparent);
  background-size: 200% 100%;
  animation: splash-shimmer 1.5s linear infinite;
  width: 100%;
}
@keyframes splash-shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}
.splash-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--text-mute);
}

/* ----- APP LAYOUT ----- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: padding-right 0.25s ease;
}
.app.chat-open {
  padding-right: 320px;
}

/* ----- SIDEBAR ----- */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px 18px;
}
.logo-img {
  width: 64px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(255, 217, 102, 0.15));
}
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd966 0%, #f5a623 50%, #ff3a8c 100%);
  display: grid; place-items: center;
  font-weight: 800;
  color: #1a0a00;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.45);
}
.nav-section {
  margin-top: 10px;
}
.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  padding: 8px 10px 4px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active { background: var(--bg-3); color: var(--text); }
.nav-item.replay-intro {
  margin-top: 10px;
  color: var(--text-mute);
  border: 1px dashed var(--line);
  background: rgba(255, 217, 102, 0.04);
}
.nav-item.replay-intro:hover {
  background: rgba(255, 217, 102, 0.1);
  color: #ffd966;
  border-color: rgba(255, 217, 102, 0.3);
}
.nav-item .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }

/* ----- TOPBAR ----- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--text-dim);
}
.crumb-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
}
.crumb-back:hover { background: var(--bg-3); }
.balance-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 14px;
}
.balance-amount {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700;
  font-size: 15px;
}
.coin-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd966, #f5a623);
  display: grid; place-items: center;
  color: #4a2900; font-size: 10px; font-weight: 800;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
}
.btn-wallet {
  background: var(--green); color: #06321b;
  border: 0; padding: 8px 14px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px;
  margin-left: 4px;
}
.btn-wallet:hover { background: #1aff1a; }

.main {
  display: flex; flex-direction: column;
  min-width: 0;
}
.page {
  padding: 22px 24px 60px;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

/* ----- LOBBY ----- */
.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 32px;
}
.hero-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}
.hero-card h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-card p {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  max-width: 280px;
}
.hero-card .badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.25);
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  width: fit-content;
  backdrop-filter: blur(4px);
}
.hero-card .btn-cta {
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  width: fit-content;
  backdrop-filter: blur(8px);
}
.hero-card .btn-cta:hover { background: rgba(0,0,0,0.6); }
.hero-card.h1 { background: linear-gradient(120deg, #4a1d96 0%, #7c3aed 50%, #ec4899 100%); }
.hero-card.h2 { background: linear-gradient(135deg, #064e3b 0%, #00b300 100%); }
.hero-card.h3 { background: linear-gradient(135deg, #7a3700 0%, #f5a623 100%); }

.hero-art {
  position: absolute; right: -20px; bottom: -20px;
  width: 180px; height: 180px;
  opacity: 0.85;
  pointer-events: none;
}

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 28px 0 14px;
}
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; margin: 0;
}
.section-title .dot {
  width: 6px; height: 18px; border-radius: 3px;
  background: var(--green);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.game-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  background: var(--bg-2);
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.5);
}
.game-card .gc-art {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.game-card .gc-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex; justify-content: space-between; align-items: flex-end;
}
.gc-name {
  font-weight: 700; font-size: 14px;
}
.gc-tag {
  font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.gc-live {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  font-size: 10px; padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.gc-live .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ----- GAME PAGE ----- */
.game-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.bet-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: sticky;
  top: 78px;
}
.bet-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg-1);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.bet-tab {
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  font-weight: 600; font-size: 13px;
}
.bet-tab.active { background: var(--bg-3); color: var(--text); }

.field {
  margin-bottom: 14px;
}
.field-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}
.input-row {
  display: flex; align-items: stretch;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.input-row input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; color: var(--text);
  padding: 11px 12px;
  font-size: 14px; font-weight: 600;
  outline: none;
}
.input-row input:focus { outline: 0; }
.input-row .input-prefix {
  display: grid; place-items: center;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  font-size: 12px; color: var(--text-mute); font-weight: 600;
}
.input-row .input-btns {
  display: flex; align-items: stretch;
  border-left: 1px solid var(--line);
}
.input-row .input-btns button {
  background: transparent; border: 0; color: var(--text-dim);
  padding: 0 10px;
  font-size: 12px; font-weight: 600;
  border-left: 1px solid var(--line);
}
.input-row .input-btns button:first-child { border-left: 0; }
.input-row .input-btns button:hover { background: var(--bg-3); color: var(--text); }

.field-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}

select.select, .select-fake {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px; font-weight: 600;
  width: 100%;
  outline: none;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23b1bad3" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.btn-primary {
  width: 100%;
  background: var(--green);
  color: #06321b;
  border: 0;
  border-radius: var(--radius);
  padding: 14px;
  font-weight: 700; font-size: 15px;
  letter-spacing: 0.01em;
  transition: filter 0.15s, transform 0.05s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-primary:active:not(:disabled) { transform: scale(0.985); }
.btn-secondary {
  width: 100%;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  font-weight: 600; font-size: 14px;
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-4); }
.btn-danger {
  background: var(--red); color: #fff;
}

.game-stage {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  min-height: 560px;
  padding: 24px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stage-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.stage-title {
  font-size: 18px; font-weight: 700;
}
.stage-sub {
  font-size: 12px; color: var(--text-mute);
}

.history-strip {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}
.history-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.history-pill.win { color: var(--green); border-color: rgba(0,231,1,0.3); }
.history-pill.lose { color: var(--red); border-color: rgba(255,71,87,0.3); }

/* Result toast */
.result-toast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(11,16,20,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  padding: 22px 36px;
  border-radius: 14px;
  text-align: center;
  z-index: 50;
  pointer-events: none;
  animation: toast-in 0.25s ease-out;
}
.result-toast.win { border-color: rgba(0,231,1,0.5); box-shadow: 0 0 40px rgba(0,231,1,0.2); }
.result-toast.lose { border-color: rgba(255,71,87,0.4); }
.result-toast .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.result-toast .val { font-size: 32px; font-weight: 800; }
.result-toast.win .val { color: var(--green); }
.result-toast.lose .val { color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 10px)) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Generic util */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.flex-1 { flex: 1; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }

/* Toast notif */
.toast-stack {
  position: fixed;
  top: 80px;
  right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-card);
  animation: toast-in 0.2s ease-out;
  pointer-events: auto;
}
.toast.error { border-color: rgba(255,71,87,0.4); }
.toast.ok { border-color: rgba(0,231,1,0.4); }

/* Wallet modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 100;
  display: grid; place-items: center;
  animation: fade-in 0.15s;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 420px; max-width: 92vw;
  padding: 24px;
  box-shadow: var(--shadow-pop);
}
.modal h3 { margin: 0 0 6px; font-size: 20px; }
.modal p { margin: 0 0 16px; color: var(--text-dim); font-size: 14px; }
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent; border: 0; color: var(--text-mute);
  font-size: 20px;
}
.quick-amts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 14px 0;
}
.quick-amts button {
  background: var(--bg-1); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px;
  font-weight: 600;
}
.quick-amts button:hover { background: var(--bg-3); }

/* ----- CHAT PANEL ----- */
.chat-panel {
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: -10px 0 30px rgba(0,0,0,0.35);
}
.chat-panel.open {
  transform: translateX(0);
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-close {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  font-size: 22px;
  line-height: 1;
  padding: 0 6px;
  border-radius: 6px;
}
.chat-close:hover { background: var(--bg-3); color: var(--text); }
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-scroll::-webkit-scrollbar { width: 6px; }
.chat-scroll::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 6px; }
.chat-msg {
  display: flex;
  gap: 9px;
}
.chat-avatar-wrap {
  flex-shrink: 0;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}
.chat-avatar-wrap.has-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff3a8c, #ffd966, #00e701, #1fb8ff, #a78bfa, #ff3a8c);
  animation: spin 4s linear infinite;
  z-index: 0;
  padding: 2px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
.chat-avatar-wrap > * {
  position: relative;
  z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rainbow-flow { from { background-position: 0% 0; } to { background-position: 200% 0; } }

.vip-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ffd966, #f5a623);
  color: #3a1a00;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 1px 4px rgba(245, 166, 35, 0.4);
}
.role-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid;
  background: rgba(255,255,255,0.04);
}

.chat-avatar {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.chat-body { min-width: 0; flex: 1; }
.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 1px;
}
.chat-user {
  font-size: 12px;
  font-weight: 700;
}
.chat-time {
  font-size: 10px;
  color: var(--text-mute);
}
.chat-text {
  font-size: 13px;
  color: var(--text-dim);
  word-wrap: break-word;
  line-height: 1.35;
}
.chat-input-row {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.chat-name {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
  width: 100%;
}
.chat-name:focus { border-color: var(--green); color: var(--text); }
.chat-input-wrap {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.chat-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  outline: none;
  min-width: 0;
}
.chat-input:focus { border-color: var(--green); }
.chat-send {
  background: var(--green);
  color: #06321b;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.chat-send:hover:not(:disabled) { filter: brightness(1.1); }

.chat-toggle {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 8px;
  display: grid; place-items: center;
  cursor: pointer;
}
.chat-toggle:hover { background: var(--bg-3); }
.chat-toggle.open { background: var(--bg-3); color: var(--green); }
.chat-toggle-pulse {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
  animation: pulse 1.5s infinite;
}

@media (max-width: 1180px) {
  .game-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 12px; }
  .bet-panel { padding: 14px; }
}
@media (max-width: 920px) {
  .game-layout { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .game-layout { grid-template-columns: 1fr; }
  .bet-panel { position: static; max-width: none; }
}
@media (max-width: 1080px) {
  .app.chat-open { padding-right: 0; }
}
@media (max-width: 600px) {
  .chat-panel { width: 100vw; }
}
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  /* Sidebar -> barra de navegación horizontal con scroll (antes: display:none) */
  .sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    position: static;
    height: auto;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }
  .sidebar .logo { display: none; }
  .sidebar .nav-section {
    display: flex;
    flex-direction: row;
    gap: 6px;
    margin: 0;
  }
  .sidebar .nav-label { display: none; }
  .sidebar .nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 9px 13px;
    margin: 0;
  }
  .hero { grid-template-columns: 1fr; }
  .page { padding: 16px; }
}

/* ----- SHOP ----- */
.shop-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  background: linear-gradient(135deg, #2a1245 0%, #1a0a2a 50%, #0a1a35 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  align-items: center;
}
.shop-preview {
  background: rgba(0,0,0,0.4);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--line);
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.perk-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.perk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}
.perk-card.equipped {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 12px 28px rgba(0, 231, 1, 0.1);
}
.perk-card.gold {
  background: linear-gradient(160deg, #2a1a08 0%, var(--bg-2) 60%);
  border-color: rgba(255, 217, 102, 0.3);
}
.perk-card.gold.equipped {
  border-color: #ffd966;
  box-shadow: 0 0 0 1px #ffd966, 0 12px 28px rgba(245, 166, 35, 0.2);
}
.perk-preview {
  background: linear-gradient(135deg, #1a2030, #0e1419);
  padding: 24px 16px;
  display: grid;
  place-items: center;
  min-height: 110px;
  text-align: center;
}
.perk-body {
  padding: 14px 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perk-name {
  font-weight: 700;
  font-size: 15px;
}
.perk-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  min-height: 32px;
}
.perk-price {
  color: var(--green);
  font-weight: 700;
  font-size: 16px;
  margin-top: 4px;
}
.perk-actions {
  padding: 0 14px 14px;
}
.perk-actions .btn-primary, .perk-actions .btn-secondary {
  padding: 10px;
  font-size: 13px;
}
@media (max-width: 820px) {
  .shop-hero { grid-template-columns: 1fr; }
}

/* ===== CASES ===== */
.cases-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  background: linear-gradient(135deg, #1a0a35 0%, #2a0855 50%, #3a1a55 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  align-items: center;
}
.cases-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cases-tab {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cases-tab:hover { background: var(--bg-3); color: var(--text); }
.cases-tab.active {
  background: var(--bg-4);
  border-color: var(--green);
  color: var(--text);
}
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.case-tile {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 10px 10px;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}
.case-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, var(--accent, transparent) 0%, transparent 60%);
  opacity: 0.15;
  pointer-events: none;
}
.case-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent, var(--line-strong));
  box-shadow: 0 12px 30px rgba(0,0,0,0.5), 0 0 30px var(--accent, transparent);
}
.case-tile-art {
  position: relative;
  width: 100%;
  min-height: 100px;
  display: grid;
  place-items: center;
}
.case-tile-shape {
  width: 72px; height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 -6px 0 rgba(0,0,0,0.25),
    inset 0 2px 0 rgba(255,255,255,0.3),
    0 8px 18px rgba(0,0,0,0.4);
  position: relative;
  transition: transform 0.25s;
}
.case-tile-shape::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  border: 2px dashed rgba(255,255,255,0.25);
}
.case-tile:hover .case-tile-shape { transform: rotate(-4deg) scale(1.05); }
.case-tile-shape-inner {
  position: relative;
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  z-index: 1;
}
.case-tile-body {
  text-align: center;
  width: 100%;
}
.case-tile-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.case-tile-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

/* CASE DETAIL */
.case-detail-head {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 20px;
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.case-detail-head::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--accent, var(--green));
}
.case-detail-art {
  width: 140px; height: 140px;
  display: grid;
  place-items: center;
  border-radius: 16px;
}
.case-detail-info {
  min-width: 0;
}
.case-detail-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--green);
}
.case-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 220px;
}
.count-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: var(--bg-1);
  padding: 4px;
  border-radius: 8px;
}
.count-picker button {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}
.count-picker button.active {
  background: var(--bg-3);
  color: var(--text);
}

/* CASE OPENING REEL */
.case-open-stage {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.reel-frame {
  position: relative;
  height: 150px;
  background: var(--bg-0);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.reel-pointer {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--yellow), transparent);
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: 0 0 12px var(--yellow);
}
.reel-pointer::before, .reel-pointer::after {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}
.reel-pointer::before {
  top: 0;
  border-top: 10px solid var(--yellow);
}
.reel-pointer::after {
  bottom: 0;
  border-bottom: 10px solid var(--yellow);
}
.reel-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
.reel-track {
  display: flex;
  height: 100%;
  align-items: center;
  will-change: transform;
}
.reel-item {
  height: 130px;
  flex-shrink: 0;
  padding: 0 4px;
}

/* ITEM CARD */
.item-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--tier-color, var(--line));
  border-radius: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.item-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--tier-color);
}
.item-card.tier-legendary::after,
.item-card.tier-epic::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--tier-glow) 0%, transparent 70%);
  pointer-events: none;
}
.item-card.won {
  animation: item-win 0.6s ease-out;
  box-shadow: 0 0 30px var(--tier-color);
}
@keyframes item-win {
  0% { transform: scale(1); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.item-card-emoji {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  position: relative;
  z-index: 1;
}
.item-card-info {
  position: relative;
  z-index: 1;
  width: 100%;
}
.item-card-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}
.item-card-value {
  font-size: 12px;
  color: var(--tier-color);
  font-weight: 700;
}

/* REEL SUMMARY */
.reel-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--bg-1);
  border-radius: 12px;
  gap: 4px;
}
.reel-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
}
.reel-summary-value {
  font-size: 36px;
  font-weight: 800;
}
.reel-summary-value.win { color: var(--green); }
.reel-summary-value.lose { color: var(--red); }

/* ITEMS LISTING */
.case-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.item-listing {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--tier-color, var(--line));
  border-radius: 8px;
  padding: 10px 14px;
}
.item-listing-emoji {
  font-size: 28px;
  text-align: center;
}
.item-listing-name {
  font-size: 13px;
  font-weight: 600;
}
.item-listing-tier {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.item-listing-stats {
  text-align: right;
}
.item-listing-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}
.item-listing-prob {
  font-size: 11px;
  color: var(--text-mute);
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  margin: 0 -8px;
  padding: 0 8px;
}
.picker-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, var(--line));
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.picker-row:hover { background: var(--bg-3); }
.picker-row-emoji {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.25);
}
.picker-row-name {
  font-size: 14px;
  font-weight: 600;
}
.picker-row-meta {
  font-size: 11px;
  color: var(--text-mute);
}
.picker-row-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}

/* ===== BATTLES ===== */
.battle-builder {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 14px;
}
.bb-section { display: flex; flex-direction: column; gap: 10px; }
.bb-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  font-weight: 700;
}
.bb-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.bb-mode {
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.bb-mode:hover { background: var(--bg-3); }
.bb-mode.active {
  background: var(--bg-3);
  border-color: var(--green);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--green) inset;
}
.bb-mode-label { font-weight: 700; font-size: 16px; }
.bb-mode-slots { font-size: 11px; color: var(--text-mute); margin-top: 2px; }

.bb-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bb-case-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-1);
  border: 1px solid var(--accent, var(--line));
  border-left: 3px solid var(--accent, var(--line));
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.bb-case-chip:hover { background: var(--bg-3); }
.bb-case-chip-name {
  font-size: 13px;
  font-weight: 600;
}
.bb-case-chip-x {
  color: var(--text-mute);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  transition: color 0.15s;
}
.bb-case-chip:hover .bb-case-chip-x { color: var(--red); }
.bb-case-add {
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.bb-case-add:hover { background: var(--bg-3); color: var(--text); }
.bb-summary {
  background: var(--bg-1);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bb-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

/* BATTLE ARENA */
.battle-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.battle-round-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.battle-round-dot {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}
.battle-round-dot.active {
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 0 12px currentColor;
}
.battle-round-dot.done { opacity: 0.85; }

.battle-players {
  display: grid;
  gap: 12px;
}
.battle-players.slots-2 { grid-template-columns: 1fr 1fr; }
.battle-players.slots-3 { grid-template-columns: repeat(3, 1fr); }
.battle-players.slots-4 { grid-template-columns: repeat(4, 1fr); }
.battle-players.teams.slots-4 {
  grid-template-columns: 1fr 1fr 24px 1fr 1fr;
}
.battle-players.teams.slots-4::after {
  content: 'VS';
  grid-column: 3;
  grid-row: 1;
  display: grid;
  place-items: center;
  color: var(--yellow);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.battle-player {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.battle-player.self {
  border-color: rgba(255, 217, 102, 0.4);
  background: linear-gradient(180deg, rgba(255, 217, 102, 0.05), var(--bg-2));
}
.battle-player.waiting { opacity: 0.65; }
.battle-player-head {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
}
.battle-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 14px;
}
.battle-avatar.empty {
  background: var(--bg-3);
  border: 1px dashed var(--line-strong);
  color: var(--text-mute);
}
.battle-player-name {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bot-tag {
  font-size: 9px;
  background: var(--bg-3);
  color: var(--text-mute);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.battle-player-total {
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
}
.battle-reel-slot {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Vertical reel (for battles) */
.reel-frame-v {
  position: relative;
  width: 100%;
  height: 280px;
  background: var(--bg-0);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.reel-pointer-v {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  transform: translateY(-50%);
  z-index: 2;
  box-shadow: 0 0 12px var(--yellow);
}
.reel-pointer-v::before, .reel-pointer-v::after {
  content: '';
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}
.reel-pointer-v::before {
  left: 0;
  border-left: 10px solid var(--yellow);
}
.reel-pointer-v::after {
  right: 0;
  border-right: 10px solid var(--yellow);
}
.reel-mask-v {
  position: absolute;
  inset: 0;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}
.reel-track-v {
  display: flex;
  flex-direction: column;
  width: 100%;
  will-change: transform;
}
.reel-item-v {
  width: 100%;
  flex-shrink: 0;
  padding: 4px 8px;
}
.reel-item-v .item-card {
  flex-direction: row;
  gap: 10px;
  padding: 8px 12px;
  text-align: left;
  align-items: center;
}
.reel-item-v .item-card-emoji { font-size: 28px; }
.reel-item-v .item-card-info { width: auto; flex: 1; min-width: 0; }
.reel-item-v .item-card-name { font-size: 12px; }
.reel-item-v .item-card-value { font-size: 12px; }
.battle-waiting-state {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 13px;
}
.battle-final-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  padding: 4px 0;
}
.battle-final-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border: 1px solid;
  border-radius: 8px;
  background: var(--bg-1);
}
.battle-final-item .mono {
  font-size: 11px;
}
.battle-result {
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  margin-top: 16px;
}
.battle-result-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.battle-result-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--green);
}

@media (max-width: 1100px) {
  .battle-players.slots-3,
  .battle-players.slots-4 { grid-template-columns: 1fr 1fr; }
  .battle-players.teams.slots-4 { grid-template-columns: 1fr 1fr; }
  .battle-players.teams.slots-4::after { display: none; }
}
/* ===== AUTH ===== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: var(--bg-0);
}
.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 217, 102, 0.08), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(245, 166, 35, 0.06), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(124, 58, 237, 0.06), transparent 70%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 32px 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
}
.auth-logo {
  width: 56px;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(255, 217, 102, 0.25));
  margin-bottom: 4px;
}
.auth-brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.auth-brand-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--text-mute);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-1);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 10px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active {
  background: var(--bg-3);
  color: var(--text);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.auth-hint {
  font-size: 10px;
  color: var(--text-mute);
  font-weight: 500;
}
.auth-field input {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s;
}
.auth-field input:focus {
  border-color: var(--green);
}
.auth-err {
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: #ff8590;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}
.auth-switch button {
  background: transparent;
  border: 0;
  color: var(--green);
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
}
.auth-switch button:hover { text-decoration: underline; }

/* ===== USER CHIP (TOPBAR) ===== */
.user-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 12px;
}
.user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.user-chip-logout {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.user-chip-logout:hover {
  color: var(--red);
  background: var(--bg-3);
}

/* ===== ADMIN ===== */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.admin-row.used { opacity: 0.6; }
.admin-code {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.admin-row-actions {
  display: flex;
  gap: 6px;
}
@media (max-width: 700px) {
  .admin-row { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .battle-players.slots-2,
  .battle-players.slots-3,
  .battle-players.slots-4 { grid-template-columns: 1fr; }
  .case-detail-head { grid-template-columns: 1fr; text-align: center; }
  .case-detail-art { margin: 0 auto; }
}
