/* ============================================================
   Labyrinth of the Minotaur (Λαβύρινθος) — Dungeon Crawler
   Earthy palette: near-black · charcoal · olive · terracotta
   NO beige. Typography: Raleway + Cormorant Garamond
   ============================================================ */

#labyrinth-wrap {
  --lb-bg:       #0C0806;
  --lb-panel:    #14100A;
  --lb-raised:   #1E1710;
  --lb-bdr:      rgba(140,100,45,0.2);
  --lb-olive:    #4A5C25;
  --lb-oli-lt:   #6A7E38;
  --lb-terra:    #8B3A1E;
  --lb-ter-lt:   #AD5028;
  --lb-gold:     #9E7018;
  --lb-gol-lt:   #C49028;
  --lb-torch:    #D4922A;
  --lb-fog:      rgba(8,5,2,0.94);
  --lb-text:     #D8C090;
  --lb-muted:    rgba(216,192,144,0.42);

  position: relative; width: 100%; height: 100%;
  background: var(--lb-bg);
  display: flex; flex-direction: column;
  font-family: 'Raleway', sans-serif;
  color: var(--lb-text);
  overflow: hidden;
}

/* ── Canvas overlay (fog of war + torchlight) ── */
.lb-canvas-ovl {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 50;
}

/* ── Screens ── */
.lb-screen { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; overflow: hidden; }
.lb-screen.active { display: flex; }

/* ──────── MENU ──────── */
.lb-menu-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 1.1rem; padding: 2rem; text-align: center;
}
.lb-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(44px, 8vw, 78px); font-weight: 300; line-height: 1.05; letter-spacing: -1px;
}
.lb-logo em { color: var(--lb-ter-lt); font-style: normal; display: block; font-size: .65em; }
.lb-logo-sub { font-size: 9px; letter-spacing: 4px; text-transform: uppercase; color: var(--lb-muted); margin-top: -.4rem; }
.lb-rule {
  max-width: 480px; width: 100%; border: 1px solid var(--lb-bdr);
  background: rgba(15,10,5,.75); padding: 1.1rem 1.4rem;
  font-size: 12.5px; line-height: 1.75; color: var(--lb-muted); text-align: left;
}
.lb-rule strong { color: var(--lb-text); }
.lb-btn {
  padding: 11px 44px; border: none; cursor: pointer;
  background: var(--lb-terra); color: var(--lb-text);
  font-family: 'Raleway', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  transition: background .2s, transform .15s;
}
.lb-btn:not(:disabled):hover { background: var(--lb-ter-lt); transform: translateY(-2px); }
.lb-btn:disabled { opacity: .35; cursor: default; }
.lb-btn.sec { background: transparent; border: 1px solid var(--lb-bdr); color: var(--lb-muted); }
.lb-btn.sec:hover { border-color: var(--lb-gold); color: var(--lb-text); transform: none; }

/* ──────── GAME HUD ──────── */
.lb-hud {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 1.2rem; background: var(--lb-panel); border-bottom: 1px solid var(--lb-bdr); flex-shrink: 0;
}
.lb-hud-item { display: flex; flex-direction: column; gap: 1px; }
.lb-hud-lbl { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; color: var(--lb-muted); }
.lb-lives { display: flex; gap: 5px; font-size: 16px; margin-top: 1px; }
.lb-life { transition: opacity .3s; }
.lb-life.lost { opacity: .15; filter: grayscale(1); }
.lb-torch-bar {
  display: flex; align-items: center; gap: 5px;
}
.lb-torch-icon { font-size: 16px; }
.lb-torch-fill {
  width: 60px; height: 5px; background: rgba(255,255,255,.1); border: 1px solid var(--lb-bdr); position: relative;
}
.lb-torch-fill-inner {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--lb-torch); transition: width .4s;
}
.lb-hud-step { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 300; line-height: 1; color: var(--lb-gol-lt); }

/* ──────── GAME AREA ──────── */
.lb-game-inner {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; position: relative;
}
.lb-status-msg {
  font-size: 11px; letter-spacing: .7px; color: var(--lb-gold); text-align: center;
  min-height: 20px; padding: 5px 1rem; flex-shrink: 0; z-index: 60; position: relative;
}

