/* =====================================================================
   Yovacay — Family Vacation Hub
   ---------------------------------------------------------------------
   Mobile-first. Light by default: you read this outdoors, in sun, on a
   phone — a dark UI is the wrong choice there. Dark mode follows the
   system setting for late-night planning.
   No framework; the old build pulled ~250KB of Bootstrap + icon fonts
   from a CDN to draw a handful of cards.
   ===================================================================== */

/* ---------- Tokens --------------------------------------------------- */
:root {
  /* Warm paper + ink */
  --bg:        #FBF8F3;
  --bg-tint:   #F4EEE4;
  --surface:   #FFFFFF;
  --surface-2: #F7F3EC;
  --line:      #E4DACA;
  --line-soft: #EFE7DA;

  --ink:       #1B2523;
  --ink-2:     #4A5A56;
  --ink-dim:   #7C8B86;
  --ink-faint: #A3AFAA;

  /* Deep ocean primary, sunset coral accent */
  --sea:       #0E6E63;
  --sea-deep:  #0A544B;
  --sea-soft:  #E3F1EE;
  --coral:     #E2623F;
  --coral-soft:#FCEBE4;
  --sun:       #E0A526;
  --sun-soft:  #FCF2DC;

  --shadow-sm: 0 1px 2px rgba(27,37,35,.06), 0 1px 3px rgba(27,37,35,.05);
  --shadow:    0 2px 4px rgba(27,37,35,.05), 0 8px 24px -10px rgba(27,37,35,.18);
  --shadow-lg: 0 4px 8px rgba(27,37,35,.06), 0 24px 48px -16px rgba(27,37,35,.28);

  --r-sm: .5rem;
  --r:    .875rem;
  --r-lg: 1.25rem;
  --r-xl: 1.75rem;

  --pad: 1.125rem;
  --tap: 2.875rem;

  /* Vertical breathing room above and below a page's main content. */
  --pad-block: 1rem;
  /* How far the quick-action tiles sit over the hero's bottom edge. */
  --quick-overlap: 1.25rem;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", var(--font);

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #10161A;
    --bg-tint:   #151D22;
    --surface:   #182126;
    --surface-2: #1E282E;
    --line:      #2C3940;
    --line-soft: #232F35;

    --ink:       #ECF2F0;
    --ink-2:     #B6C4C1;
    --ink-dim:   #8A9995;
    --ink-faint: #6A7975;

    --sea:       #4DBFAE;
    --sea-deep:  #2E9C8C;
    --sea-soft:  #12312E;
    --coral:     #F58363;
    --coral-soft:#38221C;
    --sun:       #E8B95A;
    --sun-soft:  #33291480;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 2px 4px rgba(0,0,0,.4), 0 10px 28px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 4px 8px rgba(0,0,0,.4), 0 28px 56px -18px rgba(0,0,0,.7);
  }
}

/* ---------- Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1,h2,h3,h4,h5,h6,p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--sea); }

:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: var(--r-sm); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- Layout --------------------------------------------------- */
.wrap { width: 100%; max-width: 46rem; margin-inline: auto; padding-inline: var(--pad); }
.wrap--wide { max-width: 68rem; }
/* Equal breathing room top and bottom — the trip page used to have only a
   bottom padding, which left the first element flush against the hero. */
.wrap--main { padding-block: var(--pad-block); }
.stack > * + * { margin-top: 1rem; }

