/* =====================================================================
   ARCANO · Estilos
   Tema: arcanos / tarot — índigo profundo, oro viejo, tipografía serif.
   ===================================================================== */

:root {
  --bg:        #0a0917;
  --bg-2:      #14112c;
  --panel:     #1b1740;
  --panel-2:   #221d49;
  --ink:       #f4eedd;
  --muted:     #a79dc4;
  --muted-2:   #7d749c;
  --gold:      #e8c06a;
  --gold-deep: #b88a35;
  --line:      rgba(232,192,106,0.16);
  --line-soft: rgba(255,255,255,0.07);
  --danger:    #e0607a;
  --ok:        #5bbd86;

  /* Colores de las 4 opciones (gemas) */
  --opt-a: #d24d6a;  /* rubí    */
  --opt-b: #4a78c9;  /* zafiro  */
  --opt-c: #e0a93c;  /* ámbar   */
  --opt-d: #9b6cc9;  /* amatista*/

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --shadow: 0 18px 50px -20px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a2356 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 110%, #1d2a5e 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Campo de estrellas tenue */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.2px 1.2px at 70% 20%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.6px 1.6px at 40% 70%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.1px 1.1px at 85% 60%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1.3px 1.3px at 12% 85%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.1px 1.1px at 60% 90%, rgba(255,255,255,0.4), transparent);
  opacity: 0.6;
}

a { color: var(--gold); }

/* ---------- Tipografía ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .5px; margin: 0; }
.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  opacity: .85;
}

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .sigil {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 20px;
  background: radial-gradient(circle at 30% 25%, rgba(232,192,106,.18), transparent 70%);
}
.brand .name { font-family: var(--serif); font-size: 24px; letter-spacing: 3px; }

/* ---------- Botones ---------- */
.btn {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2a1d05; border: none;
  box-shadow: 0 10px 30px -12px rgba(232,192,106,.6);
}
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: rgba(224,96,122,.35); background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }

input, select, textarea {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: rgba(0,0,0,.25);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 13px 15px;
  width: 100%;
}
input:focus, select, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
label { font-size: 13px; color: var(--muted); display: block; margin: 0 0 6px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #2a1f12; color: var(--ink);
  border: 1px solid var(--gold-deep);
  padding: 12px 18px; border-radius: 12px;
  font-size: 14px; z-index: 50; box-shadow: var(--shadow);
  max-width: 90vw; text-align: center;
}

/* =====================================================================
   JUGADOR (móvil)
   ===================================================================== */
