:root {
  --bg: #070818;
  --panel: rgba(20, 22, 52, 0.72);
  --panel-border: rgba(130, 140, 255, 0.18);
  --text: #e8ebff;
  --muted: #8d93c4;
  --cyan: #6fe3ff;
  --violet: #9a7bff;
  --gold: #ffd36e;
  --green: #5cf2a6;
  --red: #ff6b8b;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: radial-gradient(ellipse at 20% 0%, #1b1650 0%, transparent 55%),
              radial-gradient(ellipse at 90% 100%, #0f2f55 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  user-select: none;
}

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
#gem:focus-visible { outline: none; }

h1, h2 { font-family: 'Orbitron', sans-serif; margin: 0; letter-spacing: .04em; }
h2 { font-size: 15px; text-transform: uppercase; color: var(--cyan); }

.muted { color: var(--muted); font-size: 13px; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px 24px;
  background: linear-gradient(to bottom, rgba(7, 8, 24, .95), rgba(7, 8, 24, .6));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--panel-border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 20px; background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo { font-size: 26px; color: var(--gold); text-shadow: 0 0 12px var(--gold); animation: spin 12s linear infinite; display: inline-block; }

.resource { text-align: center; }
.res-amount { font-family: 'Orbitron', sans-serif; font-size: 34px; font-weight: 800; display: flex; align-items: center; gap: 10px; justify-content: center; text-shadow: 0 0 18px rgba(111, 227, 255, .45); }
.gem-mini { width: 22px; height: 26px; background: linear-gradient(135deg, #b8f6ff, #4fb6ff 50%, #3b2fb8); clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%); filter: drop-shadow(0 0 6px var(--cyan)); }
.res-rate { color: var(--green); font-weight: 600; font-size: 14px; }

.top-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ghost { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--panel-border); background: rgba(255, 255, 255, .04); font-size: 13px; transition: background .2s; }
.ghost:hover { background: rgba(255, 255, 255, .1); }
.ghost.danger:hover { background: rgba(255, 107, 139, .2); border-color: var(--red); }

/* ---------- Layout ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 340px 1fr 340px; gap: 18px;
  padding: 18px 24px 40px; max-width: 1400px; margin: 0 auto;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }

/* ---------- Cristal ---------- */
.mine-panel { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gem-wrap { position: relative; width: 260px; height: 280px; display: grid; place-items: center; margin-top: 6px; }
.gem-glow { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(111, 227, 255, .55), rgba(154, 123, 255, .2) 50%, transparent 70%); filter: blur(10px); animation: pulse 3s ease-in-out infinite; }
.orbit { position: absolute; inset: 0; animation: spin 14s linear infinite; }
.orbit i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.orbit i:nth-child(1) { top: 6%; left: 50%; }
.orbit i:nth-child(2) { bottom: 14%; left: 10%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.orbit i:nth-child(3) { bottom: 22%; right: 6%; background: var(--violet); box-shadow: 0 0 10px var(--violet); }

#gem { position: relative; width: 190px; height: 210px; transition: transform .08s; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 0 22px rgba(111, 227, 255, .55)); }
#gem svg { width: 100%; height: 100%; }
#gem:hover { filter: drop-shadow(0 0 32px rgba(111, 227, 255, .85)); }
#gem.hit { transform: scale(.92); }

.click-info { margin-top: 8px; font-size: 15px; }
.click-info strong { color: var(--gold); font-family: 'Orbitron', sans-serif; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
kbd { background: rgba(255, 255, 255, .08); border: 1px solid var(--panel-border); border-radius: 5px; padding: 1px 6px; font-size: 11px; }

.stats { margin-top: 20px; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats div { background: rgba(255, 255, 255, .03); border: 1px solid var(--panel-border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stats strong { font-family: 'Orbitron', sans-serif; font-size: 15px; }

/* ---------- Modos de compra ---------- */
.modes { display: flex; background: rgba(0, 0, 0, .3); border-radius: 10px; padding: 3px; }
.modes button { padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.modes button.active { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #0b0c22; }

/* ---------- Generadores ---------- */
.gens { display: flex; flex-direction: column; gap: 10px; }
.gen {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 14px; text-align: left; width: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid var(--panel-border);
  transition: transform .12s, border-color .2s, box-shadow .2s, opacity .2s;
}
.gen:hover:not(.locked) { transform: translateY(-2px); }
.gen.can { border-color: rgba(92, 242, 166, .55); box-shadow: 0 0 18px rgba(92, 242, 166, .12); }
.gen.cant { opacity: .72; }
.gen.locked { opacity: .35; cursor: default; filter: grayscale(1); }
.gen.bought { animation: pop .3s; }
.gen .icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 30% 30%, rgba(111, 227, 255, .3), rgba(154, 123, 255, .15)); }
.gen .name { font-weight: 700; font-size: 15px; }
.gen .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.gen .bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .07); margin-top: 8px; overflow: hidden; }
.gen .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .15s; }
.gen .right { text-align: right; }
.gen .owned { font-family: 'Orbitron', sans-serif; font-size: 26px; font-weight: 800; color: var(--text); }
.gen .cost { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.gen.cant .cost { color: var(--muted); }

/* ---------- Mejoras ---------- */
.side { display: flex; flex-direction: column; }
.ups { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 330px; overflow-y: auto; padding-right: 4px; }
.ups:empty::after { content: 'Compra más generadores para desbloquear mejoras.'; color: var(--muted); font-size: 13px; grid-column: 1 / -1; }
.up {
  padding: 10px; border-radius: 12px; text-align: left;
  border: 1px solid var(--panel-border); background: rgba(255, 255, 255, .03);
  display: flex; flex-direction: column; gap: 4px; transition: transform .12s, border-color .2s;
}
.up:hover { transform: translateY(-2px); }
.up .u-icon { font-size: 20px; }
.up .u-name { font-size: 12px; font-weight: 700; line-height: 1.25; }
.up .u-desc { font-size: 11px; color: var(--muted); }
.up .u-cost { font-size: 12px; font-weight: 700; color: var(--gold); }
.up.can { border-color: rgba(255, 211, 110, .6); box-shadow: 0 0 14px rgba(255, 211, 110, .15); }
.up.cant { opacity: .55; }
.up.cant .u-cost { color: var(--muted); }

/* ---------- Renacimiento ---------- */
.prestige { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--panel-border); }
.prestige h2 { color: var(--violet); margin-bottom: 8px; }
.prestige p { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0 0 12px; }
.prestige b { color: var(--text); }
.req-box { display: grid; gap: 6px; margin-bottom: 12px; }
.req-box div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(154, 123, 255, .08); border: 1px solid rgba(154, 123, 255, .2); font-size: 12px; color: var(--muted); }
.req-box strong { font-family: 'Orbitron', sans-serif; color: var(--violet); font-size: 14px; }
.req-box div:last-child strong { color: var(--muted); font-size: 12px; }
.shards { font-family: 'Orbitron', sans-serif; font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.shard-icon { color: var(--violet); text-shadow: 0 0 10px var(--violet); font-size: 22px; }
.prog { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-bottom: 12px; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), #ff7bd5); transition: width .3s; }
.rebirth {
  width: 100%; padding: 12px; border-radius: 12px; font-weight: 700; font-family: 'Orbitron', sans-serif; letter-spacing: .05em;
  background: linear-gradient(135deg, var(--violet), #ff7bd5); color: #12082a;
  box-shadow: 0 0 22px rgba(154, 123, 255, .4); transition: transform .12s, opacity .2s;
}
.rebirth:hover:not(:disabled) { transform: translateY(-2px); }
.rebirth:disabled { opacity: .35; cursor: default; box-shadow: none; }
.rebirth.confirm { background: linear-gradient(135deg, #ff6b8b, #ffb36b); }

/* ---------- Efectos ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.float-num { position: absolute; font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 20px; color: var(--gold); text-shadow: 0 0 10px rgba(255, 211, 110, .8); animation: rise 1s ease-out forwards; transform: translate(-50%, -50%); }
.spark { position: absolute; width: 7px; height: 7px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: spark .7s ease-out forwards; }

#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: rgba(20, 22, 52, .95); border: 1px solid var(--panel-border); border-left: 4px solid var(--cyan); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); animation: toastIn .3s ease-out; max-width: 340px; }
.toast.gold { border-left-color: var(--gold); }
.toast.violet { border-left-color: var(--violet); }
.toast.out { animation: toastOut .4s forwards; }

/* ---------- Animaciones ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes rise { to { transform: translate(-50%, -140%); opacity: 0; } }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(180deg); opacity: 0; } }
@keyframes pop { 50% { transform: scale(1.03); } }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(40px); opacity: 0; } }

/* ---------- Usuario ---------- */
.user-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: rgba(92, 242, 166, .1); border: 1px solid rgba(92, 242, 166, .35); font-size: 13px; font-weight: 700; }
.user-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.ghost.gold { border-color: rgba(255, 211, 110, .5); color: var(--gold); }
.ghost.gold:hover { background: rgba(255, 211, 110, .12); }
.ghost.wide { width: 100%; margin-top: 10px; padding: 10px; }
.top-actions { flex-wrap: wrap; align-items: center; }

.save-status { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--panel-border); background: rgba(255, 255, 255, .03); cursor: help; }
.save-status .sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.save-status.pulse .sdot { animation: savePulse .6s ease-out; }
.save-status.err { color: var(--red); border-color: rgba(255, 107, 139, .5); }
.save-status.err .sdot { background: var(--red); box-shadow: 0 0 6px var(--red); animation: savePulse 1s infinite; }
@keyframes savePulse { 0% { transform: scale(1.9); } 100% { transform: scale(1); } }

/* ---------- Superposiciones ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; background: rgba(5, 6, 20, .75); backdrop-filter: blur(6px); }
.overlay.hidden { display: none; }
body.locked .topbar, body.locked .layout { filter: blur(4px); pointer-events: none; }

.auth-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 20px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: toastIn .4s ease-out; }
.auth-logo { font-size: 44px; color: var(--gold); text-shadow: 0 0 18px var(--gold); animation: spin 12s linear infinite; display: inline-block; }
.auth-card h1 { font-size: 24px; margin: 6px 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card p { margin: 0 0 18px; }
.auth-tabs { display: flex; background: rgba(0, 0, 0, .3); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button { flex: 1; padding: 8px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.auth-tabs button.active { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #0b0c22; }
.auth-card label { display: block; text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.auth-card input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--panel-border); background: rgba(0, 0, 0, .35); color: var(--text); font: inherit; font-size: 15px; user-select: text; }
.auth-card input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(111, 227, 255, .15); }
.auth-error { min-height: 20px; color: var(--red); font-size: 13px; margin-bottom: 8px; }

.board-card { width: min(1150px, 100%); max-height: 90vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 20px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: toastIn .3s ease-out; }
.board-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.board-head h2 { font-size: 18px; color: var(--gold); }
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--panel-border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
th { position: sticky; top: 0; background: #15173a; text-align: right; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
td { padding: 10px 12px; text-align: right; border-top: 1px solid rgba(130, 140, 255, .1); font-variant-numeric: tabular-nums; }
th:nth-child(-n+2), td:nth-child(-n+2) { text-align: left; }
td.rank { font-family: 'Orbitron', sans-serif; font-weight: 800; width: 40px; }
td.player { font-weight: 700; }
td.score { font-family: 'Orbitron', sans-serif; font-weight: 800; color: var(--gold); }
td.rate { color: var(--green); font-weight: 600; }
tr.me td { background: rgba(111, 227, 255, .08); }
tr.me td.player::after { content: ' (tú)'; color: var(--cyan); font-weight: 400; }
tr.top1 td.rank { color: var(--gold); }
.status { font-size: 12px; color: var(--muted); }
.status.on { color: var(--green); }
.status.on::before { content: '● '; }
.small { font-size: 12px; margin: 10px 0 0; }

/* ---------- Anti-trampas ---------- */
#gem.blocked { filter: grayscale(.9) drop-shadow(0 0 12px rgba(255, 107, 139, .5)); animation: none; }
.penalty { color: var(--red); font-weight: 700; }
.float-num.blocked { color: var(--red); font-size: 16px; text-shadow: 0 0 10px rgba(255, 107, 139, .7); }
.toast.red { border-left-color: var(--red); }
.flag { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 107, 139, .15); color: var(--red); cursor: help; }

/* ---------- Casino ---------- */
.casino-btn { border-color: rgba(255, 123, 213, .5); color: #ff9be0; }
.casino-btn:hover { background: rgba(255, 123, 213, .12); }
.casino-card { width: min(980px, 100%); max-height: 94vh; overflow-y: auto; background: radial-gradient(ellipse at top, #241a4d, var(--panel) 60%); border: 1px solid rgba(255, 123, 213, .3); border-radius: 20px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 40px rgba(255, 123, 213, .1); animation: toastIn .3s ease-out; }
.casino-title { font-size: 18px; background: linear-gradient(90deg, var(--gold), #ff7bd5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.casino-bal { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 18px; color: var(--gold); margin-left: auto; }
.casino-tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, .3); border-radius: 12px; padding: 4px; margin-bottom: 14px; overflow-x: auto; }
.casino-tabs button { flex: 1; padding: 9px 12px; border-radius: 9px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.casino-tabs button.active { background: linear-gradient(135deg, var(--gold), #ff7bd5); color: #1a0b2a; }
.casino-game.hidden { display: none; }
.center { text-align: center; }

.bet-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bet-label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bet-label input { width: 180px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 211, 110, .4); background: rgba(0, 0, 0, .35); color: var(--gold); font: inherit; font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 16px; user-select: text; }
.bet-label input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 211, 110, .15); }
.bet-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.bet-quick button { padding: 9px 12px; border-radius: 9px; border: 1px solid var(--panel-border); background: rgba(255, 255, 255, .04); font-size: 13px; font-weight: 700; }
.bet-quick button:hover { background: rgba(255, 211, 110, .12); border-color: rgba(255, 211, 110, .5); }

.casino-card button:disabled { opacity: .4; cursor: default; }
.ghost.big { padding: 12px 18px; font-size: 14px; font-weight: 700; }
.casino-msg { min-height: 34px; margin: 14px 0 4px; text-align: center; font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 18px; }
.casino-msg.win { color: var(--green); text-shadow: 0 0 14px rgba(92, 242, 166, .5); animation: pop .4s; }
.casino-msg.lose { color: var(--red); }
.casino-msg.push { color: var(--muted); }
.casino-msg.err { color: var(--red); font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; }

/* Ruleta */
.roulette-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: center; }
.roulette-wrap { position: relative; width: 300px; height: 300px; }
.wheel { position: absolute; inset: 0; border-radius: 50%; border: 8px solid #6b4a1f; box-shadow: 0 0 0 3px var(--gold), 0 0 40px rgba(255, 211, 110, .25), inset 0 0 30px rgba(0, 0, 0, .6); transition: transform 4.2s cubic-bezier(.12, .7, .15, 1); }
.wheel span { position: absolute; left: 50%; top: 50%; width: 22px; margin-left: -11px; text-align: center; font-size: 11px; font-weight: 800; color: #fff; transform-origin: 50% 0; }
.wheel-center { position: absolute; inset: 30%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #4a3a8a, #120c2e); border: 3px solid var(--gold); display: grid; place-items: center; font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 34px; box-shadow: 0 0 20px rgba(0, 0, 0, .6); z-index: 2; }
.wheel-center.rojo { color: #ff5a6e; } .wheel-center.negro { color: #e8ebff; } .wheel-center.verde { color: #36e08f; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; margin-left: -11px; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 22px solid var(--gold); filter: drop-shadow(0 0 6px var(--gold)); z-index: 3; }
.roulette-bets { display: flex; flex-direction: column; gap: 8px; }
.rb-row { display: flex; gap: 6px; flex-wrap: wrap; }
.rb { flex: 1; padding: 9px 8px; border-radius: 9px; border: 1px solid var(--panel-border); background: rgba(255, 255, 255, .04); font-weight: 700; font-size: 13px; white-space: nowrap; }
.rb small { color: var(--muted); font-weight: 600; }
.rb.red { background: rgba(214, 40, 70, .35); } .rb.black { background: rgba(0, 0, 0, .5); }
.rb.active, .num.active { outline: 2px solid var(--gold); outline-offset: 1px; box-shadow: 0 0 14px rgba(255, 211, 110, .4); }
.num-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.num { padding: 6px 0; border-radius: 5px; font-size: 12px; font-weight: 700; }
.num.rojo { background: #b3243c; } .num.negro { background: #1a1a2e; border: 1px solid #333652; } .num.verde { background: #18834f; grid-row: span 1; }
.rl-sel { font-size: 13px; color: var(--muted); }
.rl-sel b { color: var(--gold); }
.history { display: flex; gap: 4px; flex-wrap: wrap; min-height: 26px; }
.history span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.history .rojo { background: #b3243c; } .history .negro { background: #1a1a2e; border: 1px solid #333652; } .history .verde { background: #18834f; }

/* Blackjack */
.bj-table { background: radial-gradient(ellipse at center, #17663f, #0b3a24); border: 6px solid #5a3b17; border-radius: 120px / 60px; padding: 22px 20px; min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 10px; box-shadow: inset 0 0 40px rgba(0, 0, 0, .5); }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bj-label { font-weight: 700; font-size: 13px; color: rgba(255, 255, 255, .85); }
.bj-val { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 10px; background: rgba(0, 0, 0, .4); font-family: 'Orbitron', sans-serif; color: var(--gold); }
.bj-msg { font-family: 'Orbitron', sans-serif; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); text-align: center; }
.cards { display: flex; gap: 8px; min-height: 98px; }
.card-p { width: 66px; height: 96px; border-radius: 8px; background: #fdfdfd; color: #15172b; display: flex; flex-direction: column; justify-content: space-between; padding: 5px 7px; font-weight: 800; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); animation: dealIn .35s ease-out; }
.card-p .c-mid { font-size: 30px; text-align: center; line-height: 1; }
.card-p .c-bot { transform: rotate(180deg); }
.card-p.red { color: #c8102e; }
.card-p.back { background: repeating-linear-gradient(45deg, #3b2fb8, #3b2fb8 6px, #5a4be0 6px, #5a4be0 12px); border: 3px solid #fff; }
.bj-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.bj-actions .rebirth { width: auto; padding: 12px 26px; }
@keyframes dealIn { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } }

/* Cara o cruz */
.coin-stage { perspective: 800px; display: grid; place-items: center; padding: 20px 0; }
.coin { position: relative; width: 170px; height: 170px; transform-style: preserve-3d; transition: transform 2s cubic-bezier(.2, .8, .2, 1); }
.coin .face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-family: 'Orbitron', sans-serif; font-weight: 800; color: #5a3b00; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffd36e 45%, #c08a1a); border: 6px solid #e0a83a; box-shadow: inset 0 0 18px rgba(120, 70, 0, .5), 0 0 30px rgba(255, 211, 110, .35); }
.coin .face span { font-size: 54px; }
.coin .back { transform: rotateY(180deg); }
.coin-actions { display: flex; gap: 12px; justify-content: center; }
.coin-actions .rebirth { width: auto; padding: 14px 30px; font-size: 16px; }

/* Tragaperras */
.slot-machine { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px; border-radius: 20px; background: linear-gradient(180deg, #3a1a5e, #1c0f36); border: 3px solid var(--gold); box-shadow: 0 0 30px rgba(255, 211, 110, .2); max-width: 420px; margin: 0 auto; }
.reels { display: flex; gap: 10px; }
.reel { width: 96px; height: 110px; border-radius: 12px; background: linear-gradient(180deg, #ddd, #fff 30%, #fff 70%, #ddd); display: grid; place-items: center; font-size: 56px; box-shadow: inset 0 0 14px rgba(0, 0, 0, .35); }
.reel.spinning { animation: reelBlur .1s linear infinite; }
.reel.hit { box-shadow: inset 0 0 14px rgba(0, 0, 0, .35), 0 0 22px var(--gold); }
.slot-machine .rebirth { width: auto; padding: 12px 30px; }
.paytable { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; font-size: 14px; text-align: center; }
.paytable div { padding: 6px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--panel-border); }
.paytable b { color: var(--gold); }
@keyframes reelBlur { 50% { transform: translateY(-4px); filter: blur(1.5px); } }

td.cas-pos { color: var(--green); } td.cas-neg { color: var(--red); }

/* Clasificación del casino */
.board-tabs { max-width: 360px; }
.board-view.hidden { display: none; }
.board-view { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.cas-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.cas-summary div { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--panel-border); display: flex; flex-direction: column; gap: 3px; }
.cas-summary span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cas-summary strong { font-family: 'Orbitron', sans-serif; font-size: 16px; }
.cas-summary .pos { color: var(--green); } .cas-summary .neg { color: var(--red); }
.cas-table th[data-sort] { cursor: pointer; user-select: none; }
.cas-table th[data-sort]:hover { color: var(--text); }
.cas-table th.sorted { color: var(--gold); }
.cas-table th.sorted::after { content: ' ▼'; font-size: 9px; }
.cas-table th.sorted.asc::after { content: ' ▲'; }
td.net { font-family: 'Orbitron', sans-serif; font-weight: 800; }
td.won { color: var(--green); } td.lost { color: var(--red); }
.winbar { display: inline-block; width: 46px; height: 6px; border-radius: 3px; background: rgba(255, 107, 139, .45); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.winbar i { display: block; height: 100%; background: var(--green); }

@media (max-width: 760px) {
  .casino-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .casino-card { padding: 14px; }
  .roulette-layout { grid-template-columns: 1fr; justify-items: center; }
  .roulette-bets { width: 100%; }
  .num-grid { grid-template-columns: repeat(7, 1fr); }
  .reel { width: 78px; height: 92px; font-size: 44px; }
  .card-p { width: 54px; height: 80px; }
  .card-p .c-mid { font-size: 24px; }
  .casino-bal { font-size: 15px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr 1fr; }
  .mine-panel { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; padding: 12px 16px 30px; }
  .topbar { grid-template-columns: 1fr; gap: 8px; padding: 10px 16px; }
  .brand { display: none; }
  .res-amount { font-size: 26px; }
  .top-actions { justify-content: center; gap: 6px; }
  .ghost { padding: 6px 10px; font-size: 12px; }
  .user-chip { padding: 5px 10px; font-size: 12px; }
  .gem-wrap { transform: scale(.85); margin: -20px 0; }
}
