/* It's Giving Friends — palette and type from the IGF Brand Book */
:root {
  --currant: #69100E;
  --clay: #944B33;
  --herb: #325232;
  --almond: #B79A88;
  --cocoa: #3B2720;
  --linen: #F5EFE6;
  --linen-dim: rgba(245, 239, 230, 0.72);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Public Sans', system-ui, sans-serif;
  --measure: 68ch;
  --gutter: clamp(16px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.gated body { visibility: hidden; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--linen);
  color: var(--cocoa);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- Type ---------- */
.display, h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.005em; }
h1, .display { font-size: clamp(64px, 12vw, 104px); line-height: 0.95; }
h2 { font-size: clamp(36px, 6vw, 52px); line-height: 1.15; }
h3 { font-size: clamp(26px, 3.4vw, 32px); line-height: 1.2; }
.aside { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 3.4vw, 30px); line-height: 1.3; }
.eyebrow {
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 500;
  color: var(--clay);
}
.eyebrow .num { margin-right: 1.4em; }
.caption { font-size: 15px; line-height: 1.5; }
.lede { max-width: var(--measure); font-size: 20px; }
p + p { margin-top: 1em; }

/* ---------- Layout ---------- */
.section { padding: clamp(72px, 12vw, 140px) var(--gutter); }
.wrap { max-width: 1080px; margin: 0 auto; }
.rule { border: 0; border-top: 1px solid var(--almond); }
.section-head { display: flex; align-items: center; gap: 0; padding-bottom: 18px; border-bottom: 1px solid var(--almond); margin-bottom: clamp(32px, 6vw, 56px); }

.ground-currant { background: var(--currant); color: var(--linen); }
.ground-herb { background: var(--herb); color: var(--linen); }
.ground-cocoa { background: var(--cocoa); color: var(--linen); }
.ground-currant .eyebrow, .ground-herb .eyebrow, .ground-cocoa .eyebrow { color: var(--almond); }
.ground-currant .section-head, .ground-herb .section-head, .ground-cocoa .section-head { border-color: rgba(183, 154, 136, 0.45); }
.muted { color: var(--almond); }
.ground-currant .muted { color: var(--linen-dim); }