/* ---------- Top bar -------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--safe-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner { display: flex; align-items: center; gap: .5rem; min-height: 3.25rem; }

.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 800; letter-spacing: -.02em; font-size: 1.02rem;
  color: var(--ink); text-decoration: none; margin-right: auto; min-width: 0;
}
.brand svg { flex: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Buttons -------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: var(--tap); padding: 0 1.05rem;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 650; font-size: .95rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn--primary {
  background: var(--sea); border-color: transparent; color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -8px var(--sea);
}
.btn--coral { background: var(--coral); border-color: transparent; color: #fff; }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn--danger { color: #C0392B; border-color: #E8C4BE; }
@media (prefers-color-scheme: dark) { .btn--danger { color: #F58363; border-color: #4A2E27; } }
.btn--sm  { min-height: 2.25rem; padding: 0 .7rem; font-size: .85rem; border-radius: var(--r-sm); }
.btn--lg  { min-height: 3.25rem; font-size: 1.02rem; }
.btn--icon{ min-width: var(--tap); padding: 0; }
.btn--block { width: 100%; }

/* ---------- Cards & chips -------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--pad);
  box-shadow: var(--shadow-sm);
}
.card--flush { padding: 0; overflow: hidden; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  color: var(--ink-2); font-size: .78rem; font-weight: 650; white-space: nowrap;
}
.chip--sea   { background: var(--sea-soft);   border-color: transparent; color: var(--sea-deep); }
.chip--coral { background: var(--coral-soft); border-color: transparent; color: var(--coral); }
.chip--sun   { background: var(--sun-soft);   border-color: transparent; color: #916A0B; }
@media (prefers-color-scheme: dark) {
  .chip--sea { color: var(--sea); }
  .chip--sun { color: var(--sun); }
}
.chip--now::before {
  content: ""; width: .45rem; height: .45rem; border-radius: 50%;
  background: currentColor; animation: pulse 1.9s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.label {
  display: block; font-size: .7rem; font-weight: 750;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .3rem;
}

.section-title {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.05rem; font-weight: 800; letter-spacing: -.015em;
  margin-bottom: .75rem;
}
.section-title svg { color: var(--sea); flex: none; }

/* ---------- Hero ----------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--bg-tint); }
/* A trip with no cover photo still gets a horizon rather than a grey slab. */
.hero--plain {
  background:
    radial-gradient(90% 70% at 78% 12%, color-mix(in srgb, var(--sun) 26%, transparent) 0%, transparent 58%),
    linear-gradient(165deg, color-mix(in srgb, var(--sea) 16%, var(--bg-tint)) 0%, var(--bg) 78%);
  border-bottom: 1px solid var(--line-soft);
}
.hero__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg,
    rgba(10,20,18,.30) 0%, rgba(10,20,18,.45) 45%, rgba(10,20,18,.82) 100%);
}
.hero--plain::after { background: none; }
/* Bottom padding = the amount the quick tiles overlap, plus the gap we
   actually want to see between the chips and the tiles. Expressed against
   --quick-overlap so the two can't drift apart. */
.hero__body {
  position: relative; z-index: 2;
  padding-block: 2.75rem calc(var(--quick-overlap) + 1.375rem);
}
.hero--img .hero__body { min-height: 17rem; display: flex; flex-direction: column; justify-content: flex-end; }
.hero--img .hero__body,
.hero--img .hero__body a { color: #fff; }
.hero--img .hero__kicker { color: rgba(255,255,255,.82); }
.hero--img .hero__meta   { color: rgba(255,255,255,.9); }

.hero__kicker {
  font-size: .72rem; font-weight: 750; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: .4rem;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 7vw, 2.75rem);
  font-weight: 820; letter-spacing: -.03em; line-height: 1.08;
  text-wrap: balance;
}
.hero--img .hero__title { text-shadow: 0 2px 18px rgba(0,0,0,.4); }
.hero__meta { margin-top: .35rem; font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.hero__pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.hero--img .hero__pills .chip {
  background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.26);
  color: #fff; backdrop-filter: blur(6px);
}
.hero--img .hero__pills a.chip { text-decoration: none; }

/* ---------- Countdown ------------------------------------------------ */
.countdown {
  display: flex; align-items: baseline; gap: .45rem;
  font-family: var(--font-display);
}
.countdown__n { font-size: 2.1rem; font-weight: 830; line-height: 1; letter-spacing: -.03em; }
.countdown__l { font-size: .95rem; font-weight: 650; color: var(--ink-2); }

/* ---------- Quick actions -------------------------------------------- */
.quick {
  display: grid; gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(4.75rem, 1fr));
  /* Float up over the hero's lower edge. The extra --pad-block cancels the
     main element's top padding, so the overlap really is --quick-overlap
     however that padding changes. */
  margin-top: calc(-1 * (var(--quick-overlap) + var(--pad-block)));
  position: relative; z-index: 5;
}
.qa {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; padding: .7rem .35rem;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
  font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.15;
  transition: transform .1s ease;
}
.qa:active { transform: scale(.96); }
.qa svg { color: var(--sea); }
.qa__sub { font-size: .66rem; font-weight: 600; color: var(--ink-faint); }

/* ---------- Detail rows ---------------------------------------------- */
.rows { display: grid; gap: .1rem; }
.row {
  display: flex; align-items: baseline; gap: 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: 0; }
