﻿:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-2: #0b1220;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #38bdf8;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 20px 50px rgba(0,0,0,0.28);
  --radius: 22px;
  --header-height: 74px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

body.mobile-menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* NAVBAR */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.site-header.header-hidden {
  transform: translateY(-100%);
  opacity: 0;
}

.navbar {
  max-width: var(--container);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-brand {
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.navbar-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.navbar-nav a {
  text-decoration: none;
  color: var(--muted);
}

.navbar-nav a:hover {
  color: var(--text);
}

.navbar-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

/* SELECTOR */
.selector {
  position: relative;
}

.selected {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font: inherit;
}

.selected img,
.options button img {
  width: 20px;
  height: 14px;
  object-fit: cover;
}

.options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow);
  display: none;
}

.options.open {
  display: block;
}

.options button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font: inherit;
}

.options button:hover {
  background: rgba(255,255,255,0.08);
}

/* HAMBURGUESA */
.floating-menu-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  z-index: 1280;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}

.floating-menu-btn:hover {
  background: var(--primary-hover);
}

.floating-menu-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.floating-menu-btn span {
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
}

.floating-menu-btn-left {
  top: 16px;
  left: 16px;
}

/* PANEL MÓVIL */
.mobile-panel {
  position: fixed;
  top: 0;
  height: 100vh;
  width: min(360px, 88vw);
  background: #111827;
  transition: transform 0.28s ease;
  z-index: 1300;
  box-shadow: var(--shadow);
}

.mobile-panel-left {
  left: 0;
  transform: translateX(-100%);
}

.mobile-panel.open.mobile-panel-left,
.mobile-panel.open {
  transform: translateX(0);
}

.mobile-panel-inner {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mobile-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-close-btn {
  border: 0;
  background: transparent;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav a {
  text-decoration: none;
  color: var(--muted);
}

.mobile-label {
  margin: 0 0 10px;
  color: var(--muted);
}

.selector-mobile .options {
  position: absolute;
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: auto;
  width: 100%;
  min-width: 0;
  max-height: min(320px, 52vh);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1400;
}


.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.58);
  z-index: 1290;
}

.mobile-overlay[hidden] {
  display: none !important;
}

/* PAGE */
.page-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-brand,
.hero-timer-card,
.intro-card,
.game-card,
.stats {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-brand {
  padding: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(30px, 5vw, 46px);
}

.hero-copy,
.section-copy,
.feedback {
  color: var(--muted);
  line-height: 1.65;
}

.hero-timer-card {
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timer-label {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.timer-value {
  font-size: 48px;
  font-weight: 700;
}

.container {
  display: grid;
  gap: 24px;
}

.top-bar {
  display: flex;
  justify-content: flex-end;
}

.modes-wrap {
  width: 100%;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

.modes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-btn,
.botones button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.mode-btn.active {
  background: var(--primary);
  border-color: transparent;
}

.intro-card,
.game-card,
.stats {
  padding: 24px;
}

.intro-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.score-chip {
  min-width: 180px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  text-align: center;
}

.score-chip span {
  display: block;
  color: var(--muted);
}

.score-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.question-type,
.question-number {
  color: var(--muted);
}

.question-box {
  margin-bottom: 18px;
}

.question-word {
  min-height: 110px;
  border-radius: 18px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  text-align: center;
  padding: 18px;
  background: rgba(255,255,255,0.03);
}

.question-word-start {
  cursor: pointer;
}

.question-word.disabled {
  cursor: default;
}

.answer-area label {
  display: inline-block;
  margin-bottom: 10px;
}

.answer-area input {
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
}

.feedback {
  min-height: 24px;
  margin: 12px 0 0;
}

.feedback.ok {
  color: #22c55e;
}

.feedback.error {
  color: #f97316;
}

.botones {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.botones button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.section-heading h2,
.intro-card h2 {
  margin: 0 0 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-box {
  border: 1px solid var(--border);
  border-radius: 18px;
  min-height: 112px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-box h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: clamp(13px, 1.4vw, 14px);
  font-weight: 600;
  line-height: 1.25;
}

.stat-box p {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

/* REVISIÓN */
.review-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  min-width: 0;
}

.review-card.correct {
  background: rgba(34, 197, 94, 0.05);
}

.review-card.incorrect {
  background: rgba(239, 68, 68, 0.05);
}

.review-card-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.review-card-number {
  font-weight: 700;
  color: var(--text);
}

.review-card-form {
  color: var(--muted);
  font-size: 0.9rem;
}

.review-card-question {
  min-height: 44px;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.review-card-answer-wrap {
  display: block;
}

.review-answer-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.review-answer-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.review-answer-btn:disabled {
  cursor: default;
  opacity: 1;
}

.review-answer-btn.good {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
  color: #22c55e;
}

.review-answer-btn.bad {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}

.review-answer-btn.reveal {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
}

/* TIMER FLOTANTE */
.floating-timer {
  position: fixed;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(11, 18, 32, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 1090;
}

.floating-timer.hidden {
  display: none;
}

.floating-timer-ring {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 8;
}

.ring-progress {
  fill: none;
  stroke: #22c55e;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.floating-timer-content {
  display: flex;
  flex-direction: column;
}

.floating-timer-label {
  font-size: 12px;
  color: var(--muted);
}

#floating-timer-text {
  font-size: 20px;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .review-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading,
  .intro-card {
    flex-direction: column;
    align-items: start;
  }

  .review-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 979px) {
  .navbar-actions {
    display: none;
  }

  .app-tabs-shell {
    padding-top: 10px;
  }

  .floating-menu-btn {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .floating-menu-btn:not(.visible) {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .review-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .floating-menu-btn,
  .mobile-panel,
  .mobile-overlay {
    display: none !important;
  }

  .site-header.header-hidden {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 20px 16px 80px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .question-word {
    min-height: 92px;
    font-size: 34px;
  }

  .review-cards {
    grid-template-columns: 1fr;
  }

  .review-card {
    padding: 12px;
  }

  .review-answer-btn {
    padding: 9px 10px;
  }
}

.card-layer.card-front.is-leaving {
  opacity: 0;
  transform: translateX(80px) rotate(4deg) scale(0.98);
}