/* ---------- Buttons: linen fill on currant, square corners, uppercase ---------- */
.btn {
  display: inline-block; border: 0; border-radius: 0; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase;
  padding: 20px 34px; text-decoration: none; text-align: center; line-height: 1.4;
  background: var(--linen); color: var(--currant);
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--almond); color: var(--cocoa); }
.btn:focus-visible, .link:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.btn-currant { background: var(--currant); color: var(--linen); }
.btn-currant:hover { background: var(--cocoa); color: var(--linen); }
.btn-quiet { background: transparent; color: var(--cocoa); box-shadow: inset 0 0 0 1px var(--almond); padding: 12px 18px; font-size: 11px; }
.btn-quiet:hover { background: var(--cocoa); color: var(--linen); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { color: var(--clay); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.ground-currant .link, .ground-herb .link, .ground-cocoa .link { color: var(--linen); }

/* ---------- Header / nav ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px var(--gutter);
}
.site-header .mark-sm { width: 44px; height: 44px; }
.site-header nav { display: flex; gap: clamp(14px, 3vw, 28px); flex-wrap: wrap; justify-content: flex-end; }
.site-header nav a { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; text-decoration: none; opacity: .85; }
.site-header nav a:hover, .site-header nav a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.header-currant { background: var(--currant); color: var(--linen); }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; }
.hero-body {
  flex: 1; display: grid; align-content: center; gap: 28px;
  padding: 40px var(--gutter) clamp(64px, 10vw, 110px);
  max-width: 1080px; width: 100%; margin: 0 auto;
}
.hero .mark { width: clamp(120px, 20vw, 168px); margin-bottom: 8px; }
.hero .aside { color: var(--almond); }
.hero-facts { font-size: 18px; line-height: 1.55; }
.hero-facts .muted { display: block; }

/* ---------- About ---------- */
.pillars { display: flex; flex-wrap: wrap; gap: 10px 36px; margin-top: 40px; }
.pillars span { font-family: var(--serif); font-size: 28px; color: var(--clay); }

/* ---------- The room ---------- */
.room-intro { padding-bottom: clamp(40px, 6vw, 64px); }
.room-photos { display: grid; gap: 6px; }
.room-photos img { width: 100%; height: clamp(260px, 56vw, 720px); object-fit: cover; }

/* ---------- Menu ---------- */
.menu-grid { display: grid; gap: clamp(40px, 6vw, 72px); grid-template-columns: 1fr; }
@media (min-width: 860px) { .menu-grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.courses { list-style: none; }
.courses li { padding: 22px 0; border-bottom: 1px solid rgba(183, 154, 136, 0.45); }
.courses li:first-child { padding-top: 0; }
.courses h3 { font-size: clamp(30px, 4.4vw, 40px); }
.courses p { font-size: 16px; color: var(--linen-dim); margin-top: 2px; }
.credits { margin-top: 32px; display: grid; gap: 10px; }
.chef { display: grid; gap: 16px; }
.chef img { width: 100%; max-width: 360px; aspect-ratio: 4 / 5; object-fit: cover; }
.chef .caption { color: var(--linen-dim); }

/* ---------- Tickets ---------- */
.tickets-grid { display: grid; gap: 40px; }
@media (min-width: 860px) { .tickets-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.price { font-family: var(--serif); font-size: clamp(72px, 12vw, 104px); line-height: .95; }
.includes { list-style: none; margin-top: 8px; }
.includes li { padding: 14px 0; border-bottom: 1px solid rgba(183, 154, 136, 0.45); }
.luma-url { margin-top: 18px; font-size: 15px; letter-spacing: .04em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--cocoa); color: var(--linen); padding: 56px var(--gutter); }
.site-footer .wrap { display: grid; gap: 28px; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: repeat(4, 1fr); } }
.site-footer .eyebrow { color: var(--almond); margin-bottom: 8px; display: block; }
.site-footer p, .site-footer a { font-size: 15px; line-height: 1.6; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 22px; max-width: 640px; }
.form fieldset { border: 0; display: grid; gap: 18px; }
.form legend { font-family: var(--serif); font-size: 28px; margin-bottom: 6px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 500; color: var(--clay); }
.field .hint { font-size: 14px; color: var(--clay); opacity: .8; }
input, select, textarea {
  font: inherit; font-size: 18px; color: var(--cocoa); background: #fff;
  border: 1px solid var(--almond); border-radius: 0; padding: 14px 16px; width: 100%;
}
input:focus, select:focus { border-color: var(--clay); }
.row-2 { display: grid; gap: 18px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.notice { padding: 18px 20px; border-left: 3px solid var(--clay); background: rgba(183, 154, 136, 0.18); font-size: 16px; }
.notice.ok { border-color: var(--herb); background: rgba(50, 82, 50, 0.1); }
.notice.err { border-color: var(--currant); background: rgba(105, 16, 14, 0.08); }
.hidden { display: none !important; }

/* ---------- Roster ---------- */
.roster { list-style: none; counter-reset: team; display: grid; grid-template-columns: 1fr; column-gap: 40px; }
@media (min-width: 760px) { .roster { grid-template-columns: 1fr 1fr; } }
.roster li { counter-increment: team; display: grid; grid-template-columns: 2.4em 1fr; padding: 14px 0; border-bottom: 1px solid var(--almond); }
.roster li::before { content: counter(team, decimal-leading-zero); color: var(--clay); font-size: 13px; padding-top: 6px; }
.roster .tn { font-family: var(--serif); font-size: 24px; line-height: 1.2; }
.roster .pl { font-size: 15px; color: var(--clay); }
.tag { display: inline-block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; padding: 2px 8px; margin-left: 8px; vertical-align: middle; border: 1px solid currentColor; }

/* ---------- Bracket (mirrored tree, final in the middle) ---------- */
.bracket-scroll { overflow-x: auto; padding: 8px 0 24px; margin: 0 calc(var(--gutter) * -1); scrollbar-width: thin; scrollbar-color: rgba(183, 154, 136, .5) transparent; }
.bk {
  --gap: 30px; --slot: 98px; --line: rgba(183, 154, 136, .5); --col: 172px;
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--col); column-gap: var(--gap);
  min-width: max-content; margin: 0 auto; width: max-content; padding: 0 var(--gutter); box-sizing: content-box;
}
.bk-label { font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--almond); text-align: center; margin-bottom: 18px; }
.bk-body { height: calc(var(--rows) * var(--slot)); min-height: 400px; display: flex; flex-direction: column; }
.bk-pair { flex: 1; display: flex; flex-direction: column; justify-content: space-around; position: relative; }
.bk-pair.solo { justify-content: center; }
.bk-m { position: relative; background: rgba(245, 239, 230, .05); border: 1px solid var(--line); transition: border-color .3s, background .3s; }
.bk-m.live { border-color: var(--linen); box-shadow: 0 0 0 3px rgba(245, 239, 230, .08); }
.bk-meta { font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--almond); padding: 4px 10px; border-top: 1px solid var(--line); }
.bk-m.live .bk-meta { color: var(--linen); }

/* connectors */
.bk-m::after, .bk-col:not(.first) .bk-m::before { content: ''; position: absolute; top: 50%; width: calc(var(--gap) / 2); border-top: 1px solid var(--line); }
.bk-col.l .bk-m::after { left: 100%; }
.bk-col.l:not(.first) .bk-m::before { right: 100%; }
.bk-col.r .bk-m::after { right: 100%; }
.bk-col.r:not(.first) .bk-m::before { left: 100%; }
.bk-col.f .bk-m::after { left: 100%; }
.bk-col.f .bk-m::before { right: 100%; content: ''; position: absolute; top: 50%; width: calc(var(--gap) / 2); border-top: 1px solid var(--line); }
.bk-col.f.first .bk-m::before, .bk-col.f.first .bk-m::after { display: none; }
.bk-col.l .bk-pair:not(.solo)::after, .bk-col.r .bk-pair:not(.solo)::after { content: ''; position: absolute; top: 25%; bottom: 25%; border-left: 1px solid var(--line); }
.bk-col.l .bk-pair::after { left: calc(100% + var(--gap) / 2); }
.bk-col.r .bk-pair::after { right: calc(100% + var(--gap) / 2); }