.row__k { flex: none; width: 7.5rem; font-size: .82rem; font-weight: 650; color: var(--ink-dim); }
.row__v { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Copyable value ------------------------------------------- */
.copy {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  padding: .7rem .85rem; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  text-align: left; transition: border-color .15s ease;
}
.copy:active { border-color: var(--sea); }
.copy__body { flex: 1; min-width: 0; }
.copy__k { font-size: .7rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.copy__v { font-weight: 750; font-size: 1.05rem; overflow-wrap: anywhere; }
.copy__v--code { font-family: var(--font-display); letter-spacing: .06em; font-size: 1.3rem; }
.copy svg { flex: none; color: var(--ink-dim); }

/* ---------- Schedule -------------------------------------------------- */
.day + .day { margin-top: 1.25rem; }
.day__head {
  display: flex; align-items: center; gap: .5rem;
  position: sticky; top: 3.25rem; z-index: 10;
  padding: .45rem 0 .35rem;
  /* Sits inside a card, so it must fade to the card colour — using the
     page background here leaves a dark band across the schedule. */
  background: linear-gradient(var(--surface) 72%, color-mix(in srgb, var(--surface) 0%, transparent));
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: .2rem;
}
.day__name { font-weight: 800; letter-spacing: -.01em; }
.day__n { font-size: .75rem; color: var(--ink-faint); font-weight: 650; }
.day--today .day__name { color: var(--sea); }

.ev {
  display: flex; gap: .8rem; padding: .7rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.ev:last-child { border-bottom: 0; }
.ev__time {
  flex: none; width: 4.25rem; padding-top: .1rem;
  font-size: .8rem; font-weight: 750; color: var(--sea);
  font-variant-numeric: tabular-nums;
}
.ev__time--none { color: var(--ink-faint); }
.ev__body { flex: 1; min-width: 0; }
.ev__title { font-weight: 700; }
.ev__where { font-size: .85rem; color: var(--ink-dim); margin-top: .1rem; }
.ev__notes { font-size: .85rem; color: var(--ink-2); margin-top: .25rem; }
.ev__link {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .4rem; font-size: .82rem; font-weight: 700; text-decoration: none;
}

/* ---------- Place / dining cards -------------------------------------- */
.place { padding: .85rem 0; border-bottom: 1px solid var(--line-soft); }
.place:first-child { padding-top: 0; }
.place:last-child { border-bottom: 0; padding-bottom: 0; }
.place__top { display: flex; align-items: flex-start; gap: .75rem; }
.place__name { font-weight: 750; }
.place__cuisine { font-size: .84rem; color: var(--ink-dim); }
.place__notes { font-size: .85rem; color: var(--ink-2); margin-top: .35rem; }
.place__links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

/* ---------- Contacts -------------------------------------------------- */
.contact {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 0; border-bottom: 1px solid var(--line-soft);
}
.contact:last-child { border-bottom: 0; }
.contact__body { flex: 1; min-width: 0; }
.contact__name { font-weight: 700; }
.contact__meta { font-size: .84rem; color: var(--ink-dim); }

/* ---------- Checklist -------------------------------------------------- */
.check {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line-soft);
}
.check:last-of-type { border-bottom: 0; }
.check input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 1.4rem; height: 1.4rem; flex: none;
  border: 2px solid var(--line); border-radius: .45rem;
  background: var(--surface); transition: all .15s ease; cursor: pointer;
}
.check input[type=checkbox]:checked {
  background: var(--sea); border-color: var(--sea);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-6' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100%;
}
.check__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.check input:checked + .check__text { text-decoration: line-through; color: var(--ink-faint); }
.check__rm { color: var(--ink-faint); flex: none; }

/* ---------- Map ------------------------------------------------------- */
.map {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border-radius: var(--r); overflow: hidden; background: var(--surface-2);
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Prose (admin-authored notes) ------------------------------- */
.prose { color: var(--ink-2); font-size: .95rem; }
.prose > * + * { margin-top: .65rem; }
.prose h3, .prose h4, .prose h5, .prose h6 {
  color: var(--ink); font-size: .95rem; font-weight: 800; margin-top: 1rem;
}
.prose ul { list-style: disc; padding-left: 1.15rem; }
.prose ol { list-style: decimal; padding-left: 1.35rem; }
.prose li + li { margin-top: .25rem; }
.prose a { font-weight: 650; }
.prose blockquote {
  border-left: 3px solid var(--sea); padding-left: .8rem; color: var(--ink-2); font-style: italic;
}

/* ---------- Trip cards (hub) ------------------------------------------ */
.trips { display: grid; gap: .9rem; }
@media (min-width: 40rem) { .trips { grid-template-columns: 1fr 1fr; } }

.tcard {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease;
}
.tcard:active { transform: scale(.99); }
@media (hover: hover) { .tcard:hover { box-shadow: var(--shadow); } }

.tcard__media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-tint); overflow: hidden; }
.tcard__media img { width: 100%; height: 100%; object-fit: cover; }
.tcard__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,20,18,0) 40%, rgba(10,20,18,.72) 100%);
}
/* No photo (or a dead link) shouldn't read as a broken card — give it a
   soft sea-to-sand wash so it still looks deliberate. */
