/* ===== DESIGN TOKENS ===== */
:root {
  --cream:      #F7F3EC;
  --cream-dark: #EDE8DF;
  --gold:       #C8900A;
  --gold-hover: #B07808;
  --brown-dark: #2C1810;
  --brown-mid:  #6B5B4E;
  --card:       #FFFFFF;
  --shadow:     rgba(200,144,10,0.12);
  --serif:      Georgia, 'Times New Roman', serif;
  --sans:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --cream:      #1A1208;
  --cream-dark: #2C1810;
  --gold:       #C8900A;
  --gold-hover: #D4990F;
  --brown-dark: #F7F3EC;
  --brown-mid:  #B8A898;
  --card:       #3A2214;
  --shadow:     rgba(200,144,10,0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--brown-dark);
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}

.app-theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  background: rgba(44,24,16,0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(200,144,10,0.3);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  line-height: 1;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

h1 {
  text-align: center;
  color: var(--gold);
  margin-bottom: 8px;
  line-height: 1.2;
  overflow-wrap: break-word;
  font-family: var(--serif);
}

.subtitle {
  text-align: center;
  color: var(--brown-mid);
  margin-bottom: 24px;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.card {
  background: var(--card);
  border: 1px solid var(--cream-dark);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.hero-card {
  padding: 28px 22px;
  text-align: center;
  background: radial-gradient(circle at top, rgba(200,144,10,0.08), transparent 35%), var(--card);
}

.hero-logo {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 16px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.35;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
}

.hero-title {
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--gold);
  overflow-wrap: break-word;
  font-family: var(--serif);
}

.hero-text {
  color: var(--brown-mid);
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.55;
}

.hero-list {
  text-align: left;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.hero-list li {
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--brown-dark);
  line-height: 1.45;
}

.language-trigger {
  width: 100%;
  border: 1px solid var(--cream-dark);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  cursor: pointer;
  background: var(--cream);
  color: var(--brown-dark);
  margin-bottom: 12px;
  white-space: normal;
  transition: border-color 0.2s;
}

.language-trigger:hover {
  border-color: var(--gold);
}

.language-current {
  display: inline-block;
  min-width: 180px;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  color: var(--brown-mid);
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.35;
  white-space: normal;
}

.start-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  background: var(--gold);
  color: var(--cream);
  margin-top: 4px;
  transition: background 0.2s;
}

.start-btn:hover {
  background: var(--gold-hover);
}

.hero-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--brown-mid);
  line-height: 1.45;
}

.progress-wrap {
  margin-bottom: 24px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: var(--brown-mid);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.progress {
  width: 100%;
  height: 12px;
  background: var(--cream-dark);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.3s ease;
}

.station-title {
  color: var(--gold);
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.25;
  overflow-wrap: break-word;
  font-size: 26px;
  font-family: var(--serif);
}

.intro {
  color: var(--brown-mid);
  margin-bottom: 18px;
  line-height: 1.55;
}

.question {
  font-size: 20px;
  margin-bottom: 18px;
  line-height: 1.4;
  overflow-wrap: break-word;
  color: var(--brown-dark);
}

.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.option-btn {
  width: 100%;
  border: 1px solid var(--cream-dark);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  background: var(--cream);
  color: var(--brown-dark);
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
}

.option-btn:hover {
  background: var(--cream-dark);
  border-color: var(--gold);
  transform: translateY(-1px);
}

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

.option-btn.correct {
  background: #1f7a39;
  border-color: #1f7a39;
  color: #fff;
}

.option-btn.wrong {
  background: #922b2b;
  border-color: #922b2b;
  color: #fff;
}

.feedback {
  display: none;
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.5;
}

.feedback.correct {
  display: block;
  background: rgba(31,122,57,0.1);
  border: 1px solid #2d9b50;
  color: #1b5e2e;
}

.feedback.wrong {
  display: block;
  background: rgba(146,43,43,0.1);
  border: 1px solid #c24b4b;
  color: #7a1f1f;
}

.info-btn {
  width: 100%;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  background: transparent;
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: bold;
  white-space: normal;
}

.info-btn:hover {
  background: rgba(200,144,10,0.08);
}

.next-station-box {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 12px;
  color: var(--brown-dark);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.route-trigger {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 17px;
  cursor: pointer;
  background: var(--gold);
  color: var(--cream);
  font-weight: bold;
  margin: 4px 0 20px;
  line-height: 1.35;
  white-space: normal;
  transition: background 0.2s;
}

.route-trigger:hover {
  background: var(--gold-hover);
}

.nav {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
  flex-wrap: wrap;
}

.nav button,
.final-actions a,
.final-actions button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
}

.btn-secondary {
  background: var(--cream-dark);
  color: var(--brown-dark);
}

.btn-primary {
  background: var(--gold);
  color: var(--cream);
  font-weight: 600;
}

.btn-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.final-card h2 {
  color: var(--gold);
  margin-top: 0;
  line-height: 1.2;
  font-family: var(--serif);
}

.score {
  font-size: 22px;
  margin: 14px 0;
  line-height: 1.4;
  color: var(--brown-dark);
}

.final-code {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--cream);
  border: 1px dashed var(--gold);
  font-size: 20px;
  letter-spacing: 1px;
  line-height: 1.35;
  overflow-wrap: break-word;
  color: var(--brown-dark);
}

.final-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.5);
  z-index: 999;
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1px solid var(--cream-dark);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(44,24,16,0.15);
}

