:root {
  --bg: #0b0b0d;
  --panel: #16161a;
  --panel2: #1f1f25;
  --line: #2a2a32;
  --text: #f2f2f2;
  --muted: #9aa0ab;
  --accent: #f5c518;
  --accent2: #ff5470;
  --good: #4ade80;
  --white-card: #f7f7f2;
  --ink: #111;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}
#app { max-width: 540px; margin: 0 auto; padding: 18px 16px 40px; }
.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Hero / inicio */
.hero { text-align: center; margin: 14px 0 18px; }
.hero-cards { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.hc { display: inline-flex; align-items: center; justify-content: center; width: 78px; height: 104px; border-radius: 10px; font-weight: 800; transform: rotate(-6deg); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.hc-black { background: #000; color: #fff; border: 1px solid #333; transform: rotate(-9deg); }
.hc-white { background: var(--white-card); color: var(--ink); transform: rotate(7deg) translateY(8px); }
.title { font-size: 38px; line-height: 1.02; font-weight: 900; letter-spacing: -1px; margin: 6px 0; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0; }

/* Cards / paneles */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.card-title { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 4px 0 6px; }
input { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; color: var(--text); font-size: 16px; outline: none; }
input:focus { border-color: var(--accent); }
.code-input { text-transform: uppercase; letter-spacing: 8px; text-align: center; font-weight: 800; font-size: 22px; }

.btn { width: 100%; border: none; border-radius: 12px; padding: 14px; font-size: 16px; font-weight: 700; background: var(--panel2); color: var(--text); cursor: pointer; margin-top: 10px; border: 1px solid var(--line); }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); color: #111; border: none; }
.btn-primary:disabled { opacity: .4; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-mini { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0 6px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.error { color: var(--accent2); font-size: 13px; text-align: center; min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* Lobby */
.room-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.room-label { color: var(--muted); font-size: 11px; letter-spacing: 2px; display: block; }
.room-code { font-size: 28px; font-weight: 900; letter-spacing: 4px; }
.badge { background: var(--accent); color: #111; border-radius: 20px; padding: 1px 9px; font-size: 13px; font-weight: 800; }
.player-list { list-style: none; margin: 0; padding: 0; }
.player-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.player-list li:last-child { border-bottom: none; }
.pname { font-weight: 600; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.tag.you { background: var(--accent); color: #111; border: none; }
.tag.off { color: var(--accent2); }

/* Juego */
.game-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.round-role { font-size: 13px; font-weight: 700; color: var(--muted); }
.round-role.is-judge { color: var(--accent); }

.black-card { background: #000; border: 1px solid #2a2a2a; border-radius: 16px; padding: 22px 20px; min-height: 130px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); position: relative; }
.black-card p { font-size: 22px; font-weight: 800; line-height: 1.25; margin: 0; color: #fff; }
.blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--accent); margin: 0 3px; vertical-align: baseline; height: 1em; }
.pick-badge { position: absolute; top: 12px; right: 12px; background: var(--accent2); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 20px; }

.game-status { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0; }

/* Mano */
.hand-area { margin-top: 8px; }
.hand { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.white-card { position: relative; text-align: left; background: var(--white-card); color: var(--ink); border: 2px solid transparent; border-radius: 12px; padding: 14px 16px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.white-card.selected { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(245,197,24,.35); }
.white-card .ord { position: absolute; top: -8px; right: -8px; background: var(--accent); color: #111; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }

/* Juez */
.judge-area { display: flex; flex-direction: column; gap: 10px; }
.combo { text-align: left; background: var(--white-card); color: var(--ink); border: 2px solid transparent; border-radius: 12px; padding: 14px 16px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.combo u { text-decoration: none; font-weight: 900; color: var(--accent2); }
.combo:active { border-color: var(--accent); }
.combo-static { cursor: default; opacity: .92; }
.combo-q { display: block; }
.combo-a { display: block; margin-top: 8px; font-weight: 900; color: var(--accent2); }

/* Resultado */
.result-area { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.result-label { color: var(--muted); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 6px; }
.result-winner { font-size: 26px; margin: 0 0 12px; color: var(--accent); }
.result-combo { background: var(--white-card); color: var(--ink); border-radius: 12px; padding: 14px 16px; font-size: 17px; font-weight: 600; text-align: left; }
.result-combo u { text-decoration: none; font-weight: 900; color: var(--accent2); }

/* Modales */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-inner { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: 100%; max-width: 380px; }
.scores-list { list-style: none; margin: 10px 0 16px; padding: 0; }
.scores-list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.scores-list li:last-child { border-bottom: none; }
.scores-list b { font-size: 18px; color: var(--accent); }
.over-winner { text-align: center; font-size: 34px; margin: 6px 0 14px; color: var(--accent); }
