/* ═══════════════════════════════════════════
   ESCAPE PYRAMIDS — Shared Stylesheet
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;600;700;800;900&family=Share+Tech+Mono&display=swap');

:root {
  --bg:         #07070f;
  --bg-panel:   #0d0d1c;
  --bg-card:    #12121f;
  --gold:       #c9a227;
  --gold-light: #f0c040;
  --gold-dim:   rgba(201,162,39,0.15);
  --green:      #00e676;
  --green-dim:  rgba(0,230,118,0.12);
  --red:        #ff4444;
  --text:       #ece8d9;
  --text-muted: #7a7a8a;
  --border:     rgba(201,162,39,0.22);
  --border-dim: rgba(255,255,255,0.06);
  --radius:     12px;
  --radius-lg:  18px;
  --mono:       'Share Tech Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── TIMER BAR ── */
#timer-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: rgba(7,7,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.timer-label {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#timer-display {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.12em;
  transition: color 0.3s;
  min-width: 80px;
  text-align: center;
}

#timer-display.warning { color: #ff9800; }
#timer-display.danger  { color: var(--red); animation: pulse-timer 1s infinite; }

@keyframes pulse-timer {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.timer-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 1s linear, background 1s;
}

.station-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.station-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.4s;
}

.station-dot.done {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.station-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* ── HERO SECTION ── */
.escape-hero {
  position: relative;
  min-height: 38vh;
  display: flex;
  align-items: flex-end;
  padding: 6rem 1.5rem 3rem;
  overflow: hidden;
  background: linear-gradient(160deg, #07070f 0%, #1a1200 60%, #07070f 100%);
}

.escape-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  filter: saturate(0.6);
}

.escape-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 60%);
}

.escape-hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  width: 100%;
}

.station-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1rem;
}

.escape-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.escape-hero h1 span { color: var(--gold-light); }

.escape-hero p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.65;
}

/* ── MAIN CONTAINER ── */
.escape-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* ── PANELS ── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.panel-gold {
  border-color: var(--border);
  background: linear-gradient(135deg, var(--bg-panel) 0%, rgba(201,162,39,0.04) 100%);
}

.panel-title {
  font-size: 0.7rem;
  font-family: var(--mono);
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── LOCK INPUT ── */
.lock-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
}

.lock-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.lock-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.lock-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.lock-input-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.lock-input {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--gold-light);
  padding: 0.6rem 1.2rem;
  width: 160px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lock-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
}

.lock-input.error {
  border-color: var(--red);
  animation: shake 0.4s ease;
}

.lock-input.success {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,230,118,0.15);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

/* ── BUTTONS ── */
.btn-escape {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold);
  color: #0a0800;
  font-family: 'Heebo', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-escape:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,162,39,0.35);
}

.btn-escape:active { transform: translateY(0); }

.btn-escape.secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-escape.secondary:hover {
  background: var(--bg-panel);
  box-shadow: none;
}

.btn-escape.green {
  background: var(--green);
  color: #003015;
}

.btn-escape.green:hover {
  background: #33ff99;
  box-shadow: 0 6px 20px rgba(0,230,118,0.35);
}

/* ── SUCCESS OVERLAY ── */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.success-overlay.show { display: flex; }

