/* The Labyrinth of Crete — dark-fantasy Greek mythology theme */

:root {
  --bg: #0c0913;
  --bg2: #140e1d;
  --panel: #1a1426;
  --panel2: #221a31;
  --border: #3a2e4d;
  --gold: #c9a227;
  --gold-bright: #e8c75a;
  --marble: #e6dfce;
  --text: #d8d0e0;
  --muted: #9286a3;
  --blood: #8e2330;
  --blood-bright: #c0394a;
  --hp: #4caf6a;
  --hp-low: #c0394a;
  --sea: #2f6f93;
  --shadow: rgba(0, 0, 0, 0.55);
  --serif: "Georgia", "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -10%, #221733 0%, var(--bg) 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
}

.hidden { display: none !important; }

/* ------------------------------ buttons ------------------------------- */

.btn {
  font-family: var(--sans);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  color: var(--marble);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #6d4f17, #4a350f);
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.btn.small { padding: 0.35rem 0.6rem; font-size: 0.82rem; }
.btn.danger { border-color: var(--blood); color: var(--blood-bright); }
.btn.danger:hover:not(:disabled) { border-color: var(--blood-bright); }

/* --------------------------- title screen ----------------------------- */

.title-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.title-card {
  width: min(560px, 100%);
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px var(--shadow);
  padding: 1.5rem;
  text-align: center;
}
.title-art {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.title-heading {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 2rem;
  margin: 1rem 0 0.2rem;
  letter-spacing: 1px;
}
.title-sub { color: var(--muted); margin: 0 0 1.2rem; font-style: italic; }
.title-form { display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.title-form label { color: var(--muted); font-size: 0.85rem; }
.title-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--marble);
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  font-family: var(--serif);
}
.title-form input:focus { outline: none; border-color: var(--gold); }
.title-hint { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

/* language picker (title screen) */
.lang-picker { margin: 0.4rem 0 1rem; text-align: left; }
.lang-picker-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.lang-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lang-btn:hover { border-color: var(--gold); }
.lang-btn.active { border-color: var(--gold); background: rgba(201, 162, 39, 0.15); color: var(--gold-bright); }
.lang-flag { font-size: 1.05rem; }

/* language dropdown (HUD) */
.hud-lang {
  background: var(--bg);
  color: var(--marble);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 9rem;
}
.hud-lang:focus { outline: none; border-color: var(--gold); }

/* ----------------------------- layout --------------------------------- */

.game-screen { padding: 1rem; max-width: 1200px; margin: 0 auto; }
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  align-items: start;
}

.stage {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 12px 40px var(--shadow);
}

.scene-art-wrap { position: relative; }
.scene-art {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg);
}

.scene-title {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 1.5rem;
  margin: 1rem 0 0.5rem;
}
.scene-text { font-family: var(--serif); font-size: 1.05rem; }
.scene-text p { margin: 0 0 0.7rem; }

/* event log (effects feedback) */
.event-log {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
  color: var(--gold-bright);
}
.log-line { margin: 0.15rem 0; }

/* ----------------------------- choices -------------------------------- */

.choices { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.5rem; }
.choice {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: var(--marble);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--serif);
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.choice:hover:not(:disabled) {
  border-left-color: var(--gold-bright);
  background: linear-gradient(180deg, #2c2240, var(--panel2));
  transform: translateX(3px);
}
.choice.locked { border-left-color: var(--muted); opacity: 0.65; cursor: not-allowed; }
.choice-hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; font-family: var(--sans); }
.choice.combat-action { border-left-color: var(--blood-bright); }
.choice.combat-action:hover:not(:disabled) { background: linear-gradient(180deg, #3a2030, var(--panel2)); }
.choice.use-toggle { border-left-color: var(--hp); }

/* ----------------------------- ending --------------------------------- */

.ending-banner {
  text-align: center;
  font-family: var(--serif);
  letter-spacing: 3px;
  font-size: 1.2rem;
  padding: 0.6rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
}
.ending-banner.good { color: #8fe0a0; border-color: #2f6d4f; background: rgba(47, 109, 79, 0.18); }
.ending-banner.neutral { color: var(--marble); border-color: var(--border); background: rgba(58, 46, 77, 0.3); }
.ending-banner.bad { color: var(--blood-bright); border-color: var(--blood); background: rgba(142, 35, 48, 0.18); }

/* ------------------------------- HUD ---------------------------------- */

.hud {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 12px 40px var(--shadow);
  position: sticky;
  top: 1rem;
}
.hud-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.hud-name { font-family: var(--serif); color: var(--gold-bright); font-size: 1.15rem; font-weight: 700; }
.hud-buttons { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.hud-block { margin-bottom: 0.9rem; }
.hud-block.grow { margin-bottom: 0; }
.hud-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

/* bars */
.bar {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
}
.bar-fill { height: 100%; transition: width 0.35s ease; border-radius: 999px; }
.hp-fill { background: linear-gradient(90deg, #2f6d4f, var(--hp)); }
.hp-fill.low { background: linear-gradient(90deg, #6d1f28, var(--hp-low)); }
.bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* stats */
.stats { display: flex; flex-direction: column; gap: 0.4rem; }
.stat {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
}
.stat-label { color: var(--text); font-size: 0.9rem; }
.stat-val { color: var(--gold-bright); font-weight: 700; font-family: var(--serif); }

/* gold */
.gold-row { display: flex; align-items: center; gap: 0.4rem; }
.gold-val { color: var(--gold-bright); font-weight: 700; font-size: 1.1rem; font-family: var(--serif); }

.quest-text { font-family: var(--serif); font-style: italic; color: var(--text); font-size: 0.92rem; }

/* inventory */
.inventory { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.inv-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
  cursor: help;
}
.inv-icon { font-size: 1.1rem; }
.inventory .empty { color: var(--muted); font-style: italic; padding: 0.35rem 0.5rem; }

/* enemy hp overlay */
.enemy-hp {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  background: rgba(8, 5, 16, 0.78);
  border: 1px solid var(--blood);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}
.enemy-name { font-family: var(--serif); color: var(--blood-bright); font-size: 0.9rem; }
.bar.enemy { height: 16px; margin-top: 0.25rem; border-color: var(--blood); }
.enemy-fill { background: linear-gradient(90deg, #6d1f28, var(--blood-bright)); }
.in-combat .scene-art { border-color: var(--blood); }

/* ------------------------------ dialog -------------------------------- */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 8, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}
.dialog {
  width: min(520px, 100%);
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 20px 60px var(--shadow);
  overflow: hidden;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}
.dialog-head h3 { margin: 0; font-family: var(--serif); color: var(--gold-bright); }
.dialog-body { padding: 1rem; max-height: 65vh; overflow-y: auto; }

.slot-list { display: flex; flex-direction: column; gap: 0.5rem; }
.slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.slot-meta { color: var(--muted); font-size: 0.8rem; }
.slot-actions { display: flex; gap: 0.3rem; }

/* ------------------------------- toast -------------------------------- */

.toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel2);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 60;
  font-size: 0.9rem;
}

/* --------------------------- responsive ------------------------------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .hud { position: static; order: 2; }
  .stage { order: 1; }
  .scene-title { font-size: 1.3rem; }
}