.player-wrap {
  max-width: 460px; margin: 0 auto; padding: 22px 18px 40px;
  min-height: 100vh; display: flex; flex-direction: column;
}
.player-header { display:flex; justify-content:space-between; align-items:center; margin-bottom: 22px; }
.player-main { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.join-card { padding: 28px 22px; text-align: center; }
.join-card h1 { font-size: 34px; margin-bottom: 4px; }
.join-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.field { margin-bottom: 14px; text-align: left; }
#code-input { text-transform: uppercase; letter-spacing: .35em; text-align: center; font-size: 22px; font-weight: 700; }

.status-line { text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; min-height: 20px; }

/* Opciones (cartas de respuesta) */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.opt {
  position: relative;
  border: none; border-radius: 14px;
  min-height: 96px; padding: 14px;
  color: #fff; font-size: 17px; font-weight: 600; text-align: left;
  cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .1s ease, opacity .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.opt .glyph { font-size: 22px; opacity: .85; }
.opt:active { transform: scale(.97); }
.opt[data-i="0"] { background: linear-gradient(160deg, var(--opt-a), #9b2f4c); }
.opt[data-i="1"] { background: linear-gradient(160deg, var(--opt-b), #2f5396); }
.opt[data-i="2"] { background: linear-gradient(160deg, var(--opt-c), #ab7a1d); color:#231a05; }
.opt[data-i="3"] { background: linear-gradient(160deg, var(--opt-d), #6f47a0); }
.opt.dim { opacity: .28; filter: grayscale(.4); }
.opt.chosen { outline: 3px solid #fff; outline-offset: 2px; }
.opt.correct { outline: 3px solid var(--ok); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(91,189,134,.25); }
.opt.is-wrong { opacity: .4; }

.q-num { color: var(--gold); font-size: 13px; letter-spacing: .15em; text-transform: uppercase; }
.q-text { font-family: var(--serif); font-size: 26px; line-height: 1.2; margin: 8px 0 4px; text-align:center; }

/* Cronómetro circular */
.timer-ring { width: 64px; height: 64px; position: relative; }
.timer-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.timer-ring .track { stroke: rgba(255,255,255,.12); }
.timer-ring .bar { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.timer-ring .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums;
}

.bigstate { text-align: center; padding: 30px 18px; }
.bigstate .icon { font-size: 54px; color: var(--gold); }
.bigstate h2 { font-size: 30px; margin: 12px 0 6px; }
.bigstate p { color: var(--muted); margin: 0; }
.score-pill {
  display:inline-flex; align-items:center; gap:8px;
  background: rgba(232,192,106,.12); border:1px solid var(--line);
  color: var(--gold); padding: 8px 16px; border-radius: 999px;
  font-weight: 700; font-size: 18px; margin-top: 14px;
}
.points-pop { font-family: var(--serif); font-size: 46px; color: var(--gold); margin: 6px 0; }

.mini-board { margin-top: 18px; text-align: left; }
.mini-board .row {
  display:flex; align-items:center; gap:12px;
  padding: 11px 14px; border-radius: 10px; background: rgba(255,255,255,.04);
  margin-bottom: 8px;
}
.mini-board .row.me { border: 1px solid var(--gold); }
.mini-board .rk { width: 24px; color: var(--gold); font-weight: 700; font-family: var(--serif); font-size: 18px; }
.mini-board .nm { flex: 1; font-weight: 600; }
.mini-board .sc { color: var(--muted); font-variant-numeric: tabular-nums; }

/* =====================================================================
   PANTALLA GRANDE (TV / proyector)
   ===================================================================== */
.screen-wrap { min-height: 100vh; padding: 4vh 5vw; display: flex; flex-direction: column; }
.screen-top { display:flex; justify-content: space-between; align-items: center; margin-bottom: 2vh; }
.screen-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.portal { text-align: center; }
.portal .eyebrow { margin-bottom: 10px; }
.portal h1 { font-size: clamp(36px, 6vw, 86px); line-height: 1; margin-bottom: 2vh; }
.join-row { display: flex; gap: clamp(20px, 5vw, 60px); align-items: center; justify-content: center; flex-wrap: wrap; }
.code-display {
  font-family: var(--serif);
  font-size: clamp(64px, 13vw, 180px);
  letter-spacing: .08em; line-height: 1; color: var(--gold);
  text-shadow: 0 0 40px rgba(232,192,106,.35);
}
.code-label { color: var(--muted); font-size: clamp(14px,1.4vw,20px); letter-spacing: .25em; text-transform: uppercase; }
.qr-box { background:#fff; padding: 18px; border-radius: 18px; box-shadow: var(--shadow); }
.qr-box svg, .qr-box img { display:block; width: clamp(150px, 18vw, 240px); height: auto; }
.join-hint { color: var(--muted); margin-top: 3vh; font-size: clamp(15px,1.6vw,22px); }

.lobby-players { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 4vh; }
.chip {
  background: var(--panel); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 999px; font-weight: 600;
  font-size: clamp(14px,1.4vw,20px);
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.screen-q { text-align: center; }
.screen-q .q-meta { color: var(--gold); letter-spacing: .2em; text-transform: uppercase; font-size: clamp(13px,1.3vw,18px); }
.screen-q h2 { font-size: clamp(30px, 4.6vw, 68px); line-height: 1.12; margin: 2vh auto; max-width: 22ch; }
.screen-options { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px,1.6vw,22px); max-width: 1100px; margin: 2vh auto 0; }
.screen-opt {
  display:flex; align-items:center; gap: 16px;
  border-radius: 16px; padding: clamp(14px,1.8vw,26px);
  font-size: clamp(18px,2.2vw,32px); font-weight: 600; color:#fff;
  position: relative; transition: opacity .3s, transform .3s;
}
.screen-opt .glyph { font-size: clamp(22px,2.6vw,40px); }
.screen-opt[data-i="0"] { background: linear-gradient(160deg, var(--opt-a), #9b2f4c); }
.screen-opt[data-i="1"] { background: linear-gradient(160deg, var(--opt-b), #2f5396); }
.screen-opt[data-i="2"] { background: linear-gradient(160deg, var(--opt-c), #ab7a1d); color:#231a05;}
.screen-opt[data-i="3"] { background: linear-gradient(160deg, var(--opt-d), #6f47a0); }
.screen-opt .cnt { margin-left:auto; font-variant-numeric: tabular-nums; opacity:.9; }
.screen-opt.dim { opacity: .25; }
.screen-opt.correct::after {
  content: "✓"; position:absolute; right: 18px; top:50%; transform: translateY(-50%);
  font-size: clamp(24px,3vw,44px); color:#fff;
}
.screen-timer {
  font-family: var(--serif); font-variant-numeric: tabular-nums;
  font-size: clamp(40px,6vw,90px); color: var(--gold);
}
.answered-tally { color: var(--muted); font-size: clamp(16px,1.8vw,26px); margin-top: 2vh; }

.board { max-width: 760px; margin: 0 auto; width: 100%; }
.board h2 { text-align:center; font-size: clamp(32px,5vw,64px); margin-bottom: 3vh; }
.board .row {
  display:flex; align-items:center; gap: 20px;
  padding: clamp(12px,1.6vw,20px) clamp(16px,2vw,28px);
  border-radius: 14px; background: var(--panel); border:1px solid var(--line-soft);
  margin-bottom: 12px; font-size: clamp(18px,2vw,28px);
  animation: slidein .4s ease backwards;
}
.board .row:nth-child(1){animation-delay:.05s} .board .row:nth-child(2){animation-delay:.1s}
.board .row:nth-child(3){animation-delay:.15s} .board .row:nth-child(4){animation-delay:.2s}
.board .row:nth-child(5){animation-delay:.25s}
@keyframes slidein { from { opacity:0; transform: translateX(-18px);} to {opacity:1; transform:none;} }
.board .row.top { border-color: var(--gold); background: linear-gradient(90deg, rgba(232,192,106,.14), transparent); }
.board .rk { font-family: var(--serif); font-size: 1.4em; color: var(--gold); width: 1.6em; }
.board .nm { flex:1; font-weight:600; }
.board .sc { font-variant-numeric: tabular-nums; color: var(--gold); font-weight:700; }

.podium { display:flex; justify-content:center; align-items:flex-end; gap: clamp(14px,2.5vw,40px); margin-bottom: 5vh; }
.podium .col { text-align:center; }
.podium .pdname { font-family: var(--serif); font-size: clamp(20px,2.4vw,34px); margin-bottom: 10px; }
.podium .pdscore { color: var(--gold); font-weight: 700; margin-bottom: 12px; font-variant-numeric: tabular-nums;}
.podium .block {
  width: clamp(80px,11vw,150px); border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border:1px solid var(--line); border-bottom: none;
  display:grid; place-items:center; font-family: var(--serif);
  font-size: clamp(40px,6vw,90px); color: var(--gold);
}
.podium .p1 .block { height: clamp(150px,22vh,240px); border-color: var(--gold); box-shadow: 0 0 50px -10px rgba(232,192,106,.4);}
.podium .p2 .block { height: clamp(110px,16vh,180px); }
.podium .p3 .block { height: clamp(85px,12vh,140px); }

/* =====================================================================
   ANFITRIÓN (panel de control)
   ===================================================================== */
.host-shell { max-width: 1080px; margin: 0 auto; padding: 22px 20px 60px; }
.host-top { display:flex; justify-content: space-between; align-items:center; margin-bottom: 26px; flex-wrap: wrap; gap: 12px;}
.host-nav { display:flex; gap: 8px; }
.tab { background: transparent; border: 1px solid var(--line-soft); color: var(--muted);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight:600; font-size: 14px; }
.tab.active { color: var(--ink); border-color: var(--gold); background: rgba(232,192,106,.08); }

.login-wrap { max-width: 380px; margin: 14vh auto 0; }
.login-wrap .card { padding: 30px 26px; }

.quiz-list { display: grid; gap: 12px; }
.quiz-item { display:flex; align-items:center; gap: 14px; padding: 16px 18px; }
.quiz-item .qt { flex:1; }
.quiz-item .qt .t { font-family: var(--serif); font-size: 21px; }
.quiz-item .qt .m { color: var(--muted); font-size: 13px; margin-top: 2px;}

.q-editor { display: grid; gap: 14px; }
.q-row { padding: 16px 18px; }
.q-row .q-head { display:flex; align-items:flex-start; gap: 12px; }
.q-row .drag { color: var(--muted-2); cursor: grab; font-size: 18px; padding-top: 4px;}
.q-row .q-body { flex: 1; }
.q-row .q-title { font-weight: 600; margin-bottom: 4px; }
.q-row .q-opts { color: var(--muted); font-size: 14px; }
.q-row .q-opts .c { color: var(--ok); }
.q-row .q-actions { display:flex; gap: 8px; }

.editor-grid { display: grid; gap: 12px; }
.opt-edit { display:flex; align-items:center; gap: 10px; }
.opt-edit input[type=radio] { width: auto; }
.opt-edit .tag { width: 22px; height:22px; border-radius:6px; flex:none; }
.row-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.live-grid { display:grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 820px){ .live-grid { grid-template-columns: 1fr; } }
.live-panel { padding: 20px; }
.live-code { font-family: var(--serif); font-size: 40px; letter-spacing:.1em; color: var(--gold); }
.live-controls { display:grid; gap: 10px; margin-top: 8px;}
.live-stat { display:flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.live-stat b { color: var(--ink); }
.status-tag { display:inline-block; padding: 4px 12px; border-radius:999px; font-size:12px; font-weight:700;
  text-transform: uppercase; letter-spacing:.1em; border:1px solid var(--line); color: var(--gold);}

.row-flex { display:flex; gap: 10px; align-items:center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.center { text-align:center; }
.mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; }
.hidden { display: none !important; }