.tcard__ph {
  display: grid; place-items: center; height: 100%;
  color: color-mix(in srgb, var(--sea) 55%, var(--ink-faint));
  background:
    radial-gradient(120% 90% at 20% 15%, color-mix(in srgb, var(--sun) 22%, transparent) 0%, transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--sea) 22%, var(--bg-tint)) 0%, var(--bg-tint) 75%);
}
.tcard__cap { position: absolute; left: .9rem; right: .9rem; bottom: .75rem; z-index: 2; color: #fff; }
.tcard__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.tcard__dates { font-size: .82rem; opacity: .92; font-weight: 600; }
.tcard__badge { position: absolute; top: .7rem; left: .7rem; z-index: 2; }
.tcard__foot { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; font-size: .8rem; color: var(--ink-dim); }

/* Past trips read as quieter memories than the live one. */
.tcard--past .tcard__media img { filter: saturate(.85); }

/* ---------- Public scoreboard ------------------------------------------ */
.sb__h1 {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 820; letter-spacing: -.025em;
  margin-bottom: .2rem;
}
.sb__sub { color: var(--ink-dim); font-size: .92rem; margin-bottom: 1.1rem; }

.sb__grid { display: grid; gap: .9rem; }
@media (min-width: 46rem) { .sb__grid { grid-template-columns: 1fr 1fr; } }

.sb {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--pad);
  box-shadow: var(--shadow-sm);
}
.sb__head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .85rem; }
.sb__title {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.sb__meta { font-size: .8rem; color: var(--ink-dim); margin-top: .1rem; }
.sb__list { margin-bottom: .85rem; }

.sb-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .5rem;
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--line-soft);
}
.sb-row:last-child { border-bottom: 0; }
.sb-row--lead {
  background: var(--sea-soft);
  border-bottom-color: transparent;
}
.sb-row__pos {
  width: 1.4rem; flex: none; text-align: center;
  font-family: var(--font-display); font-weight: 800;
  color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.sb-row--lead .sb-row__pos { color: var(--sea); }
.sb-row__name {
  flex: 1; min-width: 0; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-row__stats { display: flex; gap: .9rem; flex: none; text-align: right; }
/* Spans in the markup, so blockify them or the columns won't line up. */
.sb-row__stat { display: block; min-width: 2.9rem; }
.sb-row__v {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums;
}

/* Column labels: one header row per card rather than on every line. */
.sb-row--head {
  padding-block: 0 .2rem;
  border-bottom: 1px solid var(--line-soft);
}
.sb-row--head .sb-row__stat {
  font-size: .6rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint);
}

/* ---------- Mini golf card on a trip page ------------------------------ */
.mg-live {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem; border-radius: var(--r);
  background: var(--sea-soft); border: 1px solid color-mix(in srgb, var(--sea) 28%, transparent);
  margin-bottom: .75rem;
}
.mg-live__body { flex: 1; min-width: 0; }
.mg-live__title { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-live__meta { font-size: .8rem; color: var(--ink-2); }

.mg-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 0; border-bottom: 1px solid var(--line-soft);
}
.mg-row:last-child { border-bottom: 0; }
.mg-row__pos {
  width: 1.5rem; flex: none; text-align: center;
  font-family: var(--font-display); font-weight: 800; color: var(--ink-faint);
}
.mg-row--win .mg-row__pos { color: var(--sea); }
.mg-row__name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-row__wins {
  font-size: .8rem; font-weight: 700; color: var(--sea);
  width: 2.4rem; text-align: right; flex: none;
  font-variant-numeric: tabular-nums;
}
.mg-row__u { font-size: .68rem; font-weight: 600; opacity: .7; margin-left: .05rem; }
.mg-row__score { font-variant-numeric: tabular-nums; font-weight: 750; width: 2.4rem; text-align: right; flex: none; }
.mg-row__par { font-size: .82rem; color: var(--ink-dim); width: 2.2rem; text-align: right; flex: none; font-variant-numeric: tabular-nums; }

.mg-game__legend {
  display: flex; gap: .5rem; justify-content: flex-end;
  font-size: .6rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint);
  padding-bottom: .25rem; border-bottom: 1px solid var(--line-soft);
}
.mg-game__legend span:nth-child(1) { width: 2.4rem; text-align: right; }
.mg-game__legend span:nth-child(2) { width: 2.4rem; text-align: right; }
.mg-game__legend span:nth-child(3) { width: 2.2rem; text-align: right; }

