/* Casino's World DX */
:root {
  --bg: #07160e;
  --bg2: #0d2318;
  --panel: #10281c;
  --panel2: #163626;
  --line: #2a4a38;
  --text: #f1f5ee;
  --muted: #9fb5a7;
  --gold: #e6c766;
  --gold2: #b8902f;
  --felt: #0f6b35;
  --felt-dark: #073d1d;
  --title: #dcf37e;          /* verde claro tirando a amarillo */
  --red: #c4161c;
  --win: #7be08f;
  --lose: #ff7b7b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at top, #12331f 0%, var(--bg) 60%) fixed, var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--gold); }
button { font: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); background: #0a1d13; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold2); border-color: transparent; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(5, 17, 10, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.logo { font-family: 'Cinzel Decorative', Georgia, serif; font-weight: 900; font-size: 1.35rem; color: var(--gold); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--title); }
.logo small { font-family: Inter, sans-serif; font-size: .7rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav button, .nav a {
  background: none; border: 0; color: var(--muted); padding: 8px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; font-weight: 600;
}
.nav button:hover, .nav a:hover { color: var(--text); background: var(--panel); }
.nav .active { color: #10200f; background: var(--gold); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wallet { display: flex; align-items: center; gap: 6px; background: var(--panel); padding: 4px 12px 4px 6px; border-radius: 999px; border: 1px solid var(--line); }
.wallet strong { color: var(--gold); }
.uname { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.role { font-size: .65rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: #345; letter-spacing: .05em; }
.role.admin { background: var(--red); }
.role.staff { background: #2c6bd6; }
.role.user { background: #445; }
.net-dot { width: 9px; height: 9px; border-radius: 50%; background: #c33; display: inline-block; margin-right: 6px; vertical-align: middle; }
.net-dot.on { background: #3c6; box-shadow: 0 0 6px #3c6; }

/* ---------- botones ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 10px 16px; border-radius: 10px;
  cursor: pointer; font-weight: 600; transition: transform .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, #f2d67c, var(--gold2)); color: #1d1503; border-color: #8a6a1d; }
.btn.danger { background: #8e1b1b; border-color: #b33; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.wide { width: 100%; }

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; }
.page h2 { font-family: 'Cinzel Decorative', Georgia, serif; color: var(--gold); margin-top: 0; }
.page.narrow, .narrow { max-width: 460px; margin-inline: auto; }
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-box h4 { margin: 0 0 10px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; border-top: 1px solid var(--line); }

/* ---------- lobby ---------- */
.hero { text-align: center; padding: 30px 10px 20px; }
.hero h1 { font-family: 'Cinzel Decorative', Georgia, serif; font-size: clamp(2rem, 6vw, 3.6rem); margin: 0; color: var(--gold); text-shadow: 0 3px 0 #5a4210, 0 0 30px rgba(230, 199, 102, .35); }
.hero h1 span { color: var(--title); }
.hero p { color: var(--muted); max-width: 640px; margin: 10px auto 18px; }
.hero-chips { display: flex; gap: 10px; justify-content: center; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 10px; }
.game-card {
  border-radius: 18px; padding: 22px; border: 1px solid #2e5a40; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #1a7a42 0%, #0b4424 70%);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .18), 0 10px 30px rgba(0, 0, 0, .35);
}
.game-card.gc-poker { background: radial-gradient(ellipse at 50% 0%, #1b6d55 0%, #083a2e 70%); }
.game-card.gc-roulette { background: radial-gradient(ellipse at 50% 0%, #217a3a 0%, #0a3b1c 70%); }
.gc-icon { font-size: 2.8rem; color: var(--gold); line-height: 1; }
.game-card h3 { font-family: 'Cinzel Decorative', Georgia, serif; color: var(--title); font-size: 1.4rem; margin: 10px 0 6px; }
.game-card p { color: #cfe3d4; min-height: 3em; }
.gc-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.gc-online { margin-top: 10px; font-size: .8rem; color: var(--title); min-height: 1em; }
.how { margin-top: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px 14px; }
.how h3 { color: var(--gold); }
.how li { margin: 6px 0; color: #d5e4da; }

/* ---------- fichas ---------- */
.chip {
  --c: #ddd; --t: #111;
  width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-weight: 800; font-size: .85rem; color: var(--t); cursor: default; user-select: none;
  background:
    radial-gradient(circle, var(--c) 0 52%, transparent 53%),
    repeating-conic-gradient(var(--c) 0 22.5deg, #fff 22.5deg 45deg);
  border: 2px solid rgba(0, 0, 0, .35);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .15), 0 3px 0 rgba(0, 0, 0, .45);
}
.chip.c5 { --c: #c4161c; --t: #fff; }
.chip.c10 { --c: #1e5bd6; --t: #fff; }
.chip.c25 { --c: #128a3c; --t: #fff; }
.chip.c50 { --c: #ef7d14; --t: #1a0c00; }
.chip.c100 { --c: #161616; --t: #e6c766; }
.chip.mini { width: 22px; height: 22px; font-size: 0; border-width: 1px; box-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.chip-picker { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip-picker .chip { cursor: pointer; transition: transform .12s; }
.chip-picker .chip:hover { transform: translateY(-3px); }
.chip-picker .chip.selected { transform: translateY(-6px) scale(1.08); outline: 3px solid var(--gold); outline-offset: 2px; }
.stack { display: inline-flex; align-items: center; gap: 6px; }
.stack-chips { display: inline-flex; }
.stack-chips .chip { margin-left: -12px; }
.stack-chips .chip:first-child { margin-left: 0; }
.stack b { color: var(--gold); }

/* ---------- mesa ---------- */
.game { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 1100px) { .game:has(.room-chat) { grid-template-columns: 1fr 270px; } }
.felt {
  position: relative; border-radius: 28px; padding: 16px 18px 18px; min-height: 520px;
  background: radial-gradient(ellipse at 50% 30%, #18914a 0%, var(--felt) 45%, var(--felt-dark) 100%);
  background-size: cover; background-position: center;
  border: 12px solid #4a2a12; box-shadow: inset 0 0 0 3px #c9a646, inset 0 0 60px rgba(0, 0, 0, .55), 0 18px 40px rgba(0, 0, 0, .5);
}
.table-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-name { font-weight: 700; color: #e9f3ea; display: flex; align-items: center; gap: 8px; }
.mode-tag { font-size: .65rem; padding: 2px 7px; border-radius: 6px; font-weight: 800; letter-spacing: .06em; }
.mode-tag.online { background: #2c6bd6; }
.mode-tag.offline { background: #555; }
.countdown { margin-left: auto; font-weight: 700; color: var(--title); font-variant-numeric: tabular-nums; }
.countdown.urgent { color: #ffb4a8; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.table-title {
  font-family: 'Cinzel Decorative', Georgia, serif; font-weight: 900; text-align: center; margin: 4px 0 6px;
  font-size: clamp(1.6rem, 4.5vw, 2.8rem); color: var(--title); letter-spacing: .04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 22px rgba(220, 243, 126, .35);
}
.dealer-zone { text-align: center; }
.label { font-weight: 700; color: #e9f3ea; display: flex; justify-content: center; gap: 8px; align-items: center; margin-bottom: 6px; }
.total { background: rgba(0, 0, 0, .45); border-radius: 999px; padding: 1px 9px; font-weight: 800; color: var(--title); font-size: .9rem; }
.rule-line { font-size: .75rem; color: rgba(255, 255, 255, .6); letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; }
.community { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

.cards { display: flex; justify-content: center; gap: 6px; min-height: 92px; flex-wrap: wrap; }
.card {
  width: 64px; height: 90px; border-radius: 8px; background: #fbfbf7; color: #111; position: relative; flex: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45); animation: deal .35s ease-out both; overflow: hidden;
}
.card.red { color: #c4161c; }
.card .corner { position: absolute; font-weight: 800; font-size: .85rem; line-height: .95; text-align: center; z-index: 1; }
.card .tl { top: 5px; left: 6px; }
.card .br { bottom: 5px; right: 6px; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; z-index: 1; }
.card-mark { position: absolute; inset: 22px 14px; background-size: cover; background-position: center; opacity: .16; border-radius: 4px; }
.card.slot { background: rgba(255, 255, 255, .06); border: 2px dashed rgba(255, 255, 255, .25); box-shadow: none; animation: none; }
.card.back {
  background: repeating-linear-gradient(45deg, #b3121b 0 6px, #8a0d14 6px 12px);
  border: 4px solid #fff; background-size: cover; background-position: center;
}
.card.no-anim { animation: none; }
@keyframes deal { from { transform: translateY(-40px) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

.seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 18px 0 14px; }
.seat { background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 10px; text-align: center; min-height: 110px; }
.seat.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.seat.turn { box-shadow: 0 0 0 3px var(--title), 0 0 22px rgba(220, 243, 126, .4); }
.seat.idle { opacity: .85; }
.seat.empty { display: grid; place-items: center; color: rgba(255, 255, 255, .35); border-style: dashed; }
.seat-name { font-weight: 700; margin-bottom: 6px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.seat-bet { margin: 6px 0; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
.seat .cards { min-height: 70px; }
.seat .card { width: 46px; height: 66px; }
.seat .card .pip { font-size: 1.4rem; }
.seat .card .corner { font-size: .7rem; }
.hand { padding: 4px; border-radius: 10px; }
.hand.active { background: rgba(220, 243, 126, .14); }
.hand-info { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.hand-name { color: var(--title); font-weight: 700; font-size: .85rem; margin-top: 4px; }
.badge { font-size: .62rem; font-weight: 800; background: var(--gold); color: #1d1503; border-radius: 6px; padding: 2px 6px; }
.badge.grey { background: #777; color: #fff; }
.result { font-weight: 800; font-size: .85rem; padding: 2px 8px; border-radius: 999px; display: inline-block; margin-top: 4px; }
.result.win { background: rgba(123, 224, 143, .2); color: var(--win); }
.result.lose { background: rgba(255, 123, 123, .18); color: var(--lose); }
.result.push { background: rgba(255, 255, 255, .15); }
.net { font-weight: 900; font-size: 1.1rem; margin-top: 4px; }
.net.win { color: var(--win); } .net.lose { color: var(--lose); }
.bet-list { font-size: .72rem; color: #d7e6dc; }
.muted { color: var(--muted); }
.seat .muted { color: rgba(255, 255, 255, .55); font-size: .85rem; }

.controls {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: center;
  background: rgba(0, 0, 0, .38); border-radius: 18px; padding: 14px; border: 1px solid rgba(255, 255, 255, .1);
}
.controls .chip-picker { grid-column: 2; }
.controls .actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.controls .balance { grid-column: 3; grid-row: 1; text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.balance span { font-size: .75rem; color: rgba(255, 255, 255, .65); text-transform: uppercase; letter-spacing: .06em; }
.balance strong { font-size: 1.3rem; color: var(--gold); }
.bet-ctrl { display: flex; align-items: center; gap: 10px; }
.pm {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); background: #0a1d13; color: var(--gold);
  font-size: 1.6rem; font-weight: 800; cursor: pointer; line-height: 1;
}
.pm:hover:not(:disabled) { background: var(--gold); color: #1d1503; }
.pm:disabled { opacity: .35; cursor: not-allowed; }
.bet-box { min-width: 108px; text-align: center; }
.bet-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .7); }
.bet-amount { font-size: 1.7rem; font-weight: 900; color: var(--title); font-variant-numeric: tabular-nums; }
.bet-sub { font-size: .75rem; color: rgba(255, 255, 255, .7); }
.bet-warn { font-size: .72rem; color: #ffb4a8; font-weight: 700; }
.hint { color: rgba(255, 255, 255, .7); font-size: .85rem; flex-basis: 100%; text-align: center; }
.hint.big { font-size: 1.3rem; font-weight: 800; color: var(--title); }
@media (max-width: 720px) {
  .controls { grid-template-columns: 1fr; }
  .controls .chip-picker, .controls .balance { grid-column: 1; grid-row: auto; }
  .controls .balance { align-items: center; text-align: center; }
  .bet-ctrl { justify-content: center; }
  .felt { border-width: 7px; padding: 12px 10px; border-radius: 20px; }
  .card { width: 52px; height: 74px; } .card .pip { font-size: 1.6rem; }
}

/* ---------- ruleta ---------- */
.roulette-zone { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: center; }
@media (max-width: 900px) { .roulette-zone { grid-template-columns: 1fr; } }
.wheel-wrap { position: relative; width: min(300px, 80vw); margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); }
.wheel-result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.4); opacity: 0;
  width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; font-weight: 900;
  color: #fff; border: 3px solid var(--gold); transition: .35s; pointer-events: none;
}
.wheel-result.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wheel-result.red { background: var(--red); } .wheel-result.black { background: #141414; } .wheel-result.green { background: #0f8a3c; }
.rl-board { overflow-x: auto; padding-bottom: 4px; }
.rl-grid { display: grid; grid-template-columns: 44px repeat(12, minmax(32px, 1fr)) 44px; grid-template-rows: repeat(3, 44px); gap: 3px; min-width: 540px; }
.rl-dozens, .rl-outs { display: grid; gap: 3px; margin-top: 3px; min-width: 540px; padding: 0 47px; }
.rl-dozens { grid-template-columns: repeat(3, 1fr); }
.rl-outs { grid-template-columns: repeat(6, 1fr); }
.rl-cell {
  position: relative; border: 1px solid rgba(255, 255, 255, .85); color: #fff; font-weight: 800; cursor: pointer;
  background: transparent; border-radius: 4px; min-height: 40px; display: grid; place-items: center; padding: 0;
}
.rl-cell.red { background: var(--red); }
.rl-cell.black { background: #121212; }
.rl-cell.green, .rl-cell.zero { background: #0f8a3c; grid-row: 1 / 4; grid-column: 1; }
.rl-cell.outside { background: rgba(0, 0, 0, .18); font-size: .8rem; }
.rl-cell.red-dia span { color: var(--red); font-size: 1.4rem; }
.rl-cell.black-dia span { color: #000; font-size: 1.4rem; -webkit-text-stroke: 1px #fff; }
.rl-cell:hover:not(:disabled) { filter: brightness(1.3); }
.rl-cell:disabled { cursor: default; }
.rl-cell.sel { outline: 3px solid var(--title); outline-offset: -3px; z-index: 1; }
.rl-cell.win { box-shadow: 0 0 0 3px var(--gold), 0 0 18px var(--gold); z-index: 2; animation: pulse 1s infinite; }
.rl-cell .on-board { position: absolute; width: 28px; height: 28px; font-size: .6rem; bottom: -4px; right: -4px; z-index: 3; pointer-events: none; }
.rl-sel { font-size: .8rem; margin-top: 8px; color: rgba(255, 255, 255, .8); }
.rl-history { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.hist { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; border: 1px solid rgba(255, 255, 255, .5); }
.hist.red { background: var(--red); } .hist.black { background: #121212; } .hist.green { background: #0f8a3c; }

/* ---------- chat de mesa ---------- */
.room-chat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; max-height: 600px; }
.room-chat h4 { margin: 0 0 8px; color: var(--gold); }
.chat-log { flex: 1; overflow-y: auto; min-height: 120px; font-size: .88rem; display: flex; flex-direction: column; gap: 4px; }
.chat-line b { color: var(--title); }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- skins de mesa y cartas ---------- */
.felt.has-image { background-size: cover; background-position: center; }
.felt.skin-helluva {
  background: radial-gradient(ellipse at 50% 30%, #a3121c 0%, #5c0a10 50%, #1a0204 100%);
  border-color: #1b0b0b; box-shadow: inset 0 0 0 3px #ff4d4d, inset 0 0 60px rgba(0, 0, 0, .6), 0 18px 40px rgba(0, 0, 0, .5);
}
.felt.skin-husk {
  background: radial-gradient(ellipse at 50% 30%, #7b1a46 0%, #3d0a26 55%, #14030c 100%);
  border-color: #2b0d1f; box-shadow: inset 0 0 0 3px #e6c766, inset 0 0 60px rgba(0, 0, 0, .6), 0 18px 40px rgba(0, 0, 0, .5);
}
.felt.skin-luigi {
  background: radial-gradient(ellipse at 50% 30%, #2ea14b 0%, #17602b 55%, #082b12 100%);
  border-color: #3a250b; box-shadow: inset 0 0 0 3px #ffd34d, inset 0 0 60px rgba(0, 0, 0, .55), 0 18px 40px rgba(0, 0, 0, .5);
}
.felt.skin-custom { background: radial-gradient(ellipse at 50% 30%, #3a3f6b 0%, #1c1f3a 60%, #0a0b18 100%); }
.felt.skin-helluva .table-title { color: #ffb3b3; }
.felt.skin-husk .table-title { color: #f6d98a; }
.felt.skin-luigi .table-title { color: #e9ff8a; }
.card.back.skin-helluva { background: repeating-linear-gradient(45deg, #2a0306 0 6px, #a3121c 6px 12px); border-color: #ff4d4d; }
.card.back.skin-husk { background: repeating-linear-gradient(-45deg, #3d0a26 0 6px, #7b1a46 6px 12px); border-color: #e6c766; }
.card.back.skin-luigi { background: repeating-linear-gradient(45deg, #17602b 0 6px, #2ea14b 6px 12px); border-color: #ffd34d; }
.card.back.skin-custom { background: repeating-linear-gradient(45deg, #1c1f3a 0 6px, #3a3f6b 6px 12px); }
.card.back[style*="background-image"] { background-size: cover; background-position: center; }

/* ---------- tienda ---------- */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.skin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.skin-felt { min-height: 150px !important; border-width: 7px !important; border-radius: 16px !important; padding: 0 !important; display: grid; place-items: center; }
.skin-cards { display: flex; gap: 8px; }
.skin-info { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.skin-info h3 { margin: 0; font-size: 1.05rem; }
.price { color: var(--gold); font-weight: 700; white-space: nowrap; }
.skin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.skin-card label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.img-pick { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.img-pick img { max-height: 90px; max-width: 100%; object-fit: contain; border-radius: 6px; align-self: flex-start; }
.img-pick .row { display: flex; gap: 6px; align-items: center; }
.img-pick input[type=file] { padding: 6px; font-size: .8rem; }
.inline-form { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 140px; }

/* ---------- soporte ---------- */
.support-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .support-layout { grid-template-columns: 1fr; } }
.support-layout form.card-box { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ticket-list { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; }
.ticket-item { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--text); cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ticket-item b { flex-basis: 100%; }
.ticket-item.active { border-color: var(--gold); }
.status { font-size: .65rem; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; }
.status.abierto { background: #1f7a3e; } .status.cerrado { background: #555; }
.ticket-chat { display: flex; flex-direction: column; gap: 10px; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ticket-head h4 { margin: 0; }
.ticket-log { display: flex; flex-direction: column; gap: 8px; max-height: 440px; min-height: 200px; overflow-y: auto; padding: 4px; }
.ticket-log.tall { max-height: 60vh; min-height: 50vh; }
.tmsg { background: var(--panel2); border-radius: 12px; padding: 8px 12px; max-width: 80%; align-self: flex-start; white-space: pre-wrap; word-break: break-word; }
.tmsg.staff { background: #1c3566; }
.tmsg.mine { align-self: flex-end; background: #3a3215; }
.tmeta { font-size: .72rem; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.ticket-form { display: flex; gap: 8px; align-items: stretch; }
.ticket-form textarea { resize: vertical; }

/* ---------- modal, formularios, avisos ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--gold2); border-radius: 18px; padding: 22px; width: min(440px, 100%); position: relative; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-top: 0; color: var(--gold); font-family: 'Cinzel Decorative', Georgia, serif; }
.modal-x { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.form-error { color: var(--lose); font-size: .9rem; min-height: 1em; }
.room-list { display: flex; flex-direction: column; gap: 8px; }
.room { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font-weight: 600; text-align: left; }
.room:hover:not(:disabled) { border-color: var(--gold); }
.room:disabled { opacity: .5; cursor: not-allowed; }
.room-players { color: var(--muted); font-weight: 400; font-size: .85rem; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(420px, calc(100% - 32px)); }
.toast { background: #1d3a2a; border: 1px solid var(--line); padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); transition: .4s; }
.toast.error { background: #4a1414; border-color: #a33; }
.toast.ok { background: #1c4a26; border-color: #3c6; }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- admin ---------- */
.search { max-width: 320px; margin-bottom: 10px; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; }
table.data tr.banned td { background: rgba(196, 22, 28, .12); }
td.acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
td.acts select { width: auto; padding: 5px 8px; }
body.admin h3 { color: var(--gold); }
