:root {
  --bg: #141118;
  --panel: #231e2a;
  --panel-light: #322b3b;
  --border: #4a4056;
  --text: #ece6f0;
  --muted: #a79dae;
  --gold: #ffd27a;
  --alive: #99ff99;
  --heir: #ffbfe6;
  --dead: #bfb3b3;
  --founder: #bfd9ff;
}

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

h1, h2, h3 { color: var(--gold); margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; margin-bottom: 4px; }

button {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 8px 14px;
  text-align: left;
}
button:hover:not(:disabled) { border-color: var(--gold); }
button:disabled { cursor: default; opacity: 0.4; }
button.selected { background: #54452a; border-color: var(--gold); }

.page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow: auto;
  padding: 24px;
}
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.columns { display: grid; flex: 0 0 auto; gap: 16px; grid-template-columns: 1fr 1fr; }
.menu-actions { display: flex; flex-direction: column; gap: 10px; width: 340px; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card-button { white-space: pre-line; }
.text-block { margin-bottom: 14px; white-space: pre-line; }

.lineage { display: flex; flex-direction: column; gap: 8px; }
.lineage-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-line;
  width: 290px;
}
.status-alive { color: var(--alive); }
.status-heir { color: var(--heir); }
.status-dead { color: var(--dead); }
.status-founder, .status-partner { color: var(--founder); }

#game-canvas {
  display: block;
  height: 100%;
  width: 100%;
}
.game-root { height: 100%; position: relative; }

.hud {
  inset: 0;
  padding: 12px;
  pointer-events: none;
  position: absolute;
  text-shadow: 0 1px 2px #000;
}
.hud-stats { width: 260px; }
.bar {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 3px;
  height: 12px;
  margin: 2px 0 5px;
  overflow: hidden;
}
.bar > i { display: block; height: 100%; width: 0; }
.bar-hp > i { background: #cc3333; }
.bar-satiety > i { background: #e69933; }
.bar-xp > i { background: #6699ff; }
.bar-devour > i { background: #80e64d; }

.hud-info { position: absolute; right: 12px; text-align: right; top: 12px; white-space: pre-line; }
.hud-toasts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  right: 12px;
  text-align: right;
  top: 150px;
}
.toast { transition: opacity 0.5s; }
.hud-bottom {
  align-items: center;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  left: 12px;
  position: absolute;
  right: 12px;
}
.hud-prompt { min-height: 22px; text-align: center; white-space: pre-line; }
.hud-devour { width: 260px; }
.hud-powers { align-self: flex-start; white-space: pre-line; }

.overlay {
  background: rgba(10, 8, 12, 0.88);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 36px;
  position: absolute;
}
.overlay-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1200px;
  overflow: hidden;
  padding: 16px;
  width: 100%;
}
.overlay-panel.small { align-self: center; max-width: 360px; }
.overlay-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.hidden { display: none !important; }