/* ──────── GRID ──────── */
.lb-grid-outer {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: .5rem; z-index: 10; position: relative;
}
.lb-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  width: min(364px, 90vw);
}
.lb-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(80,60,30,.2); background: #0E0A06;
  position: relative; user-select: none; font-size: clamp(14px, 3vw, 20px);
  transition: background .2s;
}
.lb-cell.lit     { background: #1E1608; border-color: rgba(180,130,40,.2); }
.lb-cell.visited { background: #140F07; }
.lb-cell.exit    { background: rgba(74,92,37,.25); border-color: rgba(106,126,56,.4); }
.lb-cell.theseus { background: rgba(80,95,40,.3); border-color: rgba(150,180,70,.5); }
.lb-cell.minotaur-visible { background: rgba(120,40,20,.35); border-color: rgba(180,60,30,.5); }
.lb-cell.danger  { background: rgba(120,40,20,.2); }

/* ──────── D-PAD CONTROLS ──────── */
.lb-controls {
  display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr;
  gap: 3px; width: 130px; flex-shrink: 0; margin: .6rem 0; z-index: 60;
}
.lb-dpad-btn {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--lb-bdr); background: var(--lb-raised);
  cursor: pointer; font-size: 18px; color: var(--lb-muted);
  transition: background .15s, color .15s;
  user-select: none; -webkit-user-select: none;
}
.lb-dpad-btn:active, .lb-dpad-btn:hover { background: rgba(160,115,35,.15); color: var(--lb-text); border-color: var(--lb-gold); }
.lb-dpad-center {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--lb-bdr); background: var(--lb-panel); font-size: 10px;
  letter-spacing: 1px; color: var(--lb-muted); text-align: center;
}

/* ──────── QUIZ MODAL ──────── */
.lb-quiz-wrap {
  position: absolute; inset: 0; z-index: 100;
  background: rgba(8,5,2,.93);
  display: none; align-items: center; justify-content: center; padding: 1.5rem;
}
.lb-quiz-wrap.active { display: flex; }
.lb-quiz-box {
  max-width: 520px; width: 100%; border: 1px solid var(--lb-bdr);
  background: var(--lb-raised); padding: 1.75rem;
}
.lb-quiz-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--lb-bdr);
}
.lb-quiz-icon-wrap {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--lb-panel); border: 1px solid var(--lb-bdr); flex-shrink: 0;
}
.lb-quiz-context { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; color: var(--lb-muted); }
.lb-quiz-dir { font-size: 13px; color: var(--lb-torch); margin-top: 2px; font-weight: 600; }
.lb-qlbl { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; color: var(--lb-gold); margin-bottom: .5rem; }
.lb-qtxt {
  font-family: 'Cormorant Garamond', serif; font-size: clamp(16px, 3vw, 21px);
  line-height: 1.45; color: var(--lb-text); margin-bottom: 1rem;
}
.lb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.lb-opt {
  padding: 11px 9px; border: 1px solid var(--lb-bdr); background: rgba(255,255,255,.025);
  cursor: pointer; font-family: 'Raleway', sans-serif; font-size: 11.5px;
  color: var(--lb-text); text-align: left; transition: all .18s;
}
.lb-opt:not(:disabled):hover { background: rgba(158,112,24,.12); border-color: rgba(158,112,24,.45); }
.lb-opt.correct { background: rgba(74,92,37,.3); border-color: var(--lb-olive); }
.lb-opt.wrong   { background: rgba(139,58,30,.22); border-color: var(--lb-terra); color: var(--lb-muted); }
.lb-opt:disabled { cursor: default; }
.lb-quiz-result { margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--lb-bdr); font-size: 12px; color: var(--lb-muted); line-height: 1.55; text-align: center; }
.lb-quiz-result strong { color: var(--lb-text); }

/* ──────── RESULT SCREEN ──────── */
.lb-result-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1.1rem; height: 100%; padding: 2rem; text-align: center;
}
.lb-res-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(46px, 9vw, 78px); font-weight: 300; line-height: 1;
}
.lb-res-title.win  { color: var(--lb-oli-lt); }
.lb-res-title.lose { color: var(--lb-ter-lt); }
.lb-res-sub    { font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: var(--lb-muted); }
.lb-res-detail { font-size: 13px; line-height: 1.7; color: var(--lb-muted); max-width: 440px; }
.lb-res-btns   { display: flex; gap: 10px; margin-top: .5rem; }

/* Animations */
@keyframes lb-minotaur-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.lb-cell.minotaur-visible .lb-cell-content { animation: lb-minotaur-pulse 1s infinite; }

@keyframes lb-encounter { 0%{background:rgba(200,50,20,.6)} 100%{background:transparent} }
.lb-cell.encounter { animation: lb-encounter .4s ease-out; }

@keyframes lb-exit-glow { 0%,100%{box-shadow:0 0 0 0 rgba(106,126,56,.5)} 50%{box-shadow:0 0 8px 2px rgba(106,126,56,.4)} }
.lb-cell.exit { animation: lb-exit-glow 2s infinite; }
