:root {
  --bg-deep: #0c0e13;
  --bg-near: #1a1d24;
  --ink: #e8e1d2;
  --muted: #786e5c;
  --warm: #ffd28a;
  --max-w: 560px;
  --font-prose: "Newsreader", Georgia, serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--ink);
  font: 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  min-height: 100dvh;
}
.screen.active { display: flex; }

/* Intro */

#intro {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
}

.wordmark {
  font-family: var(--font-prose);
  font-weight: 400;
  font-style: italic;
  font-size: 38px;
  line-height: 1.1;
  margin-bottom: 28px;
  color: var(--warm);
  letter-spacing: -0.01em;
}

.lede {
  font-family: var(--font-prose);
  font-size: 19px;
  line-height: 1.55;
  max-width: 32ch;
  margin: 0 auto 40px;
  color: var(--ink);
}

button.primary {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font: inherit;
  padding: 12px 32px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.4s, color 0.4s;
  letter-spacing: 0.04em;
}

button.primary:hover {
  background: var(--ink);
  color: var(--bg-deep);
}

.byline {
  margin-top: 80px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-prose);
}

.byline a { color: var(--muted); text-decoration: underline; text-decoration-thickness: 1px; }

/* Play screen */

#play {
  position: relative;
  background: var(--bg-deep);
  overflow: hidden;
  cursor: crosshair;
}

#scene {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Floating "save your trail" affordance — small, unobtrusive, bottom-right. */
.float-action {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(232, 225, 210, 0.08);
  color: rgba(232, 225, 210, 0.55);
  border: 1px solid rgba(232, 225, 210, 0.12);
  font: 600 18px/1 var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s, transform 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.float-action.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
}
.float-action:hover, .float-action:focus-visible {
  background: rgba(232, 225, 210, 0.18);
  color: rgba(232, 225, 210, 0.9);
  border-color: rgba(232, 225, 210, 0.35);
  outline: none;
}

.toast {
  position: absolute;
  bottom: 78px;
  right: 18px;
  max-width: 240px;
  padding: 8px 12px;
  background: rgba(28, 30, 36, 0.92);
  color: rgba(232, 225, 210, 0.85);
  font: italic 13px/1.45 var(--font-prose);
  border-radius: 6px;
  border: 1px solid rgba(232, 225, 210, 0.12);
  text-align: right;
  pointer-events: none;
}