.modal-card h3 {
  margin-top: 0;
  color: var(--gold);
  margin-bottom: 8px;
  line-height: 1.3;
  font-family: var(--serif);
}

.modal-card p {
  color: var(--brown-mid);
  margin-bottom: 16px;
  line-height: 1.5;
}

.info-modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--card);
  border: 1px solid var(--cream-dark);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(44,24,16,0.2);
  max-height: 80vh;
  overflow-y: auto;
}

.info-modal-card h3 {
  margin-top: 0;
  color: var(--gold);
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.3;
  font-family: var(--serif);
}

.info-modal-card p {
  color: var(--brown-mid);
  line-height: 1.75;
  font-size: 15px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-actions a,
.modal-actions button {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
}

.apple-btn {
  background: var(--cream-dark);
  color: var(--brown-dark);
}

.google-btn {
  background: var(--gold);
  color: var(--cream);
  font-weight: bold;
}

.cancel-btn {
  background: var(--cream);
  color: var(--brown-mid);
  border: 1px solid var(--cream-dark) !important;
}

.language-option {
  width: 100%;
  border: 1px solid var(--cream-dark);
  background: var(--cream);
  color: var(--brown-dark);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.language-option:hover {
  border-color: var(--gold);
  background: rgba(200,144,10,0.05);
}

.language-option.active {
  border-color: var(--gold);
  background: rgba(200,144,10,0.08);
}

.lang-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-flag {
  font-size: 20px;
  line-height: 1;
}

.lang-name {
  font-weight: bold;
}

.selected-badge {
  color: var(--gold);
  font-size: 13px;
  white-space: nowrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
  .container {
    padding: 18px 12px 32px;
  }

  .hero-card,
  .card,
  .modal-card,
  .info-modal-card {
    padding: 18px;
  }

  .hero-title {
    font-size: 28px;
  }

  .station-title {
    font-size: 22px;
  }

  .question {
    font-size: 18px;
  }

  .score {
    font-size: 20px;
  }

  .final-code {
    font-size: 18px;
    letter-spacing: 0.5px;
  }
}

@media (min-width: 700px) {
  .final-actions {
    flex-direction: row;
  }

  .final-actions a,
  .final-actions button {
    flex: 1;
  }
}

/* ===== RESULT BANNER ===== */
#result-banner-slot {
  margin: 24px 0 20px;
}

.result-banner-box {
  position: relative;
  overflow: hidden;
  padding: 28px 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #2C1810 0%, #4a2810 50%, #6B3820 100%);
  color: var(--cream);
  box-shadow:
    0 20px 60px rgba(44,24,16,0.3),
    0 4px 12px rgba(0,0,0,0.12),
    inset 0 1px 0 rgba(200,144,10,0.25);
  border: 1px solid rgba(200,144,10,0.2);
}

.result-banner-box::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(200,144,10,0.2) 0%, transparent 70%);
  opacity: 0.6;
}

.result-banner-box h3 {
  position: relative;
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-family: var(--serif);
  color: var(--gold);
}

.result-banner-box p {
  position: relative;
  margin: 0 0 16px;
  color: rgba(247,243,236,0.9);
  font-size: 1.05rem;
  line-height: 1.5;
}

.result-banner-box p strong {
  color: var(--cream);
  font-weight: 800;
}

.result-banner-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.result-banner-actions button {
  appearance: none;
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

#download-banner-btn {
  background: var(--gold);
  color: var(--cream);
}

#download-banner-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(200,144,10,0.3);
}

#share-banner-btn {
  background: rgba(247,243,236,0.15);
  backdrop-filter: blur(12px);
  color: var(--cream);
  border: 1px solid rgba(200,144,10,0.4);
}

#share-banner-btn:hover {
  background: rgba(247,243,236,0.22);
  transform: translateY(-2px);
}

.result-banner-actions button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

@media (min-width: 640px) {
  .result-banner-actions {
    flex-direction: row;
  }

  .result-banner-box {
    padding: 32px 28px;
  }

  .result-banner-box h3 {
    font-size: 1.5rem;
  }
}

/* ===== ADMIN SWITCHER ===== */
.admin-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: rgba(44,24,16,0.95);
  backdrop-filter: blur(12px);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(200,144,10,0.3);
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
}

.admin-label {
  color: var(--gold);
  font-weight: 600;
  padding-top: 2px;
}

.admin-btn {
  appearance: none;
  border: 1px solid rgba(200,144,10,0.4);
  background: rgba(200,144,10,0.15);
  color: var(--cream);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-btn:hover {
  background: rgba(200,144,10,0.25);
  border-color: rgba(200,144,10,0.6);
}

.admin-btn.active {
  background: var(--gold);
  border-color: var(--gold-hover);
  box-shadow: 0 4px 12px rgba(200,144,10,0.4);
}

.admin-btn.active:hover {
  background: var(--gold-hover);
}

/* CITY SELECTOR */
.admin-city-select {
  appearance: none;
  border: 1px solid rgba(200,144,10,0.4);
  background: rgba(44,24,16,0.95);
  color: var(--gold);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-family: var(--sans);
}

.admin-city-select:hover {
  background: rgba(200,144,10,0.25);
  border-color: rgba(200,144,10,0.6);
}

.admin-city-select:focus {
  outline: none;
  background: var(--gold);
  border-color: var(--gold-hover);
  box-shadow: 0 4px 12px rgba(200,144,10,0.4);
}

.admin-city-select option {
  background: #2C1810;
  color: #C8900A;
  padding: 8px;
  font-weight: 600;
}
