:root {
  --ink: #1e293b;
  --bg: #fdfaf0;
  --surface: #ffffff;
  --line: #e2d9c2;
  --egypt-gold: #c28e20;
  --egypt-lapis: #1e3a8a;
  --egypt-dark: #291b0b;
  --egypt-sand: #fef3c7;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Lexend", system-ui, sans-serif;
  --shadow: 0 8px 24px rgba(194, 142, 32, 0.12);
  --shadow-hover: 0 16px 36px rgba(194, 142, 32, 0.2);
  --radius-lg: 20px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

header {
  background: #251605;
  color: #fff;
  padding: 0.9rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 3px solid var(--egypt-gold);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #fff;
}

.brand-icon {
  font-size: 2.2rem;
  background: rgba(194, 142, 32, 0.25);
  padding: 0.4rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: -0.01em;
}

.brand p {
  font-size: 0.8rem;
  color: #fef3c7;
}

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

.tab-pills {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem;
  border-radius: 999px;
  gap: 0.3rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #fef3c7;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  background: var(--egypt-gold);
  color: #251605;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-header {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.25);
}

.game-container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.2rem;
  width: 100%;
  flex: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

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

.section-intro {
  margin-bottom: 1.5rem;
}

.section-intro h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--egypt-dark);
}

.section-desc {
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* ================== TAB 1: PYRAMID CUTAWAY ================== */
.tour-stage {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.diagram-wrap {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  min-height: 440px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diagram-wrap svg {
  width: 100%;
  max-height: 480px;
}

.hotspot-node {
  cursor: pointer;
}

.hotspot-node:hover circle {
  fill: #f59e0b;
  transform: scale(1.15);
  transform-origin: center;
}

.detail-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}

.detail-card h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--egypt-dark);
}

.detail-sub {
  font-size: 0.95rem;
  color: #0d9488;
  font-weight: 600;
  border-left: 3px solid #0d9488;
  padding-left: 0.8rem;
}

.history-quote {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.9rem;
  color: #854d0e;
  line-height: 1.45;
}

/* ================== TAB 2: CARTOUCHE DECODER ================== */
.cartouche-stage {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.cartouche-display-wrap {
  display: flex;
  justify-content: center;
}

.cartouche-oval {
  width: 220px;
  min-height: 400px;
  border: 6px solid #d97706;
  border-radius: 110px;
  background: #fef9c3;
  box-shadow: 0 10px 25px rgba(217, 119, 6, 0.25);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem;
  gap: 0.8rem;
}

.cartouche-oval::after {
  content: "";
  position: absolute;
  bottom: -14px;
  width: 90px;
  height: 8px;
  background: #d97706;
  border-radius: 4px;
}

.cartouche-symbols {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
}

.hieroglyph-stamp {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
}

.hieroglyph-stamp small {
  font-size: 0.75rem;
  font-weight: 800;
  color: #78350f;
}

.cartouche-trans-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #78350f;
  letter-spacing: 0.1em;
  margin-top: auto;
}

.hieroglyph-keyboard-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.hieroglyph-keyboard-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--egypt-dark);
}

.keyboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.5rem;
}

.key-glyph-btn {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.key-glyph-btn:hover {
  background: #fefce8;
  border-color: var(--egypt-gold);
  transform: translateY(-2px);
}

.key-letter {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--egypt-dark);
}

.key-symbol {
  font-size: 1.3rem;
}

.keyboard-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ================== TAB 3: TOMB RELICS ================== */
.tomb-relics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.relic-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: all 0.2s;
}

.relic-card:hover {
  border-color: var(--egypt-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.relic-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.relic-icon {
  font-size: 2.8rem;
  background: #fef9c3;
  padding: 0.4rem;
  border-radius: 14px;
}

.relic-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--egypt-dark);
}

.relic-header small {
  color: #d97706;
  font-weight: 700;
}

.relic-card p {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.45;
}

/* ================== TAB 4: QUIZ ================== */
.quiz-stage {
  max-width: 760px;
  margin: 0 auto;
}

.quiz-hud {
  display: flex;
  justify-content: space-between;
  background: #ffffff;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 1.2rem;
}

.quiz-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.quiz-badge {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  text-transform: uppercase;
}

.quiz-question {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--egypt-dark);
  line-height: 1.3;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.quiz-opt-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quiz-opt-btn:hover {
  background: #fefce8;
  border-color: var(--egypt-gold);
  transform: translateY(-2px);
}

.quiz-opt-btn.correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #14532d !important;
}

.quiz-opt-btn.wrong {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #7f1d1d !important;
}

.quiz-feedback {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.4;
}

.quiz-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-action {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 800;
  background: #c28e20;
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #a17215;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #ffffff;
  color: #251605;
  border: 1.5px solid var(--line);
}

.btn-secondary:hover {
  background: #fefce8;
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.btn-danger:hover {
  background: #fecaca;
}

@media (max-width: 900px) {
  .tour-stage, .cartouche-stage, .quiz-options {
    grid-template-columns: 1fr;
  }
}