/* team rows */
.bk-t {
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 6px; width: 100%;
  padding: 8px 10px; min-height: 38px; background: none; border: 0; color: inherit; font: inherit; font-size: 14px; text-align: left;
  cursor: pointer; transition: background .25s, color .25s, opacity .3s;
}
.bk-t + .bk-t { border-top: 1px solid var(--line); }
.bk-t .sd { font-size: 10px; color: var(--almond); font-variant-numeric: tabular-nums; }
.bk-t .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-t .sc { font-variant-numeric: tabular-nums; font-size: 13px; }
.bk-t.win { font-weight: 500; }
.bk-t.win .sc { color: var(--linen); }
.bk-t.lose { opacity: .45; }
.bk-t.tbd, .bk-t.bye { cursor: default; }
.bk-t.tbd .nm::before { content: ''; display: block; height: 1px; width: 40%; background: var(--line); }
.bk-t.bye .nm { color: var(--almond); font-style: italic; font-family: var(--serif); font-size: 16px; }
.bk-t.open { color: var(--almond); }
.bk-t.open .nm { font-family: var(--serif); font-style: italic; font-size: 17px; }
.bk-t.open .sc { font-size: 16px; opacity: 0; transition: opacity .2s; }
.bk-t.open:hover, .bk-t.open:focus-visible { background: rgba(245, 239, 230, .1); color: var(--linen); }
.bk-t.open:hover .sc, .bk-t.open:focus-visible .sc { opacity: 1; }
.bk-t[data-id]:hover { background: rgba(245, 239, 230, .08); }
.bk.has-focus .bk-t[data-id]:not(.hl), .bk.has-focus .bk-t.open, .bk.has-focus .bk-t.bye { opacity: .25; }
.bk-t.hl { background: var(--linen); color: var(--currant); opacity: 1; }
.bk-t.hl .sd, .bk-t.hl .sc { color: var(--currant); }
.bk-t.fresh { animation: fresh 2.4s ease-out 2; }
@keyframes fresh { 0% { background: rgba(245, 239, 230, .55); color: var(--currant); } 100% { background: transparent; } }

/* champion slot above the final */
.bk-champ { position: absolute; left: -20px; right: -20px; bottom: calc(50% + 64px); display: grid; justify-items: center; gap: 6px; text-align: center; }
.bk-champ img { width: 64px; opacity: .55; transition: opacity .6s, transform .6s; }
.bk-champ .eyebrow { color: var(--almond); }
.bk-champ .who { font-family: var(--serif); font-size: 30px; line-height: 1.05; color: var(--almond); }
.bk-champ.crowned img { opacity: 1; transform: scale(1.1); }
.bk-champ.crowned .who { color: var(--linen); font-size: 34px; }
.bk-col.f .bk-m { border-color: var(--almond); }

/* team card under the bracket */
.bk-card { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; min-height: 56px; padding: 16px 0 0; border-top: 1px solid rgba(183, 154, 136, .35); margin-top: 8px; }
.bk-card .t { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.bk-card .p { color: rgba(245, 239, 230, .75); font-size: 16px; }
.bk-card .s { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--almond); }
.bk-card.empty .p { font-size: 14px; color: var(--almond); }

@media (prefers-reduced-motion: reduce) { .bk-t.fresh { animation: none; } }

/* ---------- Admin ---------- */
.admin-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.stats { display: flex; flex-wrap: wrap; gap: 36px; margin: 24px 0 8px; }
.stats div { display: grid; }
.stats b { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; }
.stats span { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--clay); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 760px; }
table.data th { text-align: left; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; font-weight: 500; color: var(--clay); padding: 10px 8px; border-bottom: 1px solid var(--almond); }
table.data td { padding: 10px 8px; border-bottom: 1px solid rgba(183, 154, 136, 0.5); vertical-align: middle; }
table.data td.tn { font-family: var(--serif); font-size: 20px; }
table.data input, table.data select { font-size: 15px; padding: 6px 8px; }
table.data input.seed { width: 64px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar label { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.toolbar input[type=number] { width: 90px; padding: 8px 10px; font-size: 15px; }
.toolbar input[type=checkbox] { width: 18px; height: 18px; }
.score-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.score-card { border: 1px solid var(--almond); background: #fff; padding: 16px; display: grid; gap: 10px; }
.score-card .hd { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--clay); }
.score-card .ln { display: grid; grid-template-columns: 1fr 84px; gap: 10px; align-items: center; }
.score-card .ln span { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.score-card input { padding: 8px 10px; font-size: 16px; }
.score-card .act { display: flex; gap: 8px; flex-wrap: wrap; }
.score-card.final { background: rgba(50, 82, 50, 0.07); }
.score-card .w { color: var(--herb); font-weight: 500; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--cocoa); color: var(--linen); padding: 12px 20px; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); }

/* Admin moderation */
.mod-photos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mod-photo { display: grid; gap: 6px; }
.mod-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--almond); }
