/* Shared tokens and components for every page. */
:root {
  --bg: #fff1f3;
  --fg: #d6204f;
  --muted: #8f5a68;
  --surface: #ffffff;
  --line: #f0c2cd;
  --danger: #b3123b;
  --font-display: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2a0f1e; --fg: #ff8fab; --muted: #c78a9d; --surface: #3a1829; --line: #5a2a40; --danger: #ff6b8e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2a0f1e; --fg: #ff8fab; --muted: #c78a9d; --surface: #3a1829; --line: #5a2a40; --danger: #ff6b8e;
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}

/* Name entry (index.html) */
.entry { width: 100%; max-width: 30rem; display: grid; gap: 1.25rem; }
.entry h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 8vw, 3.25rem);
  line-height: 1.1;
  text-wrap: balance;
}
.entry label { color: var(--muted); font-size: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.row input { flex: 1 1 12rem; min-width: 0; }
input[type="text"] {
  font: inherit;
  font-size: 1.125rem;
  color: var(--fg);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}
input[type="text"]:focus-visible, button:focus-visible, a.back:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 2px;
}
button, a.back {
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--fg);
  border: 0;
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
}
.message { min-height: 1.5em; margin: 0; color: var(--danger); }

/* Event pages */
a.back {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  left: max(16px, env(safe-area-inset-left, 0px));
  z-index: 5;
}
.box {
  width: 100%;
  max-width: 34rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
  font-size: 1.375rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.box .tag {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Love page: text fitted to 90% of the width */
body.love { padding-left: max(5vw, 16px, env(safe-area-inset-left, 0px)); padding-right: max(5vw, 16px, env(safe-area-inset-right, 0px)); }
.love h1 { margin: 0; width: 100%; line-height: 0; }
.love svg { display: block; width: 100%; height: auto; overflow: visible; }
.love text { fill: var(--fg); font-family: var(--font-display); font-weight: 600; font-size: 200px; }
