@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --pine: #0b3d2e;
  --pine-dark: #072d22;
  --fairway: #16855c;
  --lime: #b7f34a;
  --cream: #f5f1e5;
  --paper: #f8faf7;
  --ink: #102019;
  --muted: #66736d;
  --line: #dbe3de;
  --white: #ffffff;
  --danger: #a53838;
  --shadow: 0 24px 70px rgba(11, 61, 46, 0.12);
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px max(20px, calc((100vw - 1060px) / 2));
  background: rgba(248, 250, 247, 0.92);
  border-bottom: 1px solid rgba(219, 227, 222, 0.82);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 1.08rem; font-weight: 800; letter-spacing: -0.04em; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
main { overflow: clip; }

.app-shell { max-width: 1060px; margin: 0 auto; padding: 46px 20px 78px; }
.intro-strip { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: end; gap: 50px; margin-bottom: 30px; }
.eyebrow, .section-label, .story-kicker { color: var(--fairway); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.intro-strip h1 { margin: 9px 0 0; font-size: clamp(2.75rem, 6vw, 5rem); font-weight: 790; line-height: 0.95; letter-spacing: -0.065em; }
.intro-strip > p { max-width: 430px; margin: 0 0 5px; color: var(--muted); font-size: 1rem; line-height: 1.65; }

.composer-card { max-width: 760px; margin: 0 auto; padding: clamp(20px, 4vw, 34px); background: var(--white); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.composer-header, .result-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.composer-header h2, .result-heading h2 { margin: 5px 0 0; font-size: clamp(1.75rem, 4vw, 2.45rem); letter-spacing: -0.05em; }
.time-pill { flex: 0 0 auto; padding: 7px 11px; color: var(--pine); background: var(--cream); border-radius: 999px; font-size: 0.75rem; font-weight: 750; }

.progress { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px 0 32px; padding: 0; list-style: none; }
.progress::before { content: ""; position: absolute; top: 16px; left: 16.6%; right: 16.6%; height: 2px; background: var(--line); }
.progress li { position: relative; z-index: 1; display: grid; justify-items: center; gap: 7px; color: #8a9590; font-size: 0.72rem; }
.progress li span { display: grid; width: 33px; height: 33px; place-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 50%; font-size: 0.72rem; font-weight: 800; }
.progress li strong { font-weight: 700; }
.progress li.is-current, .progress li.is-complete { color: var(--pine); }
.progress li.is-current span { color: var(--pine); background: var(--lime); border-color: var(--lime); }
.progress li.is-complete span { color: var(--white); background: var(--pine); border-color: var(--pine); }

form { margin: 0; }
.form-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-wide { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: var(--ink); font-size: 0.875rem; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; color: var(--ink); background: #fcfdfb; outline: 0; }
input::placeholder, textarea::placeholder { color: #929c97; }
input:focus, select:focus, textarea:focus { border-color: var(--fairway); box-shadow: 0 0 0 4px rgba(22, 133, 92, 0.12); }
textarea { min-height: 100px; resize: vertical; line-height: 1.48; }
.optional { color: var(--muted); font-weight: 500; }
.tone-field select { max-width: 240px; }

.step-copy { margin-bottom: 16px; }
.step-copy h3 { margin: 0 0 4px; font-size: 1.12rem; letter-spacing: -0.02em; }
.step-copy p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.players { display: grid; gap: 9px; }
.player-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 130px 34px; align-items: center; gap: 8px; padding: 8px; background: var(--cream); border-radius: 15px; }
.player-number { display: grid; width: 29px; height: 29px; place-items: center; color: var(--cream); background: var(--pine); border-radius: 50%; font-size: 0.72rem; font-weight: 800; }
.player-row input { min-height: 45px; padding: 10px 11px; background: var(--white); }
.remove-player { width: 32px; height: 32px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 1.35rem; cursor: pointer; }
.remove-player:hover { color: var(--danger); background: var(--white); }
.add-player-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; margin-top: 12px; padding: 0; color: var(--pine); background: transparent; border: 0; font-size: 0.84rem; font-weight: 750; cursor: pointer; }
.add-player-button span { display: grid; width: 28px; height: 28px; place-items: center; background: rgba(183, 243, 74, 0.55); border-radius: 50%; font-size: 1rem; }
.moment-grid { align-items: end; }

.primary-button, .secondary-button, .ghost-button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 19px;
  border: 0;
  border-radius: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.primary-button { color: var(--white); background: var(--pine); box-shadow: 0 9px 24px rgba(11, 61, 46, 0.18); }
.primary-button:hover { background: #07523a; transform: translateY(-1px); }
.secondary-button { color: var(--pine); background: var(--cream); border: 1px solid var(--line); }
.ghost-button { min-height: 40px; color: var(--pine); background: transparent; border: 1px solid var(--line); }
.text-button { min-height: 40px; padding: 0 5px; color: var(--pine); background: transparent; }
.step-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.step-actions-end { justify-content: flex-end; }
.form-error { margin: 16px 0 0; padding: 11px 13px; color: var(--danger); background: #fff1f1; border-radius: 10px; font-size: 0.82rem; font-weight: 650; }
.privacy-note { margin: 13px 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }

.result { max-width: 880px; margin: 0 auto; padding: 30px 20px 88px; }
.result-heading { margin-bottom: 22px; }
.story-card { position: relative; overflow: hidden; padding: clamp(28px, 6vw, 58px); color: var(--cream); background: var(--pine); border-radius: 30px; box-shadow: var(--shadow); isolation: isolate; }
.story-card::before { content: "18"; position: absolute; z-index: -1; right: -20px; top: 110px; color: rgba(183, 243, 74, 0.055); font-size: clamp(12rem, 34vw, 20rem); font-weight: 850; line-height: 0.8; letter-spacing: -0.1em; }
.story-card::after { content: ""; position: absolute; z-index: -1; right: -90px; top: -100px; width: 250px; height: 250px; border: 24px solid rgba(183, 243, 74, 0.08); border-radius: 50%; }
.story-topline { display: flex; justify-content: space-between; gap: 16px; color: #bcd0c7; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.winner-block { display: inline-grid; gap: 1px; margin-top: 36px; padding: 12px 16px; color: var(--pine); background: var(--lime); border-radius: 14px; }
.winner-label { font-size: 0.61rem; font-weight: 850; letter-spacing: 0.12em; }
.winner-block strong { max-width: 280px; overflow: hidden; font-size: 1.35rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.winner-block > span:last-child { font-size: 0.78rem; font-weight: 750; }
.story-kicker { margin: 52px 0 0; color: var(--lime); }
.story-card > h2 { max-width: 680px; margin: 11px 0; font-size: clamp(2.35rem, 7vw, 4.7rem); line-height: 0.97; letter-spacing: -0.065em; }
.story-course { color: #bcd0c7; font-size: 1rem; }
.story-text { max-width: 660px; margin-top: 28px; font-size: 1.02rem; line-height: 1.75; }
.moment-card { max-width: 660px; margin: 30px 0; padding: 21px; color: var(--ink); background: var(--cream); border-left: 7px solid var(--lime); border-radius: 16px; }
.moment-card > span { color: var(--fairway); font-size: 0.66rem; font-weight: 850; letter-spacing: 0.13em; }
.moment-card strong { display: block; margin-top: 5px; font-size: 1.18rem; letter-spacing: -0.02em; }
.moment-card p { margin: 7px 0 0; line-height: 1.58; }
.podium { display: grid; gap: 1px; margin: 34px 0; border-radius: 14px; overflow: hidden; }
.podium-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 13px 15px; background: rgba(255, 255, 255, 0.075); }
.podium-row:first-child { color: var(--pine); background: var(--lime); }
.podium-position, .podium-score { font-weight: 850; }
.story-signature { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 46px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.18); color: #bcd0c7; font-size: 0.78rem; }
.story-brand { display: flex; align-items: center; gap: 9px; color: var(--cream); font-size: 1rem; }
.story-brand img { width: 36px; height: 36px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 20px; }
.action-status { min-height: 1.3em; margin: 10px 0 0; color: var(--muted); font-size: 0.8rem; }

footer { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 36px 20px; color: var(--muted); font-size: 0.78rem; }
footer img { width: 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 760px) {
  .app-shell { padding-top: 30px; }
  .intro-strip { grid-template-columns: 1fr; gap: 10px; margin-bottom: 24px; }
  .intro-strip h1 { font-size: clamp(2.65rem, 12vw, 4rem); }
  .intro-strip > p { max-width: 620px; font-size: 0.94rem; line-height: 1.55; }
}

@media (max-width: 560px) {
  .site-header { min-height: 60px; padding-inline: 14px; }
  .brand img { width: 35px; height: 35px; }
  .app-shell { padding: 24px 12px 52px; }
  .eyebrow { font-size: 0.64rem; }
  .intro-strip h1 { margin-top: 7px; font-size: 2.65rem; }
  .intro-strip > p { font-size: 0.9rem; }
  .composer-card { padding: 20px 14px; border-radius: 22px; }
  .composer-header h2 { font-size: 1.7rem; }
  .progress { margin: 24px 0 28px; }
  .progress li { font-size: 0.65rem; }
  .progress li span { width: 31px; height: 31px; }
  .progress::before { top: 15px; }
  .field-grid, .moment-grid { grid-template-columns: 1fr; gap: 14px; }
  .field-wide { grid-column: auto; }
  .tone-field select { max-width: none; }
  .player-row { grid-template-columns: 29px minmax(0, 1fr) 88px 28px; gap: 5px; padding: 6px; }
  .player-row input { padding: 9px 8px; font-size: 0.86rem; }
  .step-actions .primary-button { flex: 1; }
  .create-button { font-size: 0.86rem; }
  .result { padding: 34px 12px 68px; }
  .result-heading { align-items: flex-end; }
  .story-card { border-radius: 24px; }
  .story-topline, .story-signature { align-items: flex-start; flex-direction: column; }
  .story-kicker { margin-top: 42px; }
  .result-actions > * { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
