:root {
  --bg: #090e17;
  --surface: #131c2e;
  --panel: #1c2b45;
  --line: #2d4263;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --bronze: #d97706;
  --gold: #f59e0b;
  --cyan: #38bdf8;
  --emerald: #10b981;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Lexend", system-ui, sans-serif;
}

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

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, #d97706, #78350f);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.brand h1 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.brand p {
  font-size: 0.8rem;
  color: var(--muted);
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.controls-bar select {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #fff;
  cursor: pointer;
  outline: none;
}

.btn-header {
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header:hover {
  background: var(--bronze);
  border-color: var(--bronze);
}

main {
  flex: 1;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Temporal HUD */
.temporal-hud {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.hud-val {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}

.time-dial {
  text-align: center;
}

.era-tag {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
}

.loc-tag {
  font-size: 0.85rem;
  color: var(--cyan);
}

.hud-streak {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--cyan);
}

/* Portal Arena */
.portal-arena {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Artifact Card */
.artifact-card {
  background: radial-gradient(circle at 10% 20%, #1e2d4a, var(--surface) 90%);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.artifact-visual {
  font-size: 4rem;
  background: var(--panel);
  border: 2px solid var(--cyan);
  width: 90px;
  height: 90px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(56, 189, 248, 0.2); }
  50% { box-shadow: 0 0 25px rgba(56, 189, 248, 0.5); }
}

.artifact-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portal-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
}

.clue-headline {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.clue-body {
  font-size: 1rem;
  color: #cbd5e1;
  line-height: 1.55;
}

/* Fact Reveal Banner */
.fact-banner {
  background: linear-gradient(135deg, #1e3a5f, #0f243d);
  border: 2px solid var(--emerald);
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideIn {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.fact-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.fact-text {
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.5;
}

/* Choices Grid */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

.choice-btn {
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.choice-btn:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  background: var(--panel);
}

.choice-btn.correct {
  background: #064e3b;
  border-color: var(--emerald);
  color: #a7f3d0;
}

.choice-btn.wrong {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 23, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 2.2rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-card h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
}

.modal-card p {
  color: var(--muted);
  margin: 0.6rem 0 1.2rem;
}

.stats-pills {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.pill {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.pill b {
  color: var(--gold);
}

.modal-btn {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.4);
}