.mg-game + .mg-game { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.mg-game__head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .35rem; }
.mg-game__title { font-weight: 750; font-size: .95rem; }
.mg-game__date { font-size: .78rem; color: var(--ink-faint); margin-left: auto; }

/* ---------- Year divider ---------------------------------------------- */
.yeardiv {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.75rem 0 .9rem;
  font-size: .8rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.yeardiv::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* ---------- Gate ------------------------------------------------------ */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: var(--pad); }
.gate__card { width: 100%; max-width: 23rem; text-align: center; }
.gate__art { margin: 0 auto 1rem; }

/* ---------- Forms ----------------------------------------------------- */
.field { margin-bottom: .95rem; }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap);
  padding: .6rem .8rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r);
  font-size: 1rem;   /* 16px keeps iOS from zooming on focus */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--sea);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 18%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.hint { font-size: .78rem; color: var(--ink-faint); margin-top: .3rem; }

/* ---------- Toast ------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + var(--safe-bottom)); z-index: 90;
  transform: translate(-50%, 1.5rem);
  padding: .7rem 1.1rem; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: .88rem; font-weight: 650;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100vw - 2rem);
}
.toast[data-open="true"] { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sheet ------------------------------------------------------ */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(16,22,20,.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  padding-bottom: var(--safe-bottom);
  transform: translateY(101%);
  /* Closed sheets must not be hit-testable, or they swallow taps meant
     for whatever is open — they all stack at the same place on desktop. */
  visibility: hidden; pointer-events: none;
  transition: transform .28s cubic-bezier(.32,.72,0,1), visibility 0s linear .28s;
}
.sheet[data-open="true"] {
  transform: translateY(0); visibility: visible; pointer-events: auto;
  transition: transform .28s cubic-bezier(.32,.72,0,1), visibility 0s linear 0s;
}
.sheet__grip { width: 2.25rem; height: .25rem; border-radius: 999px; background: var(--line); margin: .6rem auto .2rem; flex: none; }
.sheet__head { display: flex; align-items: center; gap: .75rem; padding: .5rem var(--pad) .75rem; flex: none; }
.sheet__title { font-size: 1.1rem; font-weight: 800; margin-right: auto; }
.sheet__body { padding: 0 var(--pad) 1.25rem; overflow-y: auto; }

@media (min-width: 40rem) {
  .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto;
    width: min(30rem, 92vw); border-radius: var(--r-xl);
    transform: translate(-50%, -46%) scale(.97); opacity: 0;
    transition: transform .24s cubic-bezier(.32,.72,0,1), opacity .2s ease, visibility 0s linear .24s;
  }
  .sheet[data-open="true"] {
    transform: translate(-50%, -50%) scale(1); opacity: 1;
    transition: transform .24s cubic-bezier(.32,.72,0,1), opacity .2s ease, visibility 0s linear 0s;
  }
}

.qr { display: grid; place-items: center; padding: .9rem; background: #fff; border-radius: var(--r); width: fit-content; margin: 0 auto 1rem; }
.qr svg { display: block; }

/* ---------- Empty state ------------------------------------------------ */
.empty { text-align: center; padding: 3rem 1rem; }
.empty__art { margin: 0 auto 1rem; opacity: .8; }
.empty__title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; margin-bottom: .35rem; }
.empty__sub { color: var(--ink-dim); margin-bottom: 1.25rem; }

/* ---------- Footer ----------------------------------------------------- */
.foot {
  margin-top: 2.5rem; padding: 1.5rem 0 calc(2rem + var(--safe-bottom));
  border-top: 1px solid var(--line-soft);
  color: var(--ink-faint); font-size: .8rem; text-align: center;
}
.foot a { color: var(--ink-dim); }

/* ---------- Notices ---------------------------------------------------- */
.notice {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: var(--r);
  background: var(--sun-soft); border: 1px solid color-mix(in srgb, var(--sun) 35%, transparent);
  font-size: .88rem; color: var(--ink-2);
}
.notice svg { flex: none; color: var(--sun); margin-top: .1rem; }
.notice--good { background: var(--sea-soft); border-color: color-mix(in srgb, var(--sea) 30%, transparent); }
.notice--good svg { color: var(--sea); }
.notice--bad { background: var(--coral-soft); border-color: color-mix(in srgb, var(--coral) 35%, transparent); }
.notice--bad svg { color: var(--coral); }
.notice a { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
