/* Nunito (SIL Open Font License, ver fonts/OFL.txt), alojada en el propio servidor. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/fonts/nunito-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #1b1035;
  --bg-2: #2a1a52;
  --card: #ffffff;
  --text: #1d1530;
  --text-light: #f5f1ff;
  --muted: #6e6488;
  --primary: #ffcb2b;
  --primary-dark: #e0a800;
  --accent: #7c4dff;
  --ok: #1fb36b;
  --bad: #ef4747;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text-light);
  background: radial-gradient(circle at 20% 0%, var(--bg-2), var(--bg) 60%);
  background-color: var(--bg);
  line-height: 1.4;
}

[hidden] { display: none !important; }

.container { max-width: 560px; margin: 0 auto; padding: 16px; }

/* Cabecera */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 16px; }
.logo { font-weight: 900; font-size: 1.4rem; letter-spacing: -0.5px; color: var(--text-light); text-decoration: none; }
.logo span { color: var(--primary); }

/* Portada */
.hero { text-align: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2rem, 8vw, 2.8rem); margin: 0 0 8px; line-height: 1.1; font-weight: 900; }
.hero h1 span { color: var(--primary); }
.hero p { margin: 0 auto; max-width: 420px; color: #cfc4f0; font-size: 1.05rem; }

.card { background: var(--card); color: var(--text); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-top: 20px; }
.card h2 { margin: 0 0 6px; font-size: 1.3rem; }
.card p { margin: 0 0 14px; color: var(--muted); }

.mode-badge { display: inline-block; background: #fff3c9; color: #8a6400; font-weight: 800; font-size: 0.75rem; padding: 3px 10px; border-radius: 99px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

label { font-weight: 700; font-size: 0.9rem; display: block; margin-bottom: 6px; }
select, input[type="text"] {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid #e2dcf2; background: #fbfaff; color: var(--text);
}
select:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); }

.btn {
  display: block; width: 100%; font: inherit; font-weight: 900; font-size: 1.15rem; padding: 14px 18px; margin-top: 14px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--primary); color: #2b1d00; box-shadow: 0 5px 0 var(--primary-dark); transition: transform 0.08s, box-shadow 0.08s; text-align: center; text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--primary-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: #ece6ff; color: var(--accent); box-shadow: 0 5px 0 #cdbfff; }
