/* ============================================================
   CubanGuesser — Styles
   Branding propio: colores bandera cubana, diferente a Manguito
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap');

:root {
  --bg: #faf6f0;
  --bg-card: #ffffff;
  --bg-dark: #1a1a2e;
  --blue: #0050a0;
  --blue-light: #1a6fc4;
  --red: #cc1229;
  --red-light: #e8293f;
  --white: #ffffff;
  --sand: #e8e0d6;
  --sand-dark: #d4c8b8;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --green: #22c55e;
  --orange: #f97316;
  --gold: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --transition: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Header ---- */
.header {
  background: var(--blue);
  color: var(--white);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,80,160,0.3);
}

.header__logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--white);
}

.header__logo span {
  color: var(--red-light);
}

.header__stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.header__stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.9;
}

.header__nav {
  display: flex;
  gap: 0.5rem;
}

.header__nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.header__nav a:hover,
.header__nav a.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

/* ---- Landing Screen ---- */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem;
  text-align: center;
}

.landing__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.landing__title span {
  color: var(--red);
}

.landing__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
}

.landing__plays {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.landing__plays strong {
  color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,80,160,0.3);
}

.btn--primary:hover {
  background: var(--blue-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,80,160,0.4);
}

.btn--primary:disabled {
  background: var(--sand-dark);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--secondary {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn--secondary:hover {
  background: var(--blue);
  color: var(--white);
}

.btn--red {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(204,18,41,0.3);
}

.btn--red:hover {
  background: var(--red-light);
}

.btn--small {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

/* ---- Game Layout ---- */
.game {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.game.active {
  display: block;
}

.game__top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.game__round-info {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--blue);
}

.game__score {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.game__score span {
  color: var(--gold);
}

.game__content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ---- Photo Panel ---- */
.photo-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.photo-panel__img-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--sand);
  position: relative;
}

.photo-panel__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-panel__info {
  padding: 1rem;
}

.photo-panel__name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.photo-panel__name.hidden-name {
  color: var(--text-muted);
  font-style: italic;
}

.photo-panel__hints {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.photo-panel__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  background: #f3f0ec;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.photo-panel__hint::before {
  content: '?';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.photo-panel__hint.revealed::before {
  content: '!';
  background: var(--green);
}

/* ---- Map Container ---- */
.map-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  position: relative;
}

.map-container__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  text-align: center;
}

#cuba-map {
  width: 100%;
  height: auto;
  display: block;
}

#cuba-map .province-path {
  fill: var(--sand);
  stroke: #fff;
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.2s, filter 0.2s;
}

#cuba-map .province-path:hover {
  fill: var(--sand-dark);
  filter: drop-shadow(0 0 6px rgba(0,80,160,0.25));
}

#cuba-map .province-path.selected {
  fill: var(--blue-light);
  stroke: var(--blue);
  stroke-width: 2.5;
}

#cuba-map .province-path.correct {
  fill: var(--green);
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(34,197,94,0.4));
}

#cuba-map .province-path.wrong {
  fill: var(--orange);
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(249,115,22,0.4));
}

#cuba-map .province-path.dimmed {
  fill: #e8e4df;
  opacity: 0.5;
  cursor: default;
}

#cuba-map .distance-line {
  stroke: var(--red);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  fill: none;
  opacity: 0;
  transition: opacity 0.5s;
}

#cuba-map .distance-line.visible {
  opacity: 1;
}

#cuba-map .province-label {
  font-size: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  fill: var(--text);
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#cuba-map .province-label.visible {
  opacity: 1;
}

/* Province tooltip */
.map-tooltip {
  position: absolute;
  background: var(--bg-dark);
  color: var(--white);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  white-space: nowrap;
}

.map-tooltip.visible {
  opacity: 1;
}

/* Confirm button */
.map-container__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* ---- Round Result Overlay ---- */
.round-result {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.round-result.active {
  display: flex;
}

.round-result__card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.round-result__score {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.25rem;
}

.round-result__score.perfect {
  color: var(--green);
}

.round-result__label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.round-result__province {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.round-result__distance {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.round-result__ad {
  margin: 1rem 0;
  min-height: 90px;
}

/* ---- Game Over ---- */
.game-over {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.game-over.active {
  display: flex;
}

.game-over__card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.game-over__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.game-over__total {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.game-over__max {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.game-over__stars {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.game-over__breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.game-over__round-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f9f7f4;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.game-over__round-row .province {
  font-weight: 600;
}

.game-over__round-row .score {
  font-weight: 700;
  color: var(--blue);
}

.game-over__round-row .score.perfect {
  color: var(--green);
}

.game-over__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Daily Limit Screen ---- */
.daily-limit {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem;
  text-align: center;
}

.daily-limit.active {
  display: flex;
}

.daily-limit__icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.daily-limit__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.daily-limit__text {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 400px;
}

.daily-limit__countdown {
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

/* ---- Ad Containers ---- */
.ad-container {
  max-width: 728px;
  margin: 1.5rem auto;
  text-align: center;
  min-height: 90px;
}

.ad-container--sidebar {
  max-width: 300px;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid #eae6e0;
  margin-top: 2rem;
}

.footer a {
  color: var(--blue);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ---- Score Animation ---- */
@keyframes scorePopIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.score-anim {
  animation: scorePopIn 0.5s ease-out;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeSlideUp 0.4s ease-out;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .game__content {
    grid-template-columns: 1fr;
  }

  .photo-panel {
    display: grid;
    grid-template-columns: 140px 1fr;
  }

  .photo-panel__img-wrap {
    aspect-ratio: 1;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 0 1rem;
    height: 52px;
  }

  .header__logo {
    font-size: 1.2rem;
  }

  .header__nav {
    display: none;
  }

  .game {
    padding: 0.75rem;
  }

  .game__content {
    gap: 0.75rem;
  }

  .photo-panel {
    grid-template-columns: 110px 1fr;
  }

  .map-container {
    padding: 0.75rem;
  }

  .round-result__card,
  .game-over__card {
    padding: 1.25rem;
  }

  .round-result__score {
    font-size: 2.5rem;
  }

  .game-over__total {
    font-size: 2.5rem;
  }

  .landing__title {
    font-size: 2rem;
  }
}
