:root {
  color-scheme: light dark;
  --bg: #faf9f5;
  --fg: #1f1e1d;
  --muted: #6b6a66;
  --surface: #ffffff;
  --border: #e5e2d9;
  --accent: #b4532a;
  --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1e1d;
    --fg: #f0eee6;
    --muted: #a3a19a;
    --surface: #2b2a27;
    --border: #3d3b37;
    --accent: #d97745;
    --on-accent: #1f1e1d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, sans-serif;
}

main { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: 3rem 1rem; }

h1 {
  margin: 0 0 2rem;
  font: 400 clamp(1.75rem, 6vw, 2.5rem)/1.2 Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}

.name { color: var(--accent); }
.hint { color: var(--muted); font-size: 0.9rem; font-weight: 400; }

label { display: block; margin: 1rem 0 0.25rem; font-weight: 600; }

textarea, input {
  width: 100%;
  padding: 0.75rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

button, .button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

#gen-result { margin-top: 2rem; }
.link-row { display: flex; gap: 0.5rem; }
.link-row input { flex: 1; min-width: 0; }
.link-row button { margin-top: 0; }

#caption { min-height: 1.5em; margin: 0 0 1rem; font-size: 1.25rem; }

.chat {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
}

.chat-input {
  flex: 1;
  min-height: 3rem;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.5rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-input:empty::before { content: "Ask anything…"; color: var(--muted); }

.chat-send {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border-radius: 0.6rem;
  transition: transform 0.1s;
}

.chat-send.pressed { transform: scale(0.85); }

#skip { display: inline-block; margin-top: 1.5rem; color: var(--muted); }
#subcaption { margin: 0.75rem 0 0; }

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  transform: translate(85vw, 85vh);
  transition: transform 0.7s ease-in-out; /* keep in sync with MOVE_MS in player.js */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M2 1l14 9-6 1.5L7 18z' fill='black' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat;
}

footer { padding: 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
footer a { color: inherit; }