.success-box {
  background: var(--bg-panel);
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
  animation: pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-box .check { font-size: 3.5rem; margin-bottom: 1rem; }
.success-box h2 { font-size: 1.5rem; font-weight: 900; color: var(--green); margin-bottom: 0.5rem; }
.success-box p  { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── INFO BOX ── */
.info-box {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.info-box.gold {
  background: var(--gold-dim);
  border: 1px solid var(--border);
  color: var(--text);
}

.info-box.green {
  background: var(--green-dim);
  border: 1px solid rgba(0,230,118,0.25);
  color: var(--text);
}

.info-box .icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.05rem; }

/* ── VIDEO FRAME ── */
.video-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  position: relative;
}

.video-frame img,
.video-frame video {
  width: 100%;
  display: block;
}

.video-placeholder {
  aspect-ratio: 16/7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111 0%, #1a1400 100%);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}

/* ── DRAG AND DROP ── */
.drag-source {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.drag-source:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201,162,39,0.2);
}

.drag-source.dragging { opacity: 0.4; cursor: grabbing; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  min-width: 140px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone.over {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.drop-zone.filled {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
  font-weight: 700;
}

.drop-zone.wrong {
  border-color: var(--red);
  animation: shake 0.4s ease;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(201,162,39,0.3); border-radius: 3px; }

/* ── CREDIT FOOTER ── */
.escape-credit {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.05em;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 1rem;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  /* Bigger base font for readability */
  body { font-size: 17px; }

  .escape-main { padding: 1.25rem 1rem 4rem; }

  .panel { padding: 1.1rem; }
  .panel-title { font-size: 0.78rem; }

  /* Hero */
  .escape-hero { min-height: 28vh; padding: 5rem 1rem 2rem; }
  .escape-hero h1 { font-size: 2rem; }
  .escape-hero p  { font-size: 1rem; }
  .station-badge  { font-size: 0.75rem; }

  /* Timer */
  #timer-display { font-size: 1.3rem; }
  .timer-label   { font-size: 0.68rem; }

  /* Lock */
  .lock-input     { width: 130px; font-size: 1.2rem; }
  .lock-section   { padding: 1.25rem 1rem; }
  .lock-section h3 { font-size: 1rem; }
  .lock-section p  { font-size: 0.88rem; }

  /* Info boxes */
  .info-box { font-size: 0.9rem; }

  /* Success box */
  .success-box { padding: 1.75rem 1.25rem; }
  .success-box h2 { font-size: 1.3rem; }
  .success-box p  { font-size: 0.9rem; }

  /* Buttons */
  .btn-escape { font-size: 0.95rem; padding: 0.75rem 1.25rem; }

  /* Drag chips */
  .formula-chip { font-size: 0.95rem; padding: 0.6rem 1.1rem; }
  .drag-source  { font-size: 0.95rem; }

  /* Hieroglyphs */
  .hiero-btn .glyph { font-size: 1.8rem; }
  .hiero-btn .gname { font-size: 0.75rem; }

  /* Graphs */
  .graphs-grid { gap: 0.5rem; }
  .graph-desc  { font-size: 0.72rem; }

  /* Filter buttons */
  .filter-btn .fname { font-size: 0.78rem; }
  .filter-btn .fwave { font-size: 0.68rem; }
  .filter-btn { padding: 0.75rem 0.4rem; }

  /* Canvas hint */
  .maze-instructions { font-size: 0.88rem; }

  /* Victory */
  .victory-title { font-size: 2.2rem; }
  .victory-sub   { font-size: 1rem; }
  .sci-card .fact { font-size: 0.82rem; }
  .sci-card .title { font-size: 0.88rem; }
  .pharaoh-quote { font-size: 0.9rem; }

  /* Penalty */
  .penalty-count { font-size: 5rem; }
  .penalty-box   { padding: 2rem 1.5rem; }
}

/* ── PENALTY OVERLAY ── */
.penalty-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7,7,15,0.93);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.penalty-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.penalty-box {
  text-align: center;
  background: #0d0d1c;
  border: 2px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3.5rem;
  box-shadow: 0 0 60px rgba(255,68,68,0.25), 0 0 0 1px rgba(255,68,68,0.1);
  animation: pop-in 0.3s ease;
}

.penalty-icon  { font-size: 2.5rem; margin-bottom: 0.5rem; }

.penalty-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.penalty-count {
  font-family: var(--mono);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 0.4rem;
  animation: pulse-penalty 1s infinite;
}

.penalty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

@keyframes pulse-penalty {
  0%,100% { opacity: 1; text-shadow: 0 0 20px rgba(255,68,68,0.6); }
  50%      { opacity: 0.65; text-shadow: none; }
}
