@font-face {
  font-family: "Tide Pixel";
  src: url("../../../assets/fonts/TidePixel.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #1b140f;
  --cream: #fff6ec;
  --paper: #f4efe4;
  --lobster: #922333;
  --gold: #e39b14;
  --night: #141c2e;
  --line: rgba(255, 246, 236, 0.16);
  color: var(--cream);
  font-family: "Segoe UI", "Liberation Sans", system-ui, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
}

#view {
  display: block;
  width: 100vw;
  height: 100vh;
}

#boot, #ui {
  position: fixed;
  inset: 0;
}

#boot {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(146, 35, 51, 0.28), transparent 46%),
    radial-gradient(ellipse at 50% 100%, #2a2118, #100e0c 62%);
  z-index: 30;
}

#boot[hidden] { display: none; }

.boot-card, .sheet {
  width: min(440px, calc(100% - 48px));
  padding: 28px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(22, 16, 12, 0.72);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
}

.wordmark {
  font-family: "Tide Pixel", "Segoe UI", serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.35;
  margin: 0;
}

h1.wordmark { font-size: 22px; }

.wordmark.tiny { font-size: 13px; }

.lede, .boot-status, .help, .hint, .sheet p { color: rgba(255, 246, 236, 0.82); }

.boot-status { margin: 14px 0 0; }

#ui { pointer-events: none; z-index: 2; }

#ui button, #ui a, #ui .sheet, #ui .dialogue, #ui .float-skip {
  pointer-events: auto;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--lobster);
  color: var(--cream);
  font: inherit;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

button:focus-visible, .dialogue:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:disabled { opacity: 0.45; cursor: default; }

.title-sheet {
  position: absolute;
  left: 40px;
  bottom: 40px;
}

.float-skip {
  position: absolute;
  right: 28px;
  bottom: 28px;
}

.play header.top, .objectives, #map, .actions, .prompt, .task, #tutorial, #projects {
  position: absolute;
}

header.top {
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  pointer-events: none;
}

.pills, .clock, .objectives, #map, .actions, .prompt, .task, #tutorial, .badge {
  pointer-events: none;
}

.pills {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pills span, .clock {
  background: rgba(22, 16, 12, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  padding: 8px 10px;
}

.pills i {
  display: block;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 246, 236, 0.62);
}

.pills b, #level, #phase {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.clock {
  text-align: right;
  min-width: 148px;
}

.clock #phase { display: block; color: var(--gold); }

.xp {
  margin-top: 6px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 246, 236, 0.16);
  overflow: hidden;
}

.xp span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}

.objectives {
  top: 108px;
  left: 20px;
  width: 280px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(22, 16, 12, 0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.objectives h2 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 246, 236, 0.66);
}

#goals, .stack {
  list-style: none;
  margin: 0;
  padding: 0;
}

#goals li, .stack li {
  margin: 0 0 8px;
}

#goals b, .stack b { display: block; font-size: 14px; }

#goals small, .stack small {
  display: block;
  color: rgba(255, 246, 236, 0.68);
  line-height: 1.35;
}

#goals li.done { opacity: 0.45; text-decoration: line-through; }

#map {
  top: 18px;
  right: 20px;
  width: 168px;
  height: 196px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #1d2418;
  margin-top: 86px;
}

.actions {
  left: 20px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(560px, 40vw);
  pointer-events: none;
}

.actions button { pointer-events: auto; }

.prompt, .task {
  left: 50%;
  transform: translateX(-50%);
  bottom: 28px;
  min-width: 220px;
  text-align: center;
}

.prompt {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(22, 16, 12, 0.72);
  border: 1px solid var(--line);
}

.task { bottom: 72px; width: 240px; }

#tutorial {
  right: 28px;
  bottom: 28px;
  width: min(380px, 32vw);
  pointer-events: auto;
}

#tutorial .row, .panel .row, .title-sheet .row { pointer-events: auto; }

.dialogue {
  position: absolute;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 80px));
  padding: 16px 18px 12px;
  border-radius: 16px;
  background: rgba(22, 16, 12, 0.84);
  border: 1px solid var(--line);
  cursor: pointer;
}

.dialogue b { color: var(--gold); }

.dialogue p { margin: 6px 0; font-size: 18px; line-height: 1.4; }

.dialogue small { color: rgba(255, 246, 236, 0.5); }

#toasts {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

#toasts div {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(27, 20, 15, 0.88);
  border: 1px solid var(--line);
}

.panel, .ending {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 48px));
}

.panel-head, .row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-head { justify-content: space-between; }

.panel-head h2, .ending h2 { margin: 0; }

.ending-body { white-space: pre-wrap; line-height: 1.45; }

.badge {
  position: absolute;
  transform: translate(-50%, -120%);
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(22, 16, 12, 0.8);
  border: 1px solid var(--line);
  text-align: center;
}

.badge b { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

[hidden] { display: none !important; }

.text-link {
  color: var(--cream);
  font-weight: 700;
  text-underline-offset: 3px;
}
