/* Moment of Discovery — stylesheet. No external fonts: works offline. */

:root {
  --bg: #10131a;
  --panel: #1a1f2b;
  --ink: #e8e4d8;
  --ink-dim: #a9a494;
  --accent: #d8a94e;
  --accent-ink: #241a08;
  --paper: #f3ecd9;
  --paper-ink: #35301f;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
}
.screen.active { display: flex; align-items: center; justify-content: center; }

.btn {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.6em 1.3em;
  border-radius: 6px;
  border: 1px solid #4a4331;
  background: #2a2f3b;
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: #8a6a24; font-weight: 600; }
.btn.big { font-size: 1.15rem; padding: 0.7em 2em; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ------------------------------- menu ------------------------------- */
/* Collage of historical figures as a transparent backdrop; a radial fade
   keeps the centre dark so the menu itself stays readable. */
#screen-menu {
  background:
    radial-gradient(ellipse 62% 58% at 50% 46%,
      rgba(16, 19, 26, 0.94) 0%,
      rgba(16, 19, 26, 0.72) 55%,
      rgba(16, 19, 26, 0.22) 100%),
    url("../assets/menu-collage.svg") center / cover no-repeat;
}
.menu-inner { max-width: 860px; padding: 3rem 1.5rem; text-align: center; position: relative; }
.game-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: 0.04em;
  margin: 0 0 0.4rem;
  color: var(--accent);
}
.game-tag { color: var(--ink-dim); font-size: 1.05rem; margin: 0 0 2.2rem; line-height: 1.5; }
.menu-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.menu-card {
  text-align: left;
  background: var(--panel);
  border: 1px solid #333b4d;
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--ink);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.menu-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-kicker { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
.card-title { font-family: var(--serif); font-size: 1.45rem; }
.card-sub { color: var(--ink-dim); font-size: 0.95rem; line-height: 1.45; }
.card-figure { margin-top: 0.5rem; font-size: 0.85rem; font-style: italic; color: var(--ink-dim); }
.menu-note { margin-top: 2.4rem; font-size: 0.85rem; color: var(--ink-dim); line-height: 1.55; max-width: 640px; margin-left: auto; margin-right: auto; }

/* ------------------------------- diary ------------------------------- */
#screen-diary { background: radial-gradient(ellipse at center, #23222b 0%, #0d0c11 100%); }
.diary-card {
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--serif);
  max-width: 660px;
  width: calc(100% - 2rem);
  margin: 2rem 0;
  padding: 2.2rem 2.6rem 1.6rem;
  border-radius: 3px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.7), inset 0 0 80px rgba(120, 90, 30, 0.12);
}
.diary-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid #b7ad8f; padding-bottom: 0.7rem; margin-bottom: 1.1rem; }
.diary-figure { font-style: italic; font-size: 0.95rem; color: #6c6146; }
.diary-date { font-weight: 700; letter-spacing: 0.03em; }
.diary-text { font-size: 1.08rem; line-height: 1.72; }
.diary-text p { margin: 0 0 1em; }
.diary-text em { color: #5e5030; }
.diary-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 1.4rem; border-top: 1px solid #b7ad8f; padding-top: 0.9rem; }
.diary-dots { display: flex; gap: 6px; margin-bottom: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cfc5a6; display: inline-block; }
.dot.filled { background: #8a6a24; }
.diary-progress { font-size: 0.8rem; color: #6c6146; font-family: var(--sans); }

/* ------------------------------ controls ------------------------------ */
.controls-card { background: var(--panel); border: 1px solid #333b4d; border-radius: 10px; max-width: 620px; width: calc(100% - 2rem); padding: 2rem 2.4rem; text-align: center; }
.controls-card h2 { font-family: var(--serif); color: var(--accent); margin-top: 0; }
.controls-intro { color: var(--ink-dim); line-height: 1.55; }
.controls-list { display: flex; flex-direction: column; gap: 0.55rem; margin: 1.4rem 0 1.8rem; text-align: left; }
.control-row { display: flex; align-items: center; gap: 1rem; }
.control-key {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #0e1118; border: 1px solid #3a4256; border-bottom-width: 3px;
  padding: 0.25em 0.7em; border-radius: 6px; min-width: 120px; text-align: center;
  font-size: 0.9rem; white-space: nowrap;
}
.control-desc { color: var(--ink); font-size: 0.95rem; }

/* -------------------------------- play -------------------------------- */
#screen-play { background: #000; }
.play-wrap { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#game-canvas {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  display: block;
  image-rendering: auto;
}
.hud-objective {
  position: absolute; top: 14px; left: 16px; max-width: 380px;
  background: rgba(10, 12, 18, 0.72); border: 1px solid rgba(216,169,78,0.5);
  border-radius: 6px; padding: 0.5em 0.9em; font-size: 0.92rem; line-height: 1.4;
}
.hud-objective:empty { display: none; }
.hud-meters { position: absolute; top: 14px; right: 16px; display: flex; flex-direction: column; gap: 6px; }
.meter { display: flex; align-items: center; gap: 8px; background: rgba(10,12,18,0.72); padding: 4px 8px; border-radius: 6px; }
.meter-label { font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-dim); }
.meter-bar { width: 130px; height: 9px; background: #232838; border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 5px; transition: width 0.15s linear; }
.meter-fill.low { animation: pulse 0.8s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }
.hud-caption {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  max-width: 700px; width: calc(100% - 3rem); text-align: center;
  background: rgba(8, 9, 14, 0.78); border-radius: 8px; padding: 0.7em 1.2em;
  font-size: 1.02rem; line-height: 1.5; opacity: 0; transition: opacity 0.25s;
  pointer-events: none;
}
.hud-caption.visible { opacity: 1; }
.hud-caption .speaker, .moment-text .speaker { color: var(--accent); font-weight: 600; }

/* ------------------------------ overlays ------------------------------ */
.overlay {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(5, 6, 10, 0.6);
}
.overlay.visible { display: flex; }
.overlay-card { background: var(--panel); border: 1px solid #55401c; border-radius: 10px; max-width: 520px; width: calc(100% - 2rem); padding: 1.6rem 2rem; text-align: center; }
.overlay-card h3 { margin-top: 0; color: var(--accent); font-family: var(--serif); }
.overlay-card p { line-height: 1.55; color: var(--ink); }

.overlay.moment { background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0.15) 55%); flex-direction: column; cursor: pointer; }
.moment-text { max-width: 720px; text-align: center; font-family: var(--serif); font-size: 1.35rem; line-height: 1.6; padding: 0 1.5rem; text-shadow: 0 2px 12px #000; }
.moment-text .speaker { display: block; font-size: 0.95rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.6rem; }
.moment-text.fade-in { animation: fadeUp 0.9s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.moment-hint { margin-top: 2rem; font-size: 0.8rem; color: var(--ink-dim); letter-spacing: 0.08em; text-transform: uppercase; }

/* ------------------------------ epilogue ------------------------------ */
.epilogue-card { background: var(--panel); border: 1px solid #333b4d; border-radius: 10px; max-width: 760px; width: calc(100% - 2rem); margin: 2rem 0; padding: 2rem 2.6rem; }
.epilogue-card h2 { font-family: var(--serif); color: var(--accent); margin-top: 0; }
.epilogue-card h3 { font-family: var(--serif); color: var(--ink); margin-top: 1.6rem; border-bottom: 1px solid #333b4d; padding-bottom: 0.35rem; }
.epilogue-body p { line-height: 1.65; color: var(--ink); }
.epilogue-facts li, .epilogue-sources li { line-height: 1.55; margin-bottom: 0.5em; }
.epilogue-sources { font-size: 0.88rem; color: var(--ink-dim); }
.epilogue-btns { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1.8rem; flex-wrap: wrap; }
