/* Samhain: The Veil Between — style.css */
:root {
  --ink: #e8e2d0;
  --dim: #9aa3b5;
  --gold: #d6b76e;
  --ember: #ff9d5c;
  --panel: rgba(16, 22, 36, 0.92);
  --line: rgba(214, 183, 110, 0.28);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #070a12;
  color: var(--ink);
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
}
#app { height: 100dvh; display: flex; flex-direction: column; }
header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 24, 0.85);
}
.wordmark {
  font-size: 19px; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--gold); font-weight: bold; text-shadow: 0 0 14px rgba(214,183,110,0.35);
}
.wordmark small { display: block; font-size: 9.5px; letter-spacing: 0.22em; color: var(--dim); text-transform: lowercase; }
.top-note { font-size: 11px; color: var(--dim); font-style: italic; }
#stage-wrap { flex: 1 1 auto; position: relative; min-height: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------- HUD */
.hud {
  position: absolute; top: 0; left: 0; right: 0; height: 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; pointer-events: none;
  background: linear-gradient(rgba(7,10,18,0.85), rgba(7,10,18,0));
}
.hud-ch { font-size: 12px; color: var(--dim); letter-spacing: 0.06em; flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-score { font-size: 20px; color: var(--gold); font-weight: bold; }
.hud-score small { font-size: 11px; color: var(--dim); }
.hud-streak { color: var(--ember); font-size: 13px; font-weight: bold; min-width: 34px; }
.hud button {
  pointer-events: auto; cursor: pointer;
  background: rgba(20, 27, 42, 0.9); border: 1px solid var(--line);
  color: var(--ink); font: 12px Georgia, serif; padding: 6px 10px; border-radius: 8px;
}
.hud button:hover { border-color: var(--gold); }
.hud-bar-wrap {
  position: absolute; top: 52px; left: 12px; right: 12px; height: 3px;
  background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden;
}
#hudBar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--ember));
  transition: width .35s ease; }

/* ---------------------------------------------------------- overlays */
.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 8, 14, 0.78); backdrop-filter: blur(3px); z-index: 20;
}
.overlay[hidden] { display: none !important; }
.tablet {
  width: min(520px, 92vw); max-height: 88vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 28px; text-align: center;
  box-shadow: 0 18px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
}
.tablet .kicker { font-size: 15px; color: var(--dim); font-weight: normal; letter-spacing: 0.18em; text-transform: uppercase; }
.tablet h1 { font-size: 24px; color: var(--gold); margin: 6px 0 4px; letter-spacing: 0.06em; }
.tablet h2 { font-size: 24px; color: var(--gold); margin: 6px 0 4px; letter-spacing: 0.06em; }
.tablet .tagline { font-style: italic; color: var(--dim); font-size: 13.5px; margin-bottom: 14px; }
.tablet p.body { font-size: 14px; line-height: 1.65; color: #cfd6e4; margin: 10px 0; text-align: left; }
.tablet .hintline { font-size: 12.5px; color: #8fa3c8; font-style: italic; }
.btn {
  display: inline-block; cursor: pointer; margin: 8px 6px 0;
  background: linear-gradient(180deg, #2a3450, #1a2236);
  border: 1px solid var(--line); color: var(--ink);
  font: 15px Georgia, serif; letter-spacing: 0.08em;
  padding: 11px 26px; border-radius: 10px;
  transition: transform .12s ease, border-color .12s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--gold); }
.btn.primary {
  background: linear-gradient(180deg, #6d5320, #4a370f);
  border-color: var(--gold); color: #ffe9b8;
  box-shadow: 0 0 18px rgba(214,183,110,0.25);
}
.btn.small { font-size: 12.5px; padding: 8px 16px; }
.statrow { display: flex; justify-content: center; gap: 26px; margin: 12px 0; }
.statrow .stat b { display: block; font-size: 22px; color: var(--gold); }
.statrow .stat span { font-size: 11px; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }
.stars { font-size: 34px; color: var(--gold); letter-spacing: 6px; text-shadow: 0 0 16px rgba(214,183,110,0.5); }

/* chapter grid */
.chgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0 8px; }
.chbtn {
  aspect-ratio: 1; border-radius: 9px; cursor: pointer;
  background: rgba(24, 31, 48, 0.9); border: 1px solid var(--line);
  color: var(--ink); font: bold 15px Georgia, serif; position: relative;
}
.chbtn:not(:disabled):hover { border-color: var(--gold); color: var(--gold); }
.chbtn:disabled { opacity: 0.38; cursor: default; }
.chbtn .chstars { display: block; font-size: 8.5px; color: var(--gold); letter-spacing: 1px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 16%; transform: translateX(-50%) translateY(12px);
  background: rgba(14, 19, 32, 0.94); border: 1px solid var(--line);
  color: var(--gold); font-size: 14px; letter-spacing: 0.06em;
  padding: 10px 22px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease; z-index: 30; white-space: nowrap;
  max-width: 94vw; overflow: hidden; text-overflow: ellipsis;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* footer inside play (tiny) */
.stage-foot {
  position: absolute; bottom: 0; left: 0; right: 0; text-align: center;
  font-size: 10.5px; color: rgba(154, 163, 181, 0.55); padding: 3px 0; pointer-events: none;
}

@media (max-width: 560px) {
  .tablet { padding: 18px 16px; }
  .tablet h2 { font-size: 20px; }
  .chgrid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .hud-ch { font-size: 10.5px; }
  .top-note { display: none; }
}
@media (max-height: 560px) {
  header.top { padding: 4px 12px; }
  .wordmark { font-size: 15px; }
  .top-note { display: none; }
}
