/* Dark Fantasy colours, and the fonts darkfantasycreations.com uses (Lato for
   text, Manrope for headings, numbers and buttons). One theme: the brand red
   page whatever the device is set to. Cards are a deeper red and buttons the
   brand brown, so cream text and red-free accents stay readable on the red. */
:root {
  --bg: #e01f26;
  --ink: #fff2b7;
  --deep: #261000;                     /* the brand brown */
  --accent: var(--deep);
  --accent-ink: #fff2b7;
  --accent-hover: #4a2408;
  --surface: color-mix(in srgb, var(--deep) 24%, var(--bg));
  --field: color-mix(in srgb, var(--deep) 36%, var(--bg));
  --muted: color-mix(in srgb, var(--ink) 82%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 30%, var(--bg));
  --good: #d4f5b8;
  --bad: #ffd0c8;
  --warn: #ffe08a;
  --radius: 14px;
  --text-font: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display-font: "Manrope", "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--text-font);
}
.wrap { max-width: 1312px; margin: 0 auto; padding: 24px 16px 64px; }   /* 1280px of content */
.wrap.narrow { max-width: 720px; }

.logo { display: block; width: 96px; height: auto; margin: 0 0 16px; }

h1, h2, .stat b, .result .big, button, .btn, .pill { font-family: var(--display-font); }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.12;
     margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* the home page's top row: logo, title, and the two numbers on the right */
.top { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.top .logo { width: 88px; margin: 0; }
.top h1 { margin: 0; font-size: clamp(1.4rem, 3.4vw, 2.1rem); }
.top .stats { margin: 0 0 0 auto; }

.stats { display: flex; gap: 12px; margin-bottom: 16px; }
.stat {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px;
}
.top .stat { min-width: 116px; padding: 8px 14px; }
.top .stat b { font-size: 1.3rem; }
.top .stat span { white-space: nowrap; }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 640px) {
  .top .stats { margin-left: 0; flex-basis: 100%; }
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}

.player { padding: 0; overflow: hidden; }
.player video { display: block; width: 100%; max-height: 80vh; background: #000; }
.player .bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem;
}
.player .bar b { color: var(--ink); }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

form.row { display: flex; gap: 8px; flex-wrap: wrap; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 4px; }
input[type="tel"], input[type="text"], input[type="file"] {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
}
input[type="file"]::file-selector-button {
  font: 700 0.9rem var(--display-font); color: var(--ink); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; margin-right: 12px;
}
input::placeholder { color: color-mix(in srgb, var(--ink) 45%, var(--bg)); }
form.row input { flex: 1 1 200px; width: auto; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

button, .btn {
  font-size: 1rem; font-weight: 700; cursor: pointer; text-decoration: none;
  padding: 12px 20px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); display: inline-block;
}
button:hover:not(:disabled), .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.secondary, .btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button.secondary:hover:not(:disabled), .btn.secondary:hover { background: var(--surface); border-color: var(--ink); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.result .big { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.result .meta { color: var(--muted); font-size: 0.85rem; margin: 2px 0 14px; }
.result .note { margin-top: 12px; font-size: 0.9rem; }
/* their moments, when they are in the ad more than once */
select.moments {
  display: block; width: 100%; margin: 10px 0 12px; padding: 12px 40px 12px 14px;
  font: 700 1rem var(--display-font); color: var(--ink); cursor: pointer;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff2b7' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); border-radius: 10px; appearance: none;
}
select.moments:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
select.moments option { background: var(--deep); color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-bad { color: var(--bad); }
.msg-warn { color: var(--warn); }
.msg-good { color: var(--good); }

.pill {
  display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 2px 10px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
}
[hidden] { display: none !important; }

.banner {
  background: color-mix(in srgb, var(--warn) 12%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--bg)); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; font-size: 0.9rem;
}
ul.steps { list-style: none; padding: 0; margin: 16px 0 0; }
ul.steps li { padding: 6px 0; color: var(--muted); }
ul.steps li.now { color: var(--ink); font-weight: 700; }
ul.steps li.done { color: var(--good); }
nav { font-size: 0.85rem; margin-top: 24px; color: var(--muted); }
nav a, .sub a { color: var(--ink); }
code { font-size: 0.9em; }

/* Find my moment (60%) beside the game (40%). The game only plays below
   768px wide, which a 40% column always is; on a phone they stack and the
   game takes the full width. */
.duo { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
.duo > .card { margin-bottom: 0; min-width: 0; }
.duo + * { margin-top: 16px; }
.game { padding: 0; overflow: hidden; background: #000;
        height: min(820px, 88vh); height: min(820px, 88dvh); }
.game iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 767px) {
  .duo { grid-template-columns: 1fr; }
  /* leave room around it so the page can still be scrolled past the game */
  .game { height: min(720px, 80vh); height: min(720px, 80dvh); }
}
