/**
 * Estilos para GeoDesafío de España (Adivina el rincón por satélite)
 * Estándar canónico Fijate Tools con soporte tema claro y oscuro
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-card-secondary: #334155;
  --bg-input: #0f172a;
  --bg-pill: rgba(15, 23, 42, 0.6);
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-text: #38bdf8;
  --btn-hover-bg: #475569;
}

[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-secondary: #f1f5f9;
  --bg-input: #ffffff;
  --bg-pill: #f1f5f9;
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent-text: #0284c7;
  --btn-hover-bg: #e2e8f0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

.geo-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.controls-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.game-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-main);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.9rem;
}

.game-select option {
  background: var(--bg-input);
  color: var(--text-main);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-pill);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.stat-label { color: var(--text-muted); }
.stat-value { font-family: var(--font-mono); font-weight: 700; color: var(--accent-text); }

.btn-game-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-secondary);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.btn-game-action:hover:not(:disabled) {
  background: var(--btn-hover-bg);
}

.btn-game-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-game-action.btn-primary-action {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
}

.btn-game-action.btn-primary-action:hover:not(:disabled) {
  background: #0369a1;
}

.btn-game-action.btn-success-action {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}

/* Grid de dos mapas */
.geo-arena {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.geo-maps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.map-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.map-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.map-panel-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.geo-map-box {
  width: 100%;
  height: 400px;
  border-radius: 14px;
  border: 2px solid var(--border-color);
  overflow: hidden;
  z-index: 1;
}

.geo-clue-text {
  display: none;
  margin-top: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px dashed var(--accent-text);
  color: var(--accent-text);
  font-size: 0.92rem;
  text-align: center;
}

.geo-action-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.geo-round-summary {
  display: none;
  flex: 1 1 300px;
  background: var(--bg-input);
  border: 1px solid var(--accent-text);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.geo-round-summary h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0 0 0.25rem;
  color: var(--accent-text);
}

.geo-round-summary p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.jump-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-mini-jump {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-secondary);
  color: var(--text-main);
  cursor: pointer;
}

.btn-mini-jump:hover {
  background: var(--btn-hover-bg);
}

/* Modal final */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid var(--accent-text);
  border-radius: 16px;
  padding: 2rem;
  max-width: 480px;
  width: 92%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.modal-card h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin: 0 0 0.35rem;
  color: var(--accent-text);
}

.final-score-big {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0.5rem 0 1rem;
  color: #16a34a;
}

.final-breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  text-align: left;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.final-breakdown-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.86rem;
}

.final-breakdown-list li:last-child {
  border-bottom: none;
}

/* Guía */
.game-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem;
  margin-top: 2rem;
}

.game-guide-section h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.guide-item h3 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
  color: var(--accent-text);
}

.guide-item p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 820px) {
  .geo-maps-grid {
    grid-template-columns: 1fr;
  }
  .geo-map-box {
    height: 310px;
  }
}
