@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap");

:root {
  --bg: #0e1a3a;
  --bg2: #17295c;
  --card: #1e3372;
  --card2: #26408a;
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f4f7ff;
  --muted: #a9b6da;
  --accent: #2ee6c5;
  --accent-ink: #062a24;
  --ok: #2ecc71;
  --bad: #ff5d6c;
  --c0: #ff6b5b;
  --c1: #14a99a;
  --c2: #e8961a;
  --c3: #c9449a;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Fredoka, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg) radial-gradient(1200px 800px at 15% -10%, #1f3c8a 0%, var(--bg) 60%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }

/* burbujas de fondo */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubbles span {
  position: absolute; bottom: -60px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.03);
  animation: rise linear infinite;
}
@keyframes rise { to { transform: translate(24px, -120vh); } }
@media (prefers-reduced-motion: reduce) { .bubbles span { animation: none; display: none; } }

.wrap { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 460px; }

.logo { font-weight: 700; font-size: 28px; letter-spacing: -0.5px; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.logo b { color: var(--accent); font-weight: 700; }
.logo .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 10px -8px 0 -3px var(--accent), 18px 2px 0 -5px var(--accent); margin-right: 14px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.card { background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(6px); }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.15; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 600; font-size: 17px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, #000);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:active { transform: none; }
.btn.danger { background: var(--bad); color: #fff; box-shadow: 0 4px 0 #a3303c; }
.btn.small { padding: 8px 12px; font-size: 15px; border-radius: 10px; }
.btn.big { padding: 16px 28px; font-size: 22px; }
.btn.block { width: 100%; }

.input, select.input, textarea.input {
  width: 100%; background: rgba(0, 0, 0, 0.25); border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 18px; outline: none;
}
.input:focus { border-color: var(--accent); }
.input.pin { font-size: 32px; text-align: center; letter-spacing: 8px; font-weight: 700; }
label.lbl { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.err { color: #ffb3ba; min-height: 1.2em; }

/* botones de respuesta */
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans {
  position: relative; border: 0; border-radius: 14px; padding: 18px 16px; min-height: 96px;
  color: #fff; font-weight: 600; font-size: 20px; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}
.ans:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.ans svg { flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.ans.c0 { background: var(--c0); } .ans.c1 { background: var(--c1); }
.ans.c2 { background: var(--c2); } .ans.c3 { background: var(--c3); }
.ans.dim { opacity: 0.28; }
.ans.picked { outline: 4px solid #fff; outline-offset: 2px; }
.ans .tick { margin-left: auto; font-size: 28px; }

/* temporizador */
.timer { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 700; background: conic-gradient(var(--accent) calc(var(--p, 1) * 360deg), rgba(255, 255, 255, 0.12) 0); position: relative; flex: none; }
.timer::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg2); }
.timer span { position: relative; }
.bar { height: 8px; background: rgba(255, 255, 255, 0.12); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--card2); font-weight: 500; font-size: 18px; animation: pop 0.25s ease-out; }
.chip.off { opacity: 0.45; }
button.chip { border: 0; cursor: pointer; }
button.chip:hover { background: var(--bad); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

.status { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); background: var(--bad); color: #fff; padding: 8px 16px; border-radius: 99px; z-index: 50; font-size: 15px; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card2); border-radius: 12px; margin-bottom: 8px; font-size: 22px; animation: pop 0.3s ease-out both; }
.rank-list .pos { width: 36px; font-weight: 700; color: var(--accent); }
.rank-list .pts { margin-left: auto; font-weight: 700; }
.rank-list .delta { color: var(--accent); font-size: 16px; }

.big-mark { font-size: 96px; line-height: 1; }

@media (max-width: 560px) {
  .answers { grid-template-columns: 1fr; }
  .ans { min-height: 72px; font-size: 18px; }
}