.btn-secondary:active { box-shadow: 0 1px 0 #cdbfff; }

/* Ranking */
.tabs { display: flex; gap: 6px; background: #f1edfb; padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.tab { flex: 1; font: inherit; font-weight: 800; border: 0; background: transparent; padding: 8px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.tab.active { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #f0ecf8; }
.ranking li:last-child { border-bottom: 0; }
.ranking .pos { width: 30px; text-align: center; font-weight: 900; color: var(--muted); }
.ranking li:nth-child(1) .pos { color: #d4a000; }
.ranking li:nth-child(2) .pos { color: #8f97a3; }
.ranking li:nth-child(3) .pos { color: #b0703a; }
.ranking .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .pts { font-weight: 900; color: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 12px 0; margin: 0; }

.rules { color: #cfc4f0; font-size: 0.95rem; padding: 0 4px; }
.rules h2 { color: var(--text-light); font-size: 1.1rem; }
.rules li { margin-bottom: 6px; }

.site-footer { text-align: center; color: #8f84b3; font-size: 0.85rem; padding: 24px 0 8px; }

/* Juego */
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.stat { background: rgba(255,255,255,0.08); padding: 8px 14px; border-radius: 12px; font-weight: 900; font-size: 1.1rem; min-width: 84px; text-align: center; }
.stat small { display: block; font-size: 0.7rem; font-weight: 700; color: #b9addf; text-transform: uppercase; letter-spacing: 0.5px; }
.stat.streak.hot { background: rgba(255, 203, 43, 0.2); color: var(--primary); }

.timer { height: 12px; background: rgba(255,255,255,0.12); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--ok), var(--primary)); border-radius: 99px; transform-origin: left; }
.timer-bar.low { background: var(--bad); }
.timer-text { text-align: right; font-weight: 900; font-size: 0.95rem; color: #cfc4f0; }

.question-card { background: var(--card); color: var(--text); border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); margin-top: 8px; position: relative; }
.question-cat { font-size: 0.75rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.6px; }
.question-text { font-size: 1.3rem; font-weight: 800; margin: 6px 0 16px; line-height: 1.25; }

.options { display: grid; gap: 10px; }
.option {
  font: inherit; font-weight: 700; font-size: 1.05rem; text-align: left; padding: 14px 16px; border-radius: 14px; border: 2px solid #e2dcf2; background: #fbfaff; color: var(--text); cursor: pointer; transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.option:active { transform: scale(0.98); }
.option:disabled { cursor: default; }
.option.correct { background: #dcf7e9; border-color: var(--ok); color: #0c5a34; }
.option.wrong { background: #fde2e2; border-color: var(--bad); color: #8b1a1a; }

.points-pop { position: absolute; top: 14px; right: 16px; font-weight: 900; font-size: 1.2rem; color: var(--ok); animation: pop 0.7s ease-out forwards; pointer-events: none; }
.points-pop.miss { color: var(--bad); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.8); } 30% { opacity: 1; transform: translateY(0) scale(1.1); } to { opacity: 0; transform: translateY(-16px); } }

.countdown { display: flex; align-items: center; justify-content: center; min-height: 60vh; font-size: 7rem; font-weight: 900; color: var(--primary); }
.countdown span { animation: pop-in 0.9s ease-out; }
@keyframes pop-in { from { transform: scale(1.8); opacity: 0; } 40% { transform: scale(1); opacity: 1; } }

.result-score { text-align: center; font-size: 3.5rem; font-weight: 900; color: var(--accent); margin: 4px 0; line-height: 1; }
.result-label { text-align: center; color: var(--muted); font-weight: 700; margin: 0 0 16px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.result-stats div { background: #f5f2fd; border-radius: 12px; padding: 10px 6px; text-align: center; font-weight: 900; font-size: 1.2rem; }
.result-stats small { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.rank-msg { text-align: center; font-weight: 800; color: var(--ok); margin: 12px 0 0; }
.form-error { color: var(--bad); font-weight: 700; font-size: 0.9rem; margin: 8px 0 0; }

.review { list-style: none; padding: 0; margin: 0; }
.review li { padding: 10px 0; border-bottom: 1px solid #f0ecf8; }
.review li:last-child { border-bottom: 0; }
.review .q { font-weight: 700; margin-bottom: 4px; }
.review .yours { color: var(--bad); font-size: 0.92rem; }
.review .right { color: var(--ok); font-size: 0.92rem; font-weight: 700; }
.review .expl { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

.error-box { background: #fde2e2; color: #8b1a1a; border-radius: 12px; padding: 12px; font-weight: 700; margin-top: 16px; }

/* ---------- Cabecera: perfil ---------- */
.me-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.1); color: var(--text-light); text-decoration: none; font-weight: 800; font-size: 0.9rem; padding: 7px 12px; border-radius: 99px; max-width: 55%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.me-chip:hover { background: rgba(255,255,255,0.18); }

/* ---------- Portada: modos ---------- */
.modes { display: grid; gap: 14px; margin-top: 20px; }
.modes .card { margin-top: 0; }
.mode-badge.online { background: #e4ffef; color: #0c6b3b; }
.mode-badge.friends { background: #ece6ff; color: var(--accent); }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: 3px; font-weight: 900; text-align: center; }
.join-row .btn { width: auto; margin-top: 0; padding: 12px 18px; font-size: 1rem; }
.or { text-align: center; color: var(--muted); font-weight: 700; font-size: 0.85rem; margin: 12px 0 0; }

/* ---------- Ventana para el nombre ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 6, 30, 0.75); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.overlay .card { width: 100%; max-width: 420px; margin: 0; }

/* ---------- Partida en red ---------- */
.center-screen { text-align: center; padding: 40px 0; }
.center-screen h1 { font-size: 1.6rem; margin: 18px 0 6px; }
.center-screen p { color: #cfc4f0; margin: 0 0 16px; }
.spinner { width: 54px; height: 54px; border: 6px solid rgba(255,255,255,0.15); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen .btn { max-width: 320px; margin-left: auto; margin-right: auto; }

.room-code { font-size: 2.6rem; font-weight: 900; letter-spacing: 8px; text-align: center; color: var(--accent); margin: 4px 0; }
.player-list { list-style: none; padding: 0; margin: 0 0 6px; }
.player-list li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #f0ecf8; font-weight: 700; }
.player-list li:last-child { border-bottom: 0; }
.player-list .tag { font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #fff3c9; color: #8a6400; }
.player-list .tag.off { background: #eee; color: #777; }
.player-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-list button { font: inherit; border: 0; background: #fde2e2; color: var(--bad); border-radius: 8px; padding: 2px 8px; cursor: pointer; font-weight: 800; }
.seg { display: flex; gap: 6px; margin-bottom: 4px; }
.seg button { flex: 1; font: inherit; font-weight: 800; padding: 10px; border-radius: 10px; border: 2px solid #e2dcf2; background: #fbfaff; cursor: pointer; color: var(--text); }
.seg button.active { border-color: var(--accent); background: #ece6ff; color: var(--accent); }
.field { margin-top: 12px; }
.waiting-note { text-align: center; color: var(--muted); font-weight: 700; margin: 14px 0 0; }

.strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; background: rgba(255,255,255,0.08); border-radius: 12px; padding: 6px 10px; font-size: 0.85rem; font-weight: 800; display: flex; gap: 6px; align-items: center; max-width: 160px; }
.chip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .s { color: var(--primary); }
.chip.me { outline: 2px solid var(--primary); }
.chip.done::after { content: "✓"; color: var(--ok); }
.chip.off { opacity: 0.45; }
.progress { color: #cfc4f0; font-weight: 800; font-size: 0.9rem; }
.option.mine { border-color: var(--accent); background: #ece6ff; }
.reveal-note { margin-top: 12px; font-size: 0.9rem; color: var(--muted); }
.link-btn { font: inherit; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: 0.85rem; margin-top: 10px; }

.podium { list-style: none; padding: 0; margin: 0; }
.podium li { display: flex; align-items: center; gap: 10px; padding: 12px 6px; border-bottom: 1px solid #f0ecf8; }
.podium li.me { background: #fff8de; border-radius: 12px; }
.podium .pos { width: 34px; text-align: center; font-weight: 900; font-size: 1.2rem; }
.podium .name { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pts { font-weight: 900; color: var(--accent); }
.podium .elo { font-size: 0.8rem; font-weight: 800; margin-left: 6px; }
.elo.up { color: var(--ok); }
.elo.down { color: var(--bad); }
.end-title { text-align: center; font-size: 1.8rem; margin: 4px 0 14px; }

.banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; background: #2b1d55; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 800; box-shadow: var(--shadow); z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.banner.warn { background: #8b5a00; }

/* ---------- Perfil ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stats-grid div { background: #f5f2fd; border-radius: 12px; padding: 12px 8px; text-align: center; font-weight: 900; font-size: 1.4rem; color: var(--accent); }
.stats-grid small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid #f0ecf8; font-weight: 700; font-size: 0.95rem; }
.history li:last-child { border-bottom: 0; }
.history .when { color: var(--muted); font-size: 0.8rem; font-weight: 600; }

/* ---------- Texto legal ---------- */
.prose { color: var(--text); }
.prose h1 { font-size: 1.6rem; margin-top: 0; }
.prose h2 { font-size: 1.15rem; margin: 20px 0 6px; }
.prose p, .prose li { color: #3d3354; }
.prose a { color: var(--accent); }
.site-footer a { color: #b9addf; margin: 0 6px; }

/* ---------- Conquista ---------- */
.container.wide { max-width: 760px; }
.mode-badge.star { background: #ffe0e0; color: #a3161b; }
.card.featured { border: 3px solid var(--primary); }
.cq-players { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cq-player { background: rgba(255,255,255,0.08); border-radius: 12px; padding: 6px 8px; border: 2px solid transparent; min-width: 0; }
.cq-player.turn { border-color: var(--primary); }
.cq-player.me { background: rgba(255,255,255,0.16); }
.cq-player.out { opacity: 0.45; }
.cq-player .top { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.85rem; }
.cq-player .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.cq-player .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cq-player .sc { font-weight: 900; font-size: 1.1rem; color: var(--primary); }
.cq-player .tw { font-size: 0.75rem; color: #cfc4f0; }
.cq-event { min-height: 1.4em; text-align: center; font-weight: 800; margin: 8px 0 4px; color: #fff; }
.cq-map svg { width: 100%; height: auto; display: block; }
.cq-map .region { stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; transition: fill 0.35s; }
.cq-map .region.free { fill: #3a2d63; }
.cq-map .region.pickable { stroke: var(--primary); stroke-width: 4; cursor: pointer; animation: cq-pulse 1.1s ease-in-out infinite; }
.cq-map .region.target { stroke: #fff; stroke-width: 5; animation: cq-flash 0.6s ease-in-out infinite alternate; }
.cq-map .frame { fill: none; stroke: rgba(255,255,255,0.35); stroke-dasharray: 6 5; }
.cq-map .castle text { font-size: 26px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cq-map .castle .towers { font-size: 15px; font-weight: 900; fill: #fff; paint-order: stroke; stroke: #1b1035; stroke-width: 4px; }
.cq-map .value { font-size: 15px; font-weight: 800; fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,0.55); stroke-width: 3px; pointer-events: none; }
@keyframes cq-pulse { 50% { stroke-opacity: 0.35; } }
@keyframes cq-flash { from { stroke-opacity: 1; } to { stroke-opacity: 0.2; } }
.cq-panel { margin-top: 8px; }
.cq-panel h3 { margin: 0 0 8px; font-size: 1.1rem; }
.cq-panel .muted { color: var(--muted); margin: 0; }
.guess-row { display: flex; gap: 8px; }
.guess-row input { flex: 1; font-size: 1.3rem; font-weight: 800; text-align: center; }
.guess-row .btn { width: auto; margin-top: 0; }
.unit { color: var(--muted); font-weight: 700; margin-top: 6px; font-size: 0.9rem; }
.guesses { list-style: none; padding: 0; margin: 8px 0 0; }
.guesses li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f0ecf8; font-weight: 700; }
.guesses li:last-child { border-bottom: 0; }
.guesses .dot { width: 12px; height: 12px; border-radius: 50%; }
.guesses .grow { flex: 1; }
.answer-big { font-size: 1.8rem; font-weight: 900; color: var(--accent); text-align: center; margin: 4px 0; }
.who-answered { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.who-answered span { font-size: 0.8rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: #f1edfb; color: var(--muted); }
.who-answered span.done { background: #dcf7e9; color: #0c5a34; }
.option .tag-who { float: right; font-size: 0.8rem; font-weight: 900; }
.cq-attrib { font-size: 0.7rem; color: #8f84b3; text-align: center; margin: 8px 0 0; }
.podium .dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }
.answering .cq-map svg { max-height: 30vh; }

/* =====================================================================
   Grafica y efectos de juego
   ===================================================================== */

/* Fondo con estrellas que parpadean */
body::before, body::after {
  content: ""; position: fixed; inset: -50px; pointer-events: none; z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 60%, transparent 61%),
    radial-gradient(1px 1px at 72% 12%, #fff 60%, transparent 61%),
    radial-gradient(2px 2px at 38% 64%, #ffcb2b 60%, transparent 61%),
    radial-gradient(1px 1px at 88% 48%, #fff 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 22% 86%, #c9b6ff 60%, transparent 61%),
    radial-gradient(1px 1px at 58% 34%, #fff 60%, transparent 61%),
    radial-gradient(2px 2px at 92% 82%, #fff 60%, transparent 61%),
    radial-gradient(1px 1px at 5% 52%, #ffcb2b 60%, transparent 61%);
  background-size: 420px 420px;
  opacity: 0.55;
  animation: stars-twinkle 4s ease-in-out infinite alternate;
}
body::after { background-size: 300px 300px; background-position: 140px 90px; opacity: 0.35; animation-duration: 6s; animation-delay: -2s; }
@keyframes stars-twinkle { from { opacity: 0.15; transform: translateY(0); } to { opacity: 0.6; transform: translateY(-12px); } }

/* Logo en la cabecera */
.logo { display: inline-flex; align-items: center; line-height: 0; }
.logo img { height: 52px; width: auto; filter: drop-shadow(0 4px 0 rgba(0,0,0,0.35)); transition: transform 0.2s; }
.logo:hover img, .logo:focus-visible img { transform: rotate(-4deg) scale(1.06); }
.header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 62%; justify-content: flex-end; }
.header-actions .me-chip { max-width: none; min-width: 0; }
.sound-btn { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.1); font-size: 1.1rem; cursor: pointer; line-height: 1; transition: transform 0.15s, background 0.15s; }
.sound-btn:hover { background: rgba(255,255,255,0.2); }
.sound-btn:active { transform: scale(0.88); }

/* Botones con brillo */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg); pointer-events: none; animation: btn-shine 3.6s ease-in-out infinite;
}
.btn-secondary::after { animation: none; }
@keyframes btn-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(4px); }

/* Portada */
.hero-art { display: block; width: 100%; height: auto; max-width: 520px; margin: -4px auto 0; border-radius: 24px; animation: hero-float 5s ease-in-out infinite;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%); }
@keyframes hero-float { 50% { transform: translateY(-8px); } }
.hero h1 span { display: inline-block; animation: word-pop 2.4s ease-in-out infinite; text-shadow: 0 0 18px rgba(255,203,43,0.55); }
@keyframes word-pop { 0%, 80%, 100% { transform: scale(1) rotate(0); } 88% { transform: scale(1.12) rotate(-3deg); } }

.mode-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.mode-head h2 { margin: 0; }
.mode-icon { width: 64px; height: 64px; flex: 0 0 auto; filter: drop-shadow(0 4px 4px rgba(27,16,53,0.25)); animation: icon-bob 3s ease-in-out infinite; }
.modes .card:nth-child(2) .mode-icon { animation-delay: -0.7s; }
.modes .card:nth-child(3) .mode-icon { animation-delay: -1.4s; }
.modes .card:nth-child(4) .mode-icon { animation-delay: -2.1s; }
@keyframes icon-bob { 50% { transform: translateY(-5px) rotate(4deg); } }
.modes .card { transition: transform 0.2s, box-shadow 0.2s; }
.modes .card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,0.35); }
.card.featured { animation: featured-glow 2.2s ease-in-out infinite; }
@keyframes featured-glow { 50% { box-shadow: 0 0 0 4px rgba(255,203,43,0.35), 0 0 34px rgba(255,203,43,0.45), var(--shadow); } }

/* Avatares */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; object-fit: contain; }
.ranking .avatar { width: 34px; height: 34px; }
.ranking li { animation: row-in 0.35s ease-out both; }
.ranking li:nth-child(2) { animation-delay: 40ms; } .ranking li:nth-child(3) { animation-delay: 80ms; }
.ranking li:nth-child(4) { animation-delay: 120ms; } .ranking li:nth-child(5) { animation-delay: 160ms; }
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } }
.player-list .avatar, .podium .avatar { width: 36px; height: 36px; }
.chip .avatar { width: 22px; height: 22px; }
.chip { transition: transform 0.2s; }
.chip.done { animation: chip-done 0.35s ease-out; }
@keyframes chip-done { 50% { transform: scale(1.12); } }
.profile-avatar { display: block; width: 96px; height: 96px; margin: 0 auto 8px; animation: icon-bob 3s ease-in-out infinite; }

/* Preguntas y respuestas */
.fx-in { animation: card-in 0.35s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.option { transition: background 0.12s, border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
.option:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 0 #e2dcf2; border-color: var(--accent); }
.option.correct { animation: opt-correct 0.5s ease-out; box-shadow: 0 0 0 4px rgba(31,179,107,0.25); }
.option.wrong { animation: fx-shake 0.45s; }
@keyframes opt-correct { 40% { transform: scale(1.04); } }
.timer-bar.low { animation: timer-pulse 0.5s ease-in-out infinite alternate; }
@keyframes timer-pulse { to { filter: brightness(1.5); } }
.stat.streak.hot { animation: streak-fire 0.8s ease-in-out infinite alternate; box-shadow: 0 0 18px rgba(255,203,43,0.5); }
.stat.streak.hot::before { content: "🔥"; margin-right: 4px; }
@keyframes streak-fire { to { box-shadow: 0 0 28px rgba(255,140,0,0.75); } }
.countdown span { text-shadow: 0 0 30px rgba(255,203,43,0.7), 0 8px 0 #b38600; }
.result-score { text-shadow: 0 4px 0 #ddd3ff; }

/* Capa de partículas y efectos */
.fx-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
.fx-float { position: fixed; z-index: 95; pointer-events: none; font-weight: 1000; font-size: 1.6rem; color: var(--primary);
  text-shadow: 0 3px 0 #1b1035, 0 0 12px rgba(255,203,43,0.7); transform: translate(-50%, -50%); animation: fx-float 1.25s ease-out forwards; white-space: nowrap; }
.fx-float.bad { color: #ff6b6b; text-shadow: 0 3px 0 #1b1035; }
.fx-float.big { font-size: 2.2rem; }
@keyframes fx-float { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -180%) scale(1); } }
.fx-flash { position: fixed; inset: 0; z-index: 85; pointer-events: none; animation: fx-flash 0.55s ease-out forwards; }
.fx-flash.ok { background: radial-gradient(circle, rgba(31,179,107,0) 40%, rgba(31,179,107,0.45)); }
.fx-flash.bad { background: radial-gradient(circle, rgba(239,71,71,0) 40%, rgba(239,71,71,0.5)); }
.fx-flash.gold { background: radial-gradient(circle, rgba(255,203,43,0.15) 30%, rgba(255,203,43,0.5)); }
@keyframes fx-flash { from { opacity: 1; } to { opacity: 0; } }
.fx-big { position: fixed; left: 50%; top: 40%; z-index: 96; pointer-events: none; font-weight: 1000; font-size: clamp(2rem, 9vw, 3.4rem); color: var(--primary);
  text-align: center; line-height: 1.05; width: 92%; text-shadow: 0 5px 0 #1b1035, 0 0 26px rgba(255,203,43,0.6); -webkit-text-stroke: 2px #1b1035;
  transform: translate(-50%, -50%); animation: fx-big 1.45s cubic-bezier(.2,1.5,.4,1) forwards; }
.fx-big.bad { color: #ff6b6b; }
.fx-big.cool { color: #fff; }
@keyframes fx-big { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%) scale(0.9); } }
.fx-shake { animation: fx-shake 0.45s; }
@keyframes fx-shake { 15%, 55% { transform: translateX(-8px) rotate(-1deg); } 35%, 75% { transform: translateX(8px) rotate(1deg); } }
.fx-bump { animation: fx-bump 0.4s ease-out; }
@keyframes fx-bump { 40% { transform: scale(1.18); } }
.fx-enter { animation: fx-enter 0.5s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes fx-enter { from { opacity: 0; transform: translateY(22px) scale(0.97); } }

/* Conquista: mapa tipo isla sobre el mar */
.cq-map { border-radius: 18px; padding: 6px; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(124,77,255,0.35), transparent 70%),
    repeating-radial-gradient(circle at 30% 30%, rgba(255,255,255,0.04) 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #24205e, #1a1648);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.45); }
.cq-map::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 26px); animation: sea-move 14s linear infinite; }
@keyframes sea-move { to { background-position: 260px 0; } }
.cq-map svg { filter: drop-shadow(0 5px 0 rgba(10,6,30,0.55)); position: relative; z-index: 1; }
.cq-map .region { stroke: #1b1035; stroke-width: 1.6; }
.cq-map .region.free { fill: #4a3c7d; }
.cq-map .region:not(.free) { filter: saturate(1.1); }
.cq-map .castle .towers { font-size: 30px; stroke-width: 7px; letter-spacing: 2px; }
.cq-map .value { font-size: 32px; font-weight: 900; stroke: rgba(27,16,53,0.8); stroke-width: 6px; }
.cq-map .region.fx-captured { animation: region-captured 0.9s ease-out; }
@keyframes region-captured { 0% { stroke: #fff; stroke-width: 8; } 100% { stroke-width: 1.6; } }
.cq-map .castle-img { pointer-events: none; transform-box: fill-box; transform-origin: 50% 100%; animation: castle-bob 2.6s ease-in-out infinite; filter: drop-shadow(0 3px 0 rgba(0,0,0,0.4)); }
.cq-map .castle.fx-hit .castle-img { animation: castle-hit 0.6s ease-out; }
.cq-map .castle.dead .castle-img { filter: grayscale(1) brightness(0.6); animation: none; opacity: 0.8; }
@keyframes castle-bob { 50% { transform: translateY(-2px) scale(1.03); } }
@keyframes castle-hit { 20%, 60% { transform: translateX(-4px) rotate(-6deg); } 40%, 80% { transform: translateX(4px) rotate(6deg); } }
.cq-player { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; transition: transform 0.2s, border-color 0.2s; }
.cq-player .avatar { grid-row: span 3; width: 38px; height: 38px; }
.cq-player .top, .cq-player .sc, .cq-player .tw { min-width: 0; }
.cq-player.turn { animation: turn-glow 1s ease-in-out infinite alternate; }
@keyframes turn-glow { to { box-shadow: 0 0 16px rgba(255,203,43,0.6); transform: translateY(-2px); } }
.cq-player .sc.fx-bump { color: #fff; }
.podium li:first-child .avatar { animation: icon-bob 2s ease-in-out infinite; }

@media (max-width: 420px) {
  .logo img { height: 44px; }
  .cq-player { grid-template-columns: 1fr; }
  .cq-player .avatar { grid-row: auto; width: 30px; height: 30px; margin-bottom: 2px; }
  .mode-icon { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* =====================================================================
   Cuenta, monedas, tienda y comodines
   ===================================================================== */
.me-chip { gap: 6px; }
.me-chip .chip-avatar { width: 24px; height: 24px; margin: -3px 0 -3px -5px; }
.me-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-chip { flex: 0 0 auto; display: inline-flex; align-items: center; background: linear-gradient(180deg, #ffd64f, #f5b400); color: #3b2600; font-weight: 900; font-size: 0.9rem; padding: 7px 11px; border-radius: 99px; text-decoration: none; box-shadow: 0 3px 0 #b07c00; transition: transform 0.15s; }
.coin-chip:hover { transform: translateY(-1px); }
.coin-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 #b07c00; }
@media (max-width: 420px) { .header-actions .me-chip .chip-name { max-width: 70px; } }

/* Ventana de acceso */
.overlay.login { backdrop-filter: blur(3px); }
.login-card { text-align: center; animation: card-in 0.4s cubic-bezier(.2,1.4,.4,1) both; }
.login-art { width: 160px; height: auto; margin: -6px auto 2px; display: block; filter: drop-shadow(0 4px 0 rgba(27,16,53,0.25)); }
.login-card h2 { font-size: 1.5rem; margin: 4px 0 6px; }
.login-perks { list-style: none; padding: 0; margin: 4px 0 6px; text-align: left; display: grid; gap: 6px; }
.login-perks li { background: #f6f2ff; border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 0.95rem; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 2px solid #dadce0; box-shadow: 0 5px 0 #c4c7cc; }
.btn-google:active { box-shadow: 0 1px 0 #c4c7cc; }
.btn-google::after { animation: none; }
.g-logo { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 1000; color: #fff;
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.login-back { display: inline-block; margin-top: 12px; }
#entrar .btn { max-width: 340px; margin-left: auto; margin-right: auto; }

/* Monedas ganadas */
.coins-won { margin: 14px 0 4px; padding: 12px; border-radius: 16px; text-align: center; background: linear-gradient(180deg, #fff7d6, #ffeaa0); color: #6b4a00; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; }
.coins-won strong { font-size: 2rem; font-weight: 1000; color: #b37400; line-height: 1; }
.coins-won small { font-weight: 800; }
.coins-won .coins-note { flex-basis: 100%; margin: 2px 0 0; font-size: 0.85rem; font-weight: 700; color: #8a6400; }
.coins-won .coins-note:empty { display: none; }
.coin-big { font-size: 2rem; line-height: 1; display: inline-block; animation: coin-spin 2.4s ease-in-out infinite; }
@keyframes coin-spin { 0%, 70%, 100% { transform: rotateY(0); } 85% { transform: rotateY(180deg); } }

/* Comodines en partida */
.helper-bar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; }
.helper-btn { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; font: inherit; font-weight: 900; font-size: 0.9rem; padding: 8px 6px; border-radius: 12px;
  border: 2px solid #d9cdfb; background: #f3eeff; color: var(--accent); cursor: pointer; transition: transform 0.12s, background 0.12s; }
.helper-btn:hover:not(:disabled) { transform: translateY(-2px); background: #ebe2ff; }
.helper-btn:active:not(:disabled) { transform: scale(0.95); }
.helper-btn .i { font-size: 1.05rem; }
.helper-btn .l { white-space: nowrap; }
.helper-btn .n { background: var(--accent); color: #fff; border-radius: 99px; min-width: 20px; padding: 0 6px; font-size: 0.75rem; line-height: 20px; }
.helper-btn.empty { opacity: 0.6; }
.helper-btn.empty .n { background: #b3a9cc; }
.helper-btn.used, .helper-btn:disabled { opacity: 0.4; cursor: default; }
.helper-toast { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: #2b1d55; color: #fff; text-decoration: none; font-weight: 800; font-size: 0.85rem; padding: 8px 12px; border-radius: 10px; text-align: center; box-shadow: var(--shadow); z-index: 5; }
.option.removed { opacity: 0.25; text-decoration: line-through; transform: scale(0.97); border-style: dashed; }
.hint-line { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: #fff7d6; color: #6b4a00; font-weight: 800; animation: card-in 0.35s ease-out both; }

/* Tienda */
.shop-hero { display: grid; gap: 8px; background: linear-gradient(135deg, #3a2382, #1b1035); color: var(--text-light); border: 2px solid rgba(255,203,43,0.5); }
.shop-balance { display: flex; align-items: center; gap: 14px; }
.shop-balance .coin-big { font-size: 3rem; }
.shop-balance small { display: block; color: #cfc4f0; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.75rem; }
.shop-balance strong { font-size: 2.6rem; font-weight: 1000; color: var(--primary); line-height: 1; text-shadow: 0 3px 0 #1b1035; }
.shop-hero .shop-earn { color: #cfc4f0; margin: 0; font-size: 0.9rem; }
.shop-grid { display: grid; gap: 10px; }
.shop-item { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #f8f5ff; border: 2px solid #ece6ff; }
.shop-icon { grid-row: span 2; font-size: 2rem; width: 52px; height: 52px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #e2dcf2; }
.shop-info strong { display: block; }
.shop-info span { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.25; }
.shop-own { grid-column: 2; font-size: 0.8rem; font-weight: 800; color: var(--accent); }
.btn-buy { grid-column: 3; grid-row: 1 / span 2; width: auto; margin: 0; padding: 10px 14px; font-size: 1rem; white-space: nowrap; }
.btn-small { padding: 8px 10px; font-size: 0.9rem; margin-top: 8px; width: 100%; }
.avatar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 480px) { .avatar-grid { grid-template-columns: repeat(4, 1fr); } }
.avatar-item { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 8px; border-radius: 14px; background: #f8f5ff; border: 2px solid #ece6ff; transition: transform 0.15s; }
.avatar-item .avatar { width: 80px; height: 80px; }
.avatar-item.locked .avatar { filter: grayscale(0.85) brightness(0.9); }
.avatar-item.worn { border-color: var(--primary); background: #fff8de; }
.avatar-name { font-weight: 800; font-size: 0.85rem; margin-top: 4px; }
.avatar-tag { margin-top: 10px; font-weight: 900; color: #8a6400; font-size: 0.85rem; }
.center { text-align: center; }

/* Portada y perfil */
.shop-banner { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); background: linear-gradient(135deg, #fff7d6, #ffffff); border: 2px solid #ffe08a; transition: transform 0.2s; }
.shop-banner:hover { transform: translateY(-2px); }
.shop-banner strong { display: block; font-size: 1.1rem; }
.shop-banner span:nth-child(2) { color: var(--muted); font-size: 0.92rem; flex: 1; }
.shop-banner strong { color: var(--text); }
.shop-banner .go { font-size: 1.6rem; font-weight: 900; color: #c99500; }
.profile-coins { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff7d6; color: #6b4a00; text-decoration: none; font-weight: 800; padding: 10px 14px; border-radius: 12px; margin: 4px 0 14px; }
.profile-coins strong { font-size: 1.3rem; color: #b37400; }
.profile-coins .go { font-size: 0.85rem; color: var(--accent); }
.card h2 + .profile-coins { margin-top: 6px; }
.card:has(#p-avatar) h2 { text-align: center; }

/* =====================================================================
   SKIN DE JUEGO v2 · paneles con borde dorado, botones 3D, fondo ilustrado
   (va al final para sobrescribir el estilo «web» anterior)
   ===================================================================== */
:root {
  --text: #f5f1ff;
  --muted: #c3b6ec;
  --panel-1: #3a2577;
  --panel-2: #24164d;
  --gold-1: #ffe58a;
  --gold-2: #f5b400;
  --gold-3: #a86d00;
  --ink: #140a2e;
  --inset: rgba(10, 4, 30, 0.45);
  --line: rgba(255, 255, 255, 0.1);
  --radius: 22px;
}

/* Transiciones suaves entre páginas (Chrome, Edge, Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.22s ease-in both; }
::view-transition-new(root) { animation: vt-in 0.32s cubic-bezier(.2,.9,.3,1) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(0.985); filter: blur(2px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px) scale(1.01); } }
.site-header { view-transition-name: cabecera; }
::view-transition-group(cabecera) { animation-duration: 0.3s; }

/* Fondo ilustrado */
html { background: #140a2e; }
body {
  background:
    linear-gradient(180deg, rgba(20,10,46,0.25) 0%, rgba(20,10,46,0.55) 40%, rgba(20,10,46,0.9) 100%),
    url("/img/fondo-lobby.webp") center top / cover fixed no-repeat;
  background-color: #140a2e;
}
@supports (-webkit-touch-callout: none) { body { background-attachment: scroll; } }

/* Texto «de juego»: blanco con contorno y sombra */
.game-title, .card h2, .end-title, .hero h1, .center-screen h1, .question-text, .cq-panel h3 {
  text-shadow: 0 2px 0 var(--ink), 0 0 1px var(--ink);
}
.card h2 { font-size: 1.35rem; font-weight: 900; letter-spacing: 0.2px; }

/* Paneles */
.card, .question-card {
  color: var(--text);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.10), transparent 60%) padding-box,
    linear-gradient(180deg, var(--panel-1), var(--panel-2)) padding-box,
    linear-gradient(180deg, var(--gold-1), var(--gold-2) 45%, var(--gold-3)) border-box;
  border: 3px solid transparent;
  box-shadow: 0 0 0 3px var(--ink), 0 10px 0 -2px rgba(10,4,30,0.55), 0 18px 34px rgba(0,0,0,0.45), inset 0 2px 0 rgba(255,255,255,0.15);
}
.card p, .empty, .result-label, .reveal-note, .unit, .waiting-note, .or, .shop-info span, .avatar-name, .cq-panel .muted { color: var(--muted); }
.card.featured { border-width: 4px; }

/* Cinta para títulos destacados */
.ribbon {
  display: block; width: fit-content; max-width: 100%; margin: -40px auto 12px; padding: 10px 46px 18px; text-align: center;
  background: url("/img/cinta-roja.webp") center / 100% 100% no-repeat; color: #fff; font-weight: 1000; font-size: 1.25rem;
  text-shadow: 0 2px 0 #7a0d12, 0 0 2px #7a0d12; filter: drop-shadow(0 4px 0 rgba(10,4,30,0.5));
}
.card:has(> .ribbon) { margin-top: 38px; padding-top: 14px; }

/* Botones 3D */
.btn {
  position: relative; border: 3px solid var(--ink); border-radius: 18px; color: #fff; font-weight: 1000; letter-spacing: 0.3px;
  text-shadow: 0 2px 0 rgba(20,10,46,0.75), 0 0 2px rgba(20,10,46,0.6);
  background: linear-gradient(180deg, #ffe680 0%, #ffcb2b 45%, #f2a900 100%);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -4px 0 rgba(160,95,0,0.55), 0 6px 0 var(--ink), 0 10px 18px rgba(0,0,0,0.35);
  transition: transform 0.12s cubic-bezier(.3,1.6,.5,1), box-shadow 0.12s, filter 0.15s;
}
.btn::before { content: ""; position: absolute; left: 8%; right: 8%; top: 4px; height: 38%; border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0)); pointer-events: none; }
.btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.01); filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(5px) scale(0.98); box-shadow: inset 0 3px 0 rgba(255,255,255,0.45), inset 0 -2px 0 rgba(160,95,0,0.5), 0 1px 0 var(--ink), 0 2px 6px rgba(0,0,0,0.3); }
.btn-secondary {
  background: linear-gradient(180deg, #a98bff 0%, #7c4dff 50%, #5a2fd6 100%); color: #fff;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.4), inset 0 -4px 0 rgba(40,10,120,0.5), 0 6px 0 var(--ink), 0 10px 18px rgba(0,0,0,0.35);
}
.btn-secondary:active:not(:disabled) { box-shadow: inset 0 3px 0 rgba(255,255,255,0.35), 0 1px 0 var(--ink); }
.btn-green { background: linear-gradient(180deg, #7ff0b0 0%, #2fbf71 50%, #1d8f52 100%); }
.btn-danger { background: linear-gradient(180deg, #ff9a9d 0%, #e5484d 50%, #b42328 100%); }
.btn:disabled { filter: grayscale(0.6) brightness(0.8); }
.btn-google { color: #1f1f1f; text-shadow: none; background: linear-gradient(180deg, #fff, #eef0f3); }
.btn-google::before { display: none; }
.link-btn { color: var(--muted); }

/* Formularios */
select, input[type="text"] { background: var(--inset); border: 2px solid rgba(255,255,255,0.14); color: #fff; box-shadow: inset 0 3px 6px rgba(0,0,0,0.35); }
select option { color: #1b1035; }
input::placeholder { color: rgba(255,255,255,0.45); }
select:focus, input[type="text"]:focus { border-color: var(--primary); box-shadow: inset 0 3px 6px rgba(0,0,0,0.35), 0 0 0 3px rgba(255,203,43,0.25); }
label { color: #fff; }

/* Pestañas */
.tabs { background: var(--inset); box-shadow: inset 0 3px 6px rgba(0,0,0,0.35); }
.tab { color: var(--muted); }
.tab.active { background: linear-gradient(180deg, #ffe680, #f5b400); color: #3b2600; box-shadow: 0 3px 0 var(--ink); }

/* Listas y rankings */
.ranking li, .review li, .history li, .player-list li, .guesses li, .podium li { border-color: var(--line); }
.ranking .name, .podium .name { color: #fff; }
.ranking .pts, .podium .pts { color: var(--primary); }
.ranking li:nth-child(-n+3) { background: linear-gradient(90deg, rgba(255,203,43,0.14), transparent); border-radius: 12px; }
.podium li.me { background: linear-gradient(90deg, rgba(255,203,43,0.22), rgba(255,203,43,0.05)); }
.review .q { color: #fff; }
.review .yours { color: #ff8e91; }
.review .right { color: #6ff0a8; }
.history .when { color: var(--muted); }

/* Preguntas */
.question-cat { color: var(--primary); }
.question-text { color: #fff; }
.option {
  background: linear-gradient(180deg, #ffffff, #ece6ff); color: #1d1530; border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: inset 0 -3px 0 rgba(124,77,255,0.18), 0 4px 0 var(--ink);
}
.option:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 -3px 0 rgba(124,77,255,0.25), 0 6px 0 var(--ink); border-color: var(--ink); }
.option:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.option.mine { background: linear-gradient(180deg, #d9ccff, #b9a3ff); border-color: var(--ink); }
.option.correct { background: linear-gradient(180deg, #8ff5bd, #2fbf71); color: #053a1e; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(47,191,113,0.35), 0 4px 0 var(--ink); }
.option.wrong { background: linear-gradient(180deg, #ffb0b2, #e5484d); color: #4a0507; border-color: var(--ink); }
.option.removed { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.4); box-shadow: none; border-color: rgba(255,255,255,0.2); }
.option .tag-who { color: inherit; opacity: 0.8; }

/* Marcadores y temporizador */
.stat { background: linear-gradient(180deg, var(--panel-1), var(--panel-2)); border: 3px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 4px 0 var(--ink); }
.stat small { color: var(--muted); }
.stat.streak.hot::before { content: ""; display: inline-block; width: 20px; height: 18px; vertical-align: -2px; margin-right: 4px; background: url("/img/ic-racha.webp") center / contain no-repeat; }
.timer { height: 18px; border: 3px solid var(--ink); background: var(--inset); box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 3px 0 rgba(10,4,30,0.6); }
.timer-bar { background: linear-gradient(180deg, #ffe680, #f5b400); box-shadow: inset 0 2px 0 rgba(255,255,255,0.5); }
.timer-bar.low { background: linear-gradient(180deg, #ff9a9d, #e5484d); }
.result-score { color: var(--primary); text-shadow: 0 4px 0 var(--ink); font-size: 4rem; }
.result-stats div, .stats-grid div { background: var(--inset); color: #fff; box-shadow: inset 0 3px 6px rgba(0,0,0,0.3); }
.stats-grid div { color: var(--primary); }
.result-stats small, .stats-grid small { color: var(--muted); }
.rank-msg { color: #6ff0a8; }

/* Salas y Conquista */
.room-code { color: var(--primary); text-shadow: 0 3px 0 var(--ink); }
.seg button { background: var(--inset); border-color: rgba(255,255,255,0.14); color: #fff; }
.seg button.active { background: linear-gradient(180deg, #ffe680, #f5b400); color: #3b2600; border-color: var(--ink); }
.player-list .grow { color: #fff; }
.cq-player { background: linear-gradient(180deg, rgba(58,37,119,0.9), rgba(36,22,77,0.9)); border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(10,4,30,0.6); }
.cq-player.turn { border-color: var(--primary); }
.cq-map { background: url("/img/fondo-mar.webp") center / cover; border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--gold-2), 0 0 0 6px var(--ink), 0 14px 30px rgba(0,0,0,0.45), inset 0 0 50px rgba(0,0,0,0.35); }
.cq-map::after { opacity: 0.6; }
.answer-big { color: var(--primary); text-shadow: 0 3px 0 var(--ink); }
.who-answered span { background: var(--inset); color: var(--muted); }
.who-answered span.done { background: rgba(47,191,113,0.25); color: #8ff5bd; }

/* Insignias */
.mode-badge { border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }

/* Portada estilo «lobby» */
.hero { padding-top: 6px; }
.hero h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
.hero p { color: #e3dafc; text-shadow: 0 1px 2px var(--ink); }
.hero-art { -webkit-mask-image: none; mask-image: none; border-radius: 26px; border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--gold-2), 0 0 0 6px var(--ink), 0 16px 30px rgba(0,0,0,0.45); }
.modes .card { padding: 18px; }
.mode-head h2 { font-size: 1.45rem; }
.mode-icon { width: 72px; height: 72px; filter: drop-shadow(0 5px 0 rgba(10,4,30,0.55)); }
.rules { background: rgba(20,10,46,0.6); border-radius: 18px; padding: 6px 16px 12px; border: 2px solid var(--line); }
.rules summary { cursor: pointer; font-weight: 900; font-size: 1.1rem; color: #fff; padding: 10px 0; list-style: none; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: " ▾"; color: var(--primary); }
.rules[open] summary::after { content: " ▴"; }
.site-footer { color: #a99bd6; }

/* Monedas con icono propio */
.coin-chip { gap: 6px; padding: 5px 12px 5px 6px; border: 3px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,0.5), 0 3px 0 var(--ink); }
.coin-chip img { width: 22px; height: 22px; }
.coin-img { width: 1.4em; height: 1.4em; vertical-align: -0.3em; }
.coins-won { background: linear-gradient(180deg, rgba(255,203,43,0.22), rgba(255,203,43,0.08)); border: 2px solid rgba(255,203,43,0.5); color: #ffe58a; }
.coins-won strong { color: var(--primary); text-shadow: 0 3px 0 var(--ink); }
.coins-won .coins-note { color: #ffe58a; }
.coins-won .coin-big { font-size: 0; width: 44px; height: 44px; background: url("/img/ic-monedas.webp") center / contain no-repeat; }
.shop-balance .coin-big { font-size: 0; width: 72px; height: 72px; background: url("/img/ic-monedas.webp") center / contain no-repeat; }
.shop-banner .coin-big { font-size: 0; width: 54px; height: 54px; background: url("/img/ic-cofre-abierto.webp") center / contain no-repeat; }

/* Tienda en oscuro */
.shop-item, .avatar-item { background: var(--inset); border-color: rgba(255,255,255,0.1); }
.shop-icon { background: linear-gradient(180deg, var(--panel-1), var(--panel-2)); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.shop-info strong, .avatar-name { color: #fff; }
.shop-own { color: var(--primary); }
.avatar-item.worn { background: rgba(255,203,43,0.14); border-color: var(--primary); }
.avatar-tag { color: var(--primary); }
.shop-banner { background: linear-gradient(135deg, rgba(255,203,43,0.25), rgba(124,77,255,0.25)) padding-box, linear-gradient(180deg, var(--gold-1), var(--gold-3)) border-box; border: 3px solid transparent; color: #fff; }
.shop-banner strong { color: #fff; }
.shop-banner span:nth-child(2) { color: #e3dafc; }
.profile-coins { background: rgba(255,203,43,0.15); color: #ffe58a; }
.profile-coins strong { color: var(--primary); }
.profile-coins .go { color: #fff; }
.login-perks li { background: var(--inset); color: #fff; }
.helper-btn { background: linear-gradient(180deg, #a98bff, #7c4dff); color: #fff; border: 3px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 4px 0 var(--ink); text-shadow: 0 1px 0 var(--ink); }
.helper-btn:hover:not(:disabled) { background: linear-gradient(180deg, #b9a0ff, #8a5fff); }
.helper-btn .n { background: var(--primary); color: #3b2600; text-shadow: none; }
.helper-btn.empty .n { background: #8a7fb0; color: #fff; }
.error-box { background: rgba(229,72,77,0.2); color: #ffb0b2; border: 2px solid rgba(229,72,77,0.5); }
.prose, .prose p, .prose li { color: #e3dafc; }
.prose h1, .prose h2 { color: #fff; }
.prose a { color: var(--primary); }
.overlay { background: rgba(10, 4, 30, 0.7); }

/* Pantallas que entran con suavidad */
.screen-in { animation: screen-in 0.38s cubic-bezier(.2,.9,.3,1) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(18px) scale(0.985); } }

/* Spinner: moneda que gira */
.spinner { border: 0; width: 72px; height: 72px; background: url("/img/ic-moneda.webp") center / contain no-repeat; animation: coin-flip 1.1s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(10,4,30,0.5)); }
@keyframes coin-flip { 0% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(180deg) translateY(-10px); } 100% { transform: rotateY(360deg) translateY(0); } }

/* Mascota que aparece al acertar o fallar */
.fx-mascot { position: fixed; z-index: 94; right: 10px; bottom: -10px; width: 120px; height: auto; pointer-events: none; animation: mascot-pop 1.5s cubic-bezier(.2,1.4,.4,1) forwards; filter: drop-shadow(0 8px 10px rgba(0,0,0,0.4)); }
.fx-mascot.left { right: auto; left: 10px; }
@keyframes mascot-pop { 0% { transform: translateY(110%) rotate(-8deg); } 18% { transform: translateY(0) rotate(4deg); } 30% { transform: translateY(6%) rotate(-2deg); } 75% { transform: translateY(4%) rotate(0); } 100% { transform: translateY(120%); } }
.end-mascot { display: block; width: 150px; height: auto; margin: -70px auto 0; animation: end-mascot 0.6s cubic-bezier(.2,1.6,.4,1) both, icon-bob 2.4s 0.6s ease-in-out infinite; filter: drop-shadow(0 8px 8px rgba(0,0,0,0.4)); }
@keyframes end-mascot { from { transform: scale(0.2) translateY(40px); opacity: 0; } }
.card:has(> .end-mascot) { margin-top: 84px; }

@media (max-width: 420px) {
  .fx-mascot { width: 96px; }
  .ribbon { font-size: 1.1rem; padding: 9px 36px 16px; }
}
/* Mapa: tierra libre color arena para que destaque sobre el mar */
.cq-map .region.free { fill: #e6d3a3; }
.cq-map .region { stroke: #3b2a12; stroke-width: 1.8; }
.cq-map svg { filter: drop-shadow(0 6px 0 rgba(10,4,30,0.6)) drop-shadow(0 0 10px rgba(255,230,160,0.25)); }
.cq-map .frame { stroke: rgba(255,230,160,0.6); }

/* =====================================================================
   Conquista el mundo
   ===================================================================== */
.world-hero { display: flex; align-items: center; gap: 14px; }
.world-globe { width: 92px; height: auto; flex: 0 0 auto; animation: globe-spin 6s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(10,4,30,0.5)); }
@keyframes globe-spin { 50% { transform: rotate(-10deg) scale(1.05); } }
.world-hero h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 1000; }
.world-hero p { margin: 0; }
.world-tabs { margin-top: 18px; }
.country-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
@media (min-width: 520px) { .country-grid { grid-template-columns: repeat(3, 1fr); } }
.country-card {
  font: inherit; color: #fff; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px;
  border-radius: 18px; border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--panel-1), var(--panel-2));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 5px 0 var(--ink); animation: fx-enter 0.45s cubic-bezier(.2,1.3,.4,1) both;
  transition: transform 0.15s;
}
.country-card:hover { transform: translateY(-3px); }
.country-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.country-card.free { background: linear-gradient(180deg, #2d6b55, #173d31); }
.country-card.mine { background: linear-gradient(180deg, #7a5a12, #3d2c06); border-color: var(--primary); }
.country-card .flag { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 3px 0 rgba(10,4,30,0.5)); }
.country-card .nm { font-size: 1rem; text-shadow: 0 2px 0 var(--ink); }
.country-card .val { font-weight: 900; color: var(--primary); }
.country-card .who { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 800; color: #e3dafc; max-width: 100%; overflow: hidden; }
.country-card .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-card .who .avatar { width: 20px; height: 20px; }
.shields { display: flex; gap: 2px; }
.shields img { width: 16px; height: 16px; }
.shields img.off { filter: grayscale(1) opacity(0.35); }
.coin-tag { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; color: var(--primary); white-space: nowrap; }
.coin-tag .coin-img { width: 1.1em; height: 1.1em; }

.income-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--inset); border-radius: 14px; padding: 10px 12px; }
.income-row small { display: block; color: var(--muted); font-weight: 800; font-size: 0.75rem; text-transform: uppercase; }
.income-row strong { font-size: 1.5rem; }
.income-row .btn { width: auto; margin: 0; padding: 10px 18px; }
.mine-list { display: grid; gap: 8px; margin-top: 10px; }
.mine-row { font: inherit; color: #fff; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); cursor: pointer; }
.mine-row .flag { font-size: 1.6rem; }
.mine-row .nm { flex: 1; text-align: left; font-weight: 900; }
.mine-row .meta { font-size: 0.85rem; color: var(--muted); font-weight: 800; }

/* Ventanas tipo «hoja» */
.overlay.sheet { align-items: flex-end; padding: 0; }
.sheet-card { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 26px 26px 0 0; margin: 0; padding-top: 18px; animation: sheet-up 0.35s cubic-bezier(.2,1,.3,1) both; position: relative; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (min-width: 600px) { .overlay.sheet { align-items: center; padding: 16px; } .sheet-card { border-radius: 26px; } }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); background: rgba(255,255,255,0.12); color: #fff; font-size: 1.1rem; cursor: pointer; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; }
.flag.big { font-size: 3rem; line-height: 1; }
.owner-line { display: flex; align-items: center; gap: 6px; color: #fff !important; font-weight: 800; }
.owner-line .avatar { width: 30px; height: 30px; }
.study-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.study-list li { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--inset); }
.study-list li.base { grid-template-columns: 1fr; padding-right: 54px; border: 2px solid rgba(255,203,43,0.3); }
.study-list input { width: 22px; height: 22px; margin-top: 2px; accent-color: #ffcb2b; grid-row: span 2; }
.study-list .q { font-weight: 800; color: #fff; }
.study-list .a { color: #6ff0a8; font-weight: 800; font-size: 0.9rem; margin-top: 2px; }
.study-list .tag { position: absolute; right: 10px; top: 10px; font-size: 0.7rem; font-weight: 900; padding: 2px 8px; border-radius: 99px; background: var(--primary); color: #3b2600; }
.pick-count { font-weight: 900; color: #ffb0b2 !important; }
.pick-count.ok { color: #6ff0a8 !important; }

/* Pantalla de ataque */
.overlay.attack-screen { background: radial-gradient(circle at 50% 30%, rgba(229,72,77,0.25), rgba(10,4,30,0.92) 70%); }
.attack-card { width: 100%; max-width: 520px; }
.attack-top { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.attack-top .flag { font-size: 2rem; }
.attack-progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(8px, 1fr)); gap: 3px; margin: 10px 0 6px; }
.attack-progress span { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.15); }
.attack-progress span.done { background: #2fbf71; }
.attack-progress span.now { background: var(--primary); animation: timer-pulse 0.6s ease-in-out infinite alternate; }
.attack-card .question-text { margin: 14px 0; }

/* Conquista: elegir país aliado */
.ally-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.ally-row small { width: 100%; color: var(--muted); font-weight: 800; }
.ally-chip { font: inherit; font-weight: 900; font-size: 0.9rem; padding: 6px 10px; border-radius: 99px; border: 2px solid var(--ink); background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.ally-chip.on { background: linear-gradient(180deg, #ffe680, #f5b400); color: #3b2600; }
.world-banner .coin-big { background-image: url("/img/ic-mundo.webp") !important; }

/* ---------- Chat ---------- */
.chat-btn { position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.1); font-size: 1.1rem; cursor: pointer; line-height: 1; transition: transform 0.15s, background 0.15s; }
.chat-btn:hover { background: rgba(255,255,255,0.2); }
.chat-btn:active { transform: scale(0.88); }
.chat-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 0.7rem; font-weight: 900; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.chat-badge.static { position: static; box-shadow: none; flex: 0 0 auto; }
.chat-toast { position: fixed; top: 68px; right: 12px; left: auto; z-index: 70; max-width: min(340px, calc(100vw - 24px)); padding: 10px 14px; border: 1px solid rgba(255, 229, 138, 0.5); border-radius: 14px; background: linear-gradient(180deg, #3a2577, #24164d); color: var(--text-light); font: inherit; font-weight: 700; font-size: 0.9rem; text-align: left; box-shadow: var(--shadow); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(10, 4, 25, 0.55); }
.chat-panel { position: fixed; z-index: 81; left: 50%; bottom: 0; transform: translateX(-50%); width: min(520px, 100%); height: min(82vh, 680px); display: flex; flex-direction: column; background: linear-gradient(180deg, #3a2577 0%, #1f1342 100%); border: 2px solid rgba(255, 229, 138, 0.55); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); color: var(--text-light); overflow: hidden; animation: chat-up 0.28s cubic-bezier(.2,.9,.3,1.2); }
@keyframes chat-up { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-panel { animation: none; } }
html.chat-open, html.chat-open body { overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.chat-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; }
.chat-tab { position: relative; flex: 1; padding: 9px 6px; border: 0; border-radius: 12px; background: rgba(255,255,255,0.08); color: var(--text-light); font: inherit; font-weight: 800; font-size: 0.9rem; cursor: pointer; }
.chat-tab.on { background: linear-gradient(180deg, var(--gold-1, #ffe58a), var(--gold-2, #f5b400)); color: #3b2300; }
.chat-dot { position: absolute; top: 5px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.chat-close { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.1); color: var(--text-light); font-size: 1rem; cursor: pointer; }
.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-empty { margin: auto; padding: 24px 12px; text-align: center; opacity: 0.7; font-weight: 700; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-av { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; }
.chat-bubble { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: rgba(255,255,255,0.12); overflow-wrap: anywhere; cursor: pointer; }
.chat-bubble:focus-visible { outline: 2px solid var(--primary); }
.chat-msg.mine .chat-bubble { border-radius: 16px 16px 4px 16px; background: linear-gradient(180deg, #8f63ff, #6a3fe0); cursor: default; }
.chat-name { font-size: 0.75rem; font-weight: 900; color: #ffe58a; }
.chat-text { font-weight: 600; }
.chat-time { align-self: flex-end; font-size: 0.65rem; opacity: 0.6; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 4px 12px 2px; scrollbar-width: none; }
.chat-chip { flex: 0 0 auto; padding: 6px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--text-light); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.chat-note { margin: 4px 12px 0; font-size: 0.72rem; opacity: 0.65; text-align: center; }
.chat-composer { display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
.chat-input { flex: 1; min-width: 0; padding: 12px 14px; border: 2px solid rgba(255,255,255,0.15); border-radius: 999px; background: rgba(10,4,25,0.45); color: var(--text-light); font: inherit; font-size: 1rem; }
.chat-input:focus { outline: none; border-color: var(--primary); }
.chat-input:disabled { opacity: 0.6; }
.chat-counter { font-size: 0.75rem; font-weight: 800; opacity: 0.7; min-width: 0; }
.chat-send { flex: 0 0 auto; width: 46px; height: 46px; border: 0; border-radius: 50%; background: linear-gradient(180deg, #ffe58a, #f5b400); color: #3b2300; font-size: 1.2rem; font-weight: 900; cursor: pointer; }
.chat-send:disabled { filter: grayscale(1); opacity: 0.5; cursor: default; }
.chat-thread-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.chat-thread-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.1); color: var(--text-light); font-size: 1.1rem; cursor: pointer; }
.chat-more { padding: 6px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; background: transparent; color: var(--text-light); font: inherit; font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.chat-search { margin: 12px 12px 6px; padding: 11px 14px; border: 2px solid rgba(255,255,255,0.15); border-radius: 14px; background: rgba(10,4,25,0.45); color: var(--text-light); font: inherit; font-size: 1rem; }
.chat-people, .chat-convs { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 8px; }
.chat-person, .chat-conv { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 14px; background: rgba(255,255,255,0.07); color: var(--text-light); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.chat-person > span:not(.go) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-person .go { font-size: 0.8rem; color: #ffe58a; }
.chat-conv.unread { background: rgba(255, 229, 138, 0.14); }
.chat-conv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-conv-last { font-weight: 600; font-size: 0.85rem; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-settings { margin: 6px 12px 14px; padding: 10px 12px; border-radius: 14px; background: rgba(0,0,0,0.2); }
.chat-settings summary { cursor: pointer; font-weight: 800; }
.chat-toggle { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-weight: 700; cursor: pointer; }
.chat-toggle input { width: 20px; height: 20px; accent-color: #f5b400; }
.chat-sub { margin: 4px 0 8px; font-size: 0.85rem; opacity: 0.75; }
.chat-menu { position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; background: rgba(10,4,25,0.6); }
.chat-menu-card { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: linear-gradient(180deg, #4a2f92, #2a1a5c); }
.chat-menu-card .btn { width: 100%; }
.chat-menu-quote { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.chat-menu-title { margin: 0 0 4px; font-weight: 900; font-size: 1.1rem; text-align: center; }
.chat-cancel { padding: 10px; border: 0; background: transparent; color: var(--text-light); font: inherit; font-weight: 800; opacity: 0.8; cursor: pointer; }
.chat-flash { position: absolute; left: 12px; right: 12px; bottom: 80px; z-index: 3; padding: 10px 14px; border-radius: 12px; background: #1b1035; border: 1px solid rgba(255,229,138,0.5); font-weight: 700; font-size: 0.9rem; text-align: center; box-shadow: var(--shadow); }
/* ---------- Nombre único (perfil) ---------- */
.name-hint { font-size: 0.85rem; font-weight: 700; opacity: 0.8; margin: 8px 0 10px; }
.name-hint.ok { color: #6ff0a8; opacity: 1; }
.name-hint.bad { color: #ff8a8a; opacity: 1; }

/* =====================================================================
   Héroes
   ===================================================================== */
.hero-portrait { --s: 120px; position: relative; width: var(--s); height: var(--s); flex: 0 0 auto; }
.hero-portrait.size-sm { --s: 76px; }
.hero-portrait.size-lg { --s: 210px; }
.hero-portrait.size-xl { --s: 260px; }
.hero-frame { position: relative; z-index: 1; width: 100%; height: 100%; padding: calc(var(--s) * 0.045); border-radius: 50%; background: linear-gradient(145deg, #a0703f, #5b3a1c); box-shadow: 0 6px 18px rgba(0,0,0,0.45); }
.hero-img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #24164d; }
/* Armadura → marco */
.armor-hierro .hero-frame { background: linear-gradient(145deg, #b8bec7, #5d636c 55%, #9aa1ab); }
.armor-acero .hero-frame { background: linear-gradient(145deg, #dfe8f5, #6f86a6 50%, #c4d3e8); box-shadow: 0 0 0 3px #2b3b55, 0 6px 18px rgba(0,0,0,0.45); }
.armor-plata .hero-frame { background: linear-gradient(145deg, #ffffff, #b9c2cf 35%, #f4f7fb 60%, #8e98a6); box-shadow: 0 0 14px rgba(220,230,255,0.55), 0 6px 18px rgba(0,0,0,0.45); }
.armor-oro .hero-frame { background: linear-gradient(145deg, #fff3b0, #f5b400 40%, #ffe58a 60%, #a86d00); box-shadow: 0 0 18px rgba(255,203,43,0.65), 0 6px 18px rgba(0,0,0,0.45); }
.armor-mitril .hero-frame { background: linear-gradient(145deg, #e9fffd, #6fe3ff 40%, #ffffff 60%, #3aa7d6); box-shadow: 0 0 22px rgba(111,227,255,0.75), 0 6px 18px rgba(0,0,0,0.45); }
.armor-dragon .hero-frame { background: conic-gradient(from 20deg, #5a0b0b, #e5484d, #2b0505, #ff8a3d, #5a0b0b, #e5484d, #2b0505, #ff8a3d, #5a0b0b); box-shadow: 0 0 24px rgba(229,72,77,0.8), 0 6px 18px rgba(0,0,0,0.5); }
.armor-celestial .hero-frame { background: conic-gradient(#ffe58a, #ff8ad8, #8f63ff, #6fe3ff, #6ff0a8, #ffe58a); box-shadow: 0 0 30px rgba(255,255,255,0.8), 0 6px 18px rgba(0,0,0,0.5); animation: hero-spin 6s linear infinite; }
.armor-celestial .hero-img { animation: hero-spin 6s linear infinite reverse; }
/* Arma → aura */
.hero-aura { position: absolute; inset: -14%; z-index: 0; border-radius: 50%; pointer-events: none; opacity: 0; }
.aura-chispa .hero-aura { opacity: 1; background: radial-gradient(circle closest-side, rgba(255,229,138,0.7) 70%, transparent 100%); animation: hero-pulse 2.2s ease-in-out infinite; }
.aura-llamas .hero-aura { opacity: 1; background: radial-gradient(circle closest-side, rgba(255,138,61,0.9) 70%, rgba(229,72,77,0.45) 86%, transparent 100%); animation: hero-flicker 0.9s ease-in-out infinite alternate; }
.aura-escarcha .hero-aura { opacity: 1; background: radial-gradient(circle closest-side, rgba(170,230,255,0.85) 70%, rgba(80,160,255,0.4) 86%, transparent 100%); animation: hero-pulse 3s ease-in-out infinite; }
.aura-rayo .hero-aura { opacity: 1; background: conic-gradient(from 0deg, transparent, rgba(143,99,255,0.9), transparent 25%, rgba(111,227,255,0.9), transparent 50%, rgba(143,99,255,0.9), transparent 75%, rgba(111,227,255,0.9), transparent); -webkit-mask: radial-gradient(circle closest-side, transparent 72%, #000 80%, transparent 100%); mask: radial-gradient(circle closest-side, transparent 72%, #000 80%, transparent 100%); animation: hero-spin 1.6s linear infinite; }
.aura-arcano .hero-aura { opacity: 1; background: conic-gradient(#ff8ad8, #8f63ff, #ff8ad8, #8f63ff, #ff8ad8); -webkit-mask: radial-gradient(circle closest-side, transparent 72%, #000 82%, transparent 100%); mask: radial-gradient(circle closest-side, transparent 72%, #000 82%, transparent 100%); filter: blur(2px); animation: hero-spin 4s linear infinite; }
.aura-sol .hero-aura { inset: -26%; opacity: 1; background: repeating-conic-gradient(rgba(255,229,138,0.85) 0 6deg, transparent 6deg 18deg); -webkit-mask: radial-gradient(circle closest-side, transparent 60%, #000 68%, transparent 100%); mask: radial-gradient(circle closest-side, transparent 60%, #000 68%, transparent 100%); animation: hero-spin 12s linear infinite; }
@keyframes hero-spin { to { transform: rotate(360deg); } }
@keyframes hero-pulse { 0%, 100% { transform: scale(0.96); opacity: 0.7; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes hero-flicker { from { transform: scale(0.97); opacity: 0.75; } to { transform: scale(1.05); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-aura, .armor-celestial .hero-frame, .armor-celestial .hero-img { animation: none !important; } }
.hero-emblem { position: absolute; z-index: 2; left: -2%; bottom: 2%; width: calc(var(--s) * 0.3); height: calc(var(--s) * 0.3); display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4a2f92, #1b1035); border: 2px solid #ffe58a; font-size: calc(var(--s) * 0.16); box-shadow: 0 3px 8px rgba(0,0,0,0.5); }
.hero-level { position: absolute; z-index: 2; right: -2%; bottom: 2%; min-width: calc(var(--s) * 0.3); height: calc(var(--s) * 0.3); padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: linear-gradient(180deg, #ffe58a, #f5b400); color: #3b2300; border: 2px solid #3b2300; font-weight: 900; font-size: max(12px, calc(var(--s) * 0.15)); box-shadow: 0 3px 8px rgba(0,0,0,0.5); }
/* Tarjeta */
.hero-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; background: linear-gradient(160deg, #3a2577, #1f1342); border: 2px solid rgba(255,229,138,0.35); color: var(--text-light); }
.hero-card.you { border-color: #ffe58a; }
.hero-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-name { font-size: 1.15rem; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-title { color: #ffe58a; font-weight: 800; font-size: 0.9rem; }
.hero-kind { font-size: 0.85rem; opacity: 0.8; font-weight: 700; }
.hero-power { font-weight: 900; font-size: 0.95rem; }
/* Estandarte → fondo de la tarjeta */
.hero-card:has(.banner-bosque) { background: linear-gradient(160deg, #1f6b45, #0f2e22); }
.hero-card:has(.banner-volcan) { background: linear-gradient(160deg, #b8402a, #3a0f0a); }
.hero-card:has(.banner-oceano) { background: linear-gradient(160deg, #1e6fb8, #0b2340); }
.hero-card:has(.banner-aurora) { background: linear-gradient(160deg, #1fb38a, #6a3fe0 55%, #1b1035); background-size: 200% 200%; animation: hero-aurora 8s ease-in-out infinite alternate; }
@keyframes hero-aurora { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.hero-card.size-sm { flex-direction: column; text-align: center; gap: 6px; padding: 10px 6px; flex: 1; min-width: 0; }
.hero-card.size-sm .hero-info { align-items: center; width: 100%; }
.hero-card.size-sm .hero-name { font-size: 0.9rem; max-width: 100%; }
.hero-card.size-sm .hero-title, .hero-card.size-sm .hero-kind { font-size: 0.72rem; }
.hero-card.size-sm .hero-power { font-size: 0.8rem; }
/* Cara a cara */
.hero-versus { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.hero-versus > .hero-card.size-md { flex: 1; flex-direction: column; text-align: center; padding: 12px 8px; min-width: 0; }
.hero-versus > .hero-card.size-md .hero-info { align-items: center; width: 100%; }
.hero-versus > .hero-card.size-md .hero-portrait { --s: 104px; }
.hero-vs { flex: 0 0 auto; font-weight: 900; font-size: 1.3rem; color: #ffe58a; text-shadow: 0 2px 0 #a86d00, 0 0 12px rgba(255,203,43,0.6); }
/* XP al terminar */
.hero-xp { margin: 12px 0; padding: 12px 14px; border-radius: 16px; background: rgba(0,0,0,0.25); text-align: center; }
.hero-xp.up { background: linear-gradient(160deg, rgba(255,229,138,0.25), rgba(143,99,255,0.25)); border: 2px solid #ffe58a; }
.hero-xp-gain { display: block; font-size: 1.2rem; color: #8ff0ff; }
.hero-xp-bar { height: 10px; margin: 8px 0 4px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.hero-xp-bar span { display: block; height: 100%; background: linear-gradient(90deg, #6fe3ff, #8f63ff); transform-origin: left; transition: transform 0.8s ease; }
.hero-xp-level { font-size: 0.85rem; font-weight: 800; opacity: 0.85; }
.hero-xp-title { margin: 10px 0 4px; font-weight: 900; font-size: 1.1rem; color: #ffe58a; }
.hero-xp-reward { margin: 2px 0; font-weight: 800; }
.hero-xp-go { margin-top: 10px; }

/* ---------- Página del héroe ---------- */
.hero-create, .hero-sheet { text-align: center; }
.hero-create-title { margin: 0 0 6px; font-size: 1.8rem; }
.hero-create-sub, .hero-tip { opacity: 0.85; font-size: 0.92rem; margin: 0 0 12px; }
.hero-preview { display: flex; justify-content: center; margin: 10px 0; }
.hero-preview .hero-card, .hero-sheet-top .hero-card { flex-direction: column; text-align: center; width: 100%; }
.hero-preview .hero-info, .hero-sheet-top .hero-info { align-items: center; }
.hero-lore { font-style: italic; opacity: 0.85; font-size: 0.92rem; margin: 8px 4px 14px; }
.hero-step { margin: 18px 0 10px; font-size: 1.05rem; text-align: left; }
.hero-seg button { color: var(--text-light); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.hero-seg button.active { background: linear-gradient(180deg, #ffe58a, #f5b400); color: #3b2300; border-color: #ffe58a; }
.hero-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hero-choices.three { grid-template-columns: repeat(3, 1fr); }
.hero-choice { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 2px solid rgba(255,255,255,0.15); border-radius: 16px; background: rgba(255,255,255,0.06); color: var(--text-light); font: inherit; font-weight: 800; font-size: 0.85rem; cursor: pointer; transition: transform 0.15s, border-color 0.15s, background 0.15s; }
.hero-choice:active { transform: scale(0.95); }
.hero-choice.on { border-color: #ffe58a; background: rgba(255,229,138,0.15); box-shadow: 0 0 16px rgba(255,203,43,0.35); }
.hero-choice-img { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #24164d; }
.hero-create .btn { width: 100%; margin-top: 18px; }
.hero-create #c-cancel { margin-top: 8px; }
.hero-cost { margin: 8px 0 0; font-size: 0.85rem; opacity: 0.8; }
.hero-later { display: inline-block; margin-top: 12px; color: var(--text-light); opacity: 0.7; font-weight: 700; }
.hero-level-box { text-align: left; }
.hero-level-row { display: flex; justify-content: space-between; font-weight: 800; }
.hero-level-row strong { font-size: 1.2rem; color: #ffe58a; }
.hero-slot { margin: 12px 0 16px; }
.hero-slot-name { margin: 0 0 8px; font-size: 1rem; }
.hero-items { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.hero-item { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; min-width: 128px; padding: 10px 12px; border: 2px solid rgba(255,255,255,0.15); border-radius: 14px; background: rgba(255,255,255,0.07); color: var(--text-light); font: inherit; text-align: left; cursor: pointer; }
.hero-item.on { border-color: #ffe58a; background: rgba(255,229,138,0.16); cursor: default; }
.hero-item.locked { opacity: 0.45; cursor: not-allowed; }
.hero-item-name { font-weight: 900; font-size: 0.9rem; }
.hero-item-meta { font-size: 0.75rem; font-weight: 700; opacity: 0.8; }
.hero-road { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.hero-road-step { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.05); opacity: 0.75; }
.hero-road-step.done { opacity: 1; background: rgba(111,240,168,0.12); }
.hero-road-step.next { opacity: 1; background: rgba(255,229,138,0.16); border: 2px solid #ffe58a; }
.hero-road-level { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(180deg, #ffe58a, #f5b400); color: #3b2300; font-weight: 900; }
.hero-road-step:not(.done):not(.next) .hero-road-level { background: rgba(255,255,255,0.15); color: var(--text-light); }
.hero-road-items { font-weight: 700; font-size: 0.88rem; text-align: left; }
.hero-change { width: 100%; margin: 4px 0 16px; }
.hero-portrait.size-xs { --s: 44px; }
.hero-portrait.size-xs .hero-emblem { display: none; }
.hero-portrait.size-xs .hero-level { font-size: 10px; min-width: 18px; height: 18px; right: -6px; bottom: -4px; border-width: 1px; }
.tag.power { background: rgba(255,229,138,0.18); color: #ffe58a; }
.countdown { flex-direction: column; gap: 8px; }
.countdown .hero-versus { width: 100%; font-size: 1rem; margin: 0; }
.countdown .hero-versus span { animation: none; text-shadow: none; }
.countdown .hero-versus .hero-vs { text-shadow: 0 2px 0 #a86d00, 0 0 12px rgba(255,203,43,0.6); animation: pop-in 0.6s ease-out; }
.hero-banner { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text-light); background: linear-gradient(160deg, #4a2f92, #24164d); border: 2px solid rgba(255,229,138,0.55); }
.hero-banner.empty { animation: hero-call 2.4s ease-in-out infinite; }
@keyframes hero-call { 0%, 100% { box-shadow: 0 0 0 rgba(255,203,43,0); } 50% { box-shadow: 0 0 22px rgba(255,203,43,0.55); } }
.hero-banner-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.9rem; }
.hero-banner-txt strong { font-size: 1.1rem; }
.hero-banner .go { font-size: 1.4rem; font-weight: 900; color: #ffe58a; }
.hero-go { width: 100%; margin: 12px 0 0; }
.hero-vs { position: relative; z-index: 2; }

/* ---------- Fecha de nacimiento ---------- */
.age-card { text-align: center; }
.age-cake { font-size: 3.4rem; line-height: 1; margin: 4px 0 8px; }
.age-row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; margin: 18px 0; }
.age-row label { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: 0.85rem; text-align: left; }
.age-row select { padding: 12px 8px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.2); background: rgba(10,4,25,0.5); color: var(--text-light); font: inherit; font-size: 1rem; }
.age-card .btn { width: 100%; margin-top: 8px; }
.age-big { font-size: 1.4rem; font-weight: 900; color: #ffe58a; }
.age-warn { opacity: 0.8; font-weight: 700; }
.small-note { font-size: 0.85rem; opacity: 0.7; }
.birthday-pop { position: fixed; z-index: 90; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 24px 18px; border-radius: 22px; background: linear-gradient(160deg, #4a2f92, #24164d); border: 2px solid #ffe58a; box-shadow: 0 20px 60px rgba(0,0,0,0.6); text-align: center; color: var(--text-light); }
.birthday-pop strong { font-size: 1.5rem; }
.birthday-pop .btn { width: 100%; }

/* ---------- Modo +18 ---------- */
.x18-badge { display: inline-grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff6b8b, #b4123a); color: #fff; font-weight: 900; font-size: 1.6rem; border: 3px solid #ffd1dc; box-shadow: 0 0 24px rgba(255,80,120,0.55); }
.x18-badge.small { width: 46px; height: 46px; font-size: 1rem; margin: 0; flex: 0 0 auto; border-width: 2px; }
.x18-banner { background: linear-gradient(160deg, #7a1335, #2a0b1e); border-color: rgba(255,120,160,0.6); }
body.x18 { background: radial-gradient(circle at 20% 0%, #4a1030, #1b1035 60%); }
body.x18 .center-screen .btn { width: min(100%, 360px); margin: 6px auto; display: block; }
.x18-small { font-size: 0.85rem; opacity: 0.8; }
.x18-join { display: flex; gap: 8px; width: min(100%, 360px); margin: 14px auto 0; }
.x18-join input { flex: 1; min-width: 0; padding: 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.2); background: rgba(10,4,25,0.5); color: var(--text-light); font: inherit; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; text-align: center; }
.x18-join .btn { width: auto !important; margin: 0 !important; }
.x18-code { margin: 10px auto 16px; font-size: 2.6rem; font-weight: 900; letter-spacing: 0.3em; color: #ffd1dc; text-shadow: 0 0 18px rgba(255,80,120,0.6); }
.small-note a { color: #ffe58a; }

/* =====================================================================
   Campaña «Las Crónicas de Sapiencia»
   ===================================================================== */
.lore-hero { text-align: center; background: linear-gradient(160deg, #4a2f92, #1f1342); }
.lore-hero h1 { margin: 0 0 6px; font-size: 1.7rem; }
.lore-chapters { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.lore-extra-title { margin: 22px 0 4px; font-size: 1.1rem; opacity: 0.85; }
.lore-card { position: relative; display: flex; align-items: flex-end; gap: 10px; width: 100%; min-height: 128px; padding: 14px; border: 2px solid rgba(255,229,138,0.5); border-radius: 20px; overflow: hidden; color: #fff; font: inherit; text-align: left; cursor: pointer; background: #1f1342; box-shadow: var(--shadow); transition: transform 0.15s; }
.lore-card:active { transform: scale(0.98); }
.lore-card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 0.6s; }
.lore-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,10,40,0.05) 20%, rgba(20,10,40,0.92)); }
.lore-card:hover .lore-card-bg { transform: scale(1.05); }
.lore-card.locked { filter: grayscale(0.85) brightness(0.6); border-color: rgba(255,255,255,0.15); }
.lore-card.done { border-color: #6ff0a8; }
.lore-card-txt { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 2px 6px rgba(0,0,0,0.7); }
.lore-card-txt strong { font-size: 1.1rem; }
.lore-card-txt > span { font-size: 0.85rem; opacity: 0.9; }
.lore-card-progress { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: rgba(255,255,255,0.2); overflow: hidden; }
.lore-card-progress span { display: block; height: 100%; background: linear-gradient(90deg, #ffe58a, #f5b400); transform-origin: left; }
.lore-card-state { position: relative; z-index: 1; font-weight: 900; font-size: 1.1rem; background: rgba(0,0,0,0.45); padding: 6px 10px; border-radius: 999px; }
.lore-back { margin: 4px 0 10px; padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(255,255,255,0.1); color: var(--text-light); font: inherit; font-weight: 800; cursor: pointer; }
.lore-chapter-head { min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; border-radius: 22px; background-size: cover; background-position: center; border: 2px solid rgba(255,229,138,0.5); text-shadow: 0 2px 8px rgba(0,0,0,0.8); }
.lore-chapter-head h1 { margin: 0; font-size: 1.5rem; }
.lore-chapter-head p { margin: 4px 0 0; opacity: 0.9; }
.lore-path { list-style: none; margin: 18px 0; padding: 0 0 0 22px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.lore-path::before { content: ''; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: rgba(255,255,255,0.15); }
.lore-node-btn { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px 10px 0; border: 0; background: none; color: var(--text-light); font: inherit; text-align: left; cursor: pointer; }
.lore-node-icon { position: relative; z-index: 1; flex: 0 0 auto; width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; border-radius: 50%; background: #2a1a52; border: 3px solid rgba(255,255,255,0.25); font-size: 1.2rem; }
.lore-node.boss .lore-node-icon { width: 54px; height: 54px; margin-left: -27px; border-color: #ff8a8a; background: #4a1530; font-size: 1.5rem; }
.lore-node.done .lore-node-icon { border-color: #6ff0a8; }
.lore-node.next .lore-node-icon { border-color: #ffe58a; box-shadow: 0 0 0 6px rgba(255,229,138,0.2); animation: hero-pulse 1.8s ease-in-out infinite; }
.lore-node.locked { opacity: 0.45; }
.lore-node-txt { flex: 1; display: flex; flex-direction: column; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.07); }
.lore-node.next .lore-node-txt { background: rgba(255,229,138,0.14); }
.lore-node-txt small { opacity: 0.75; font-weight: 700; }
.lore-node-ok { position: absolute; right: 12px; color: #6ff0a8; font-weight: 900; font-size: 1.2rem; }
.lore-reward { text-align: center; font-weight: 800; color: #ffe58a; }
/* Escena y combate a pantalla completa */
html.lore-full, html.lore-full body { overflow: hidden; }
.lore-scene, .lore-battle { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; color: var(--text-light); }
.lore-scene-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(0.75); }
.lore-scene-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,10,40,0.2), rgba(20,10,40,0.85)); }
.lore-dialog { position: relative; z-index: 1; margin: auto 12px calc(16px + env(safe-area-inset-bottom)); padding: 16px; border-radius: 22px; background: linear-gradient(160deg, rgba(58,37,119,0.96), rgba(31,19,66,0.96)); border: 2px solid rgba(255,229,138,0.6); box-shadow: 0 -10px 40px rgba(0,0,0,0.5); max-width: 640px; align-self: center; width: calc(100% - 24px); }
.lore-speaker { display: flex; align-items: center; gap: 10px; margin: -46px 0 8px; min-height: 40px; }
.lore-speaker.narrator { margin-top: 0; min-height: 0; }
.lore-speaker strong { padding: 4px 12px; border-radius: 999px; background: #ffe58a; color: #3b2300; font-size: 0.95rem; }
.lore-speaker.villain strong { background: #ff8a8a; color: #3a0a12; }
.lore-speaker-img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid #ffe58a; background: #24164d; box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
.lore-speaker.villain .lore-speaker-img { border-color: #ff8a8a; }
.lore-speaker-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #2a1a52; border: 3px solid #ffe58a; font-size: 2rem; }
.lore-text { margin: 4px 0 14px; font-size: 1.12rem; line-height: 1.45; font-weight: 600; min-height: 3.2em; }
.lore-speaker.narrator + .lore-text { font-style: italic; }
.lore-next { width: 100%; }
.lore-skip { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top)); right: 12px; padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(0,0,0,0.45); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.lore-battle-in { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); overflow-y: auto; }
.lore-enemy { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 20px; background: rgba(20,10,40,0.7); border: 2px solid rgba(255,138,138,0.5); }
.lore-enemy-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid #ff8a8a; box-shadow: 0 0 22px rgba(255,80,120,0.4); background: #2a1a52; }
.lore-enemy-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.lore-enemy-info strong { font-size: 1.15rem; }
.lore-hp { display: flex; gap: 3px; }
.lore-hp span { flex: 1; height: 12px; border-radius: 3px; background: rgba(255,255,255,0.15); transition: background 0.3s; }
.lore-hp span.on { background: linear-gradient(180deg, #ff8a8a, #e5484d); }
.lore-battle-body { flex: 1; }
.lore-battle-body .card { margin: 0; }
.lore-intro { text-align: center; }
.lore-intro .btn { width: 100%; margin-top: 10px; }
.lore-intro-reward { font-weight: 900; color: #ffe58a; }
.lore-q .question-text { font-size: 1.15rem; }
.lore-me { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 20px; background: rgba(20,10,40,0.7); }
.lore-hearts { display: flex; gap: 6px; font-size: 1.6rem; }
.lore-hearts span { transition: transform 0.3s; }
.lore-hearts span:not(.on) { transform: scale(0.85); opacity: 0.7; }
.lore-banner { background: linear-gradient(160deg, #3a2577, #12324a); border-color: rgba(111,227,255,0.55); }
.armor-mecanica .hero-frame { background: conic-gradient(from 0deg, #b87333, #ffd27a, #8a5a2b, #ffd27a, #b87333, #6b4420, #b87333); box-shadow: 0 0 0 3px #3a2410, 0 0 16px rgba(255,180,90,0.5); }
.aura-marea .hero-aura { opacity: 1; background: conic-gradient(from 0deg, rgba(111,227,255,0.9), transparent 30%, rgba(31,179,160,0.9), transparent 60%, rgba(111,227,255,0.9), transparent 90%); -webkit-mask: radial-gradient(circle closest-side, transparent 72%, #000 82%, transparent 100%); mask: radial-gradient(circle closest-side, transparent 72%, #000 82%, transparent 100%); animation: hero-spin 3s linear infinite; }
.aura-niebla .hero-aura { inset: -22%; opacity: 1; background: conic-gradient(rgba(180,170,210,0.9), rgba(143,99,255,0.8), rgba(90,80,110,0.9), rgba(200,190,230,0.9), rgba(143,99,255,0.8), rgba(180,170,210,0.9)); -webkit-mask: radial-gradient(circle closest-side, transparent 60%, #000 72%, transparent 100%); mask: radial-gradient(circle closest-side, transparent 60%, #000 72%, transparent 100%); filter: blur(4px); animation: hero-spin 7s linear infinite; }
.hero-card:has(.banner-biblioteca) { background: linear-gradient(160deg, #6b3f1d, #2a1608); }
.lore-ico { flex: 0 0 auto; font-size: 2.2rem; line-height: 1; }

/* ---------- Entrar con correo ---------- */
.login-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; font-size: 0.85rem; font-weight: 700; opacity: 0.75; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: 0.35; }
.login-tabs { margin-bottom: 10px; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form input { padding: 12px 14px; border-radius: 12px; border: 2px solid #e2dcf2; font: inherit; font-size: 1rem; }
.login-form input[hidden] { display: none; }
.login-form .btn { margin-top: 4px; }
.login-note { margin: 10px 0 0; font-weight: 700; font-size: 0.9rem; line-height: 1.4; }
.login-note .link-btn, .login-error .link-btn { display: block; margin: 6px auto 0; }
.login-form input { background: rgba(10,4,25,0.55); color: var(--text-light); border-color: rgba(255,255,255,0.22); }
.login-form input::placeholder { color: #c3b6ec; opacity: 1; }
.login-form input:focus { outline: none; border-color: var(--primary); }

/* ---------- Reto diario ---------- */
.reto-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(160deg, #4a2f92, #1f1342); }
.reto-head h1 { margin: 0; font-size: 1.6rem; }
.reto-head p { margin: 2px 0 0; opacity: 0.8; font-weight: 700; }
.reto-streak { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 8px 10px; border-radius: 18px; background: linear-gradient(180deg, rgba(255,138,61,0.3), rgba(229,72,77,0.25)); border: 2px solid #ffb36b; }
.reto-streak.cold { filter: grayscale(1); opacity: 0.7; }
.reto-flame { font-size: 1.8rem; line-height: 1; animation: hero-flicker 0.9s ease-in-out infinite alternate; }
.reto-streak.cold .reto-flame { animation: none; }
.reto-streak strong { font-size: 1.6rem; line-height: 1.1; }
.reto-streak small { font-size: 0.7rem; font-weight: 800; opacity: 0.85; text-align: center; }
.reto-intro { text-align: center; }
.reto-intro h2 { margin: 0 0 10px; }
.reto-rules { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.reto-intro .btn { width: 100%; }
.reto-progress { display: flex; gap: 4px; margin-bottom: 10px; }
.reto-progress span { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.15); }
.reto-progress span.now { background: #ffe58a; }
.reto-progress span.ok { background: #1fb36b; }
.reto-progress span.ko { background: #ef4747; }
.reto-score { text-align: right; margin: 10px 0 0; font-weight: 800; }
.reto-result { text-align: center; }
.reto-grid { display: flex; justify-content: center; gap: 4px; font-size: 1.5rem; margin: 6px 0 12px; }
.reto-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.reto-stats div { display: flex; flex-direction: column; padding: 10px 4px; border-radius: 14px; background: rgba(0,0,0,0.25); }
.reto-stats strong { font-size: 1.4rem; color: #ffe58a; }
.reto-stats small { font-weight: 700; opacity: 0.8; }
.reto-rewards { font-weight: 900; color: #ffe58a; }
.reto-result .btn { width: 100%; }
.reto-next { margin: 12px 0 0; font-weight: 700; opacity: 0.8; }
.reto-board li.me { background: rgba(255,229,138,0.15); border-radius: 12px; }
.reto-board-ok { font-weight: 800; opacity: 0.75; font-size: 0.85rem; }
.reto-banner { background: linear-gradient(160deg, #6b2a12, #2a1608); border-color: rgba(255,179,107,0.6); }
.reto-banner .reto-flame { font-size: 2.2rem; flex: 0 0 auto; }
.reto-banner.pending { animation: hero-call 2.4s ease-in-out infinite; }
.hero-tier { font-weight: 900; font-size: 0.85rem; }
.tier-bronce { color: #e0a070; } .tier-plata { color: #d6dde8; } .tier-oro { color: #ffd34d; }
.tier-platino { color: #7fe0ff; } .tier-diamante { color: #b18cff; } .tier-maestro { color: #ff8ad8; }
.queue-tier { font-weight: 900; font-size: 1.1rem; color: #ffe58a; }
.challenge-icon { font-size: 3.4rem; line-height: 1; margin-bottom: 6px; }
#s-challenge .btn { width: min(100%, 360px); margin: 6px auto; display: block; }

/* =====================================================================
   Conquista: partida a pantalla completa (mapa + hoja de preguntas encima)
   ===================================================================== */
body.cq-playing { overflow: hidden; overscroll-behavior: none; }
body.cq-playing .container { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 6px; }
body.cq-playing .site-header { flex: none; padding: 2px 0 6px; }
body.cq-playing .logo img { height: 40px; }
body.cq-playing #s-game:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
body.cq-playing .cq-players { flex: none; }
.cq-stage { position: relative; }
body.cq-playing .cq-stage { flex: 1; min-height: 0; }
body.cq-playing .cq-stage .cq-map { position: absolute; inset: 0; padding: 40px 4px calc(var(--sheet-room, 0px) + 4px); transition: padding 0.3s ease; }
body.cq-playing .cq-map svg { width: 100%; height: 100%; max-height: none; }
.cq-stage .cq-event { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 3; margin: 0; padding: 5px 14px;
  width: max-content; max-width: 92%; font-size: 0.85rem; line-height: 1.25; background: rgba(20,10,45,0.82); border: 2px solid rgba(255,203,43,0.5); border-radius: 99px; box-shadow: 0 4px 10px rgba(0,0,0,0.35); }
.cq-stage .cq-event:empty { display: none; }
body.cq-playing .cq-sheet { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 4; max-height: 76%; display: flex; flex-direction: column; }
.cq-sheet .timer { flex: none; margin: 0 0 6px; }
body.cq-playing .cq-sheet .cq-panel { margin: 0; min-height: 0; overflow-y: auto; padding: 12px 14px; background: rgba(33,20,72,0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 -6px 24px rgba(0,0,0,0.45), 0 4px 0 rgba(10,4,30,0.6); }
body.cq-playing .cq-sheet .cq-panel h3 { font-size: 1.02rem; line-height: 1.3; }
body.cq-playing .cq-sheet .options { gap: 7px; }
body.cq-playing .cq-sheet .option { padding: 10px 12px; font-size: 0.95rem; }
body.cq-playing #s-game.picking .cq-sheet .cq-panel { padding: 9px 12px; }
body.cq-playing #s-game.picking .cq-sheet .cq-panel h3 { font-size: 0.95rem; margin-bottom: 2px; }
body.cq-playing .cq-attrib { flex: none; margin: 0; font-size: 0.6rem; }
body.cq-playing .cq-player { padding: 4px 6px; }

/* Mapa tipo maqueta: espuma en la costa, grosor, relieve y brillo */
.cq-map, .cq-map * { -webkit-tap-highlight-color: transparent; }
.cq-map svg { overflow: visible; filter: drop-shadow(0 12px 14px rgba(0,0,0,0.45)); }
.cq-map path:focus { outline: none; }
.cq-map .coast path { fill: rgba(255,255,255,0.25); stroke: rgba(225,245,255,0.55); stroke-width: 13; stroke-linejoin: round; }
.cq-map .extrude path { fill: #6b4a22; stroke: #3e2a10; stroke-width: 2; stroke-linejoin: round; }
.cq-map .region { stroke: rgba(74,48,16,0.6); stroke-width: 1.5; stroke-linejoin: round; transition: transform 0.25s, filter 0.25s; }
.cq-map .region.mine { stroke: rgba(255,255,255,0.75); stroke-width: 2.2; }
.cq-map .shine path { fill: none; stroke: rgba(255,255,255,0.4); stroke-width: 1.1; stroke-linejoin: round; pointer-events: none; }
.cq-map .region.pickable { stroke: #ffd23f; stroke-width: 5; cursor: pointer; filter: brightness(1.12); animation: cq-lift 0.9s ease-in-out infinite alternate; }
@keyframes cq-lift { from { transform: translateY(-2px); stroke-opacity: 1; } to { transform: translateY(-8px); stroke-opacity: 0.55; } }
.cq-map .region.target { stroke: #ff4d4d; stroke-width: 6; animation: cq-flash 0.6s ease-in-out infinite alternate; }
.cq-map .region.fx-captured { animation: region-captured 0.9s ease-out; }
@keyframes region-captured { 0% { stroke: #fff; stroke-width: 9; transform: translateY(-10px); } 100% { stroke-width: 1.5; transform: none; } }
.cq-map .castle-shadow { fill: rgba(10,4,30,0.45); }
.cq-map .castle .pip { fill: rgba(27,16,53,0.75); stroke: #1b1035; stroke-width: 3; }
.cq-map .castle .pip.on { fill: #ffcb2b; }
.cq-map .castle.dead .pip { fill: #555; }
.cq-map g.value rect { fill: rgba(27,16,53,0.88); stroke: #ffcb2b; stroke-width: 3; }
.cq-map g.value text { font-size: 38px; font-weight: 900; fill: #fff; stroke: none; text-anchor: middle; dominant-baseline: central; }
.cq-map g.value { pointer-events: none; stroke: none; }
.cq-map .swords { font-size: 46px; text-anchor: middle; dominant-baseline: central; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: swords 0.7s ease-in-out infinite alternate; }
@keyframes swords { from { transform: scale(0.9) rotate(-8deg); } to { transform: scale(1.15) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) {
  .cq-map .region.pickable, .cq-map .swords { animation: none; }
}
.cq-map .castle-halo { opacity: 0.55; }
.cq-map .castle.dead .castle-halo { opacity: 0.15; }

/* Conquista con amigos: sala de espera */
.lobby-members { list-style: none; padding: 0; margin: 12px auto; width: min(100%, 360px); display: grid; gap: 8px; }
.lobby-members li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; border: 3px solid var(--ink); background: linear-gradient(180deg, rgba(58,37,119,0.9), rgba(36,22,77,0.9)); font-weight: 800; text-align: left; }
.lobby-members li.empty { opacity: 0.55; border-style: dashed; }
.lobby-members .avatar, .lobby-members .slot { width: 36px; height: 36px; flex: none; }
.lobby-members .slot { display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.1); font-weight: 900; }
.lobby-members .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-members .tag { font-size: 0.75rem; color: var(--primary); }
#s-cq-lobby .btn { width: min(100%, 360px); margin: 6px auto; display: block; }

/* Liga semanal */
.league-sub { text-align: center; margin: 0 0 8px; }
.league-me { text-align: center; font-weight: 900; color: var(--primary); margin: 0 0 6px; }
.league .ranking li.me { background: rgba(255,203,43,0.12); border-radius: 10px; }
.league .ranking .prize { font-size: 0.8rem; font-weight: 900; color: var(--primary); white-space: nowrap; }
.league-prizes { font-size: 0.8rem; text-align: center; margin: 8px 0 0; color: var(--muted); }
.league-won { display: grid; gap: 6px; text-align: center; padding: 12px; margin-bottom: 10px; border-radius: 14px; border: 3px solid var(--primary); background: rgba(255,203,43,0.12); }
.league-won strong { font-size: 1.2rem; color: var(--primary); }
.league-won .btn { width: auto; justify-self: center; margin-top: 4px; }
