:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17251d;
  background: #f5f7f3;
}

* { box-sizing: border-box; }

body { margin: 0; background: #f5f7f3; }

a { color: #075c44; text-underline-offset: .18em; }
a:hover { color: #034634; }

main:not(.public-page) {
  max-width: 48rem;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(100% - 2rem, 76rem); margin-inline: auto; }
.site-header { color: #fff; background: #093b2d; border-bottom: 4px solid #e3ba50; }
.header-inner { min-height: 4.75rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.brand { color: #fff; font-weight: 800; font-size: 1.2rem; letter-spacing: -.04em; text-decoration: none; }
.brand:hover { color: #fff; }
.brand span { color: #e3ba50; }
.tournament-state { margin: 0; font-size: .875rem; color: #d4e3dc; }
.header-actions { display: flex; gap: .8rem; align-items: center; margin: 0; color: #d4e3dc; font-size: .875rem; }
.header-team { color: #fff; font-weight: 700; text-decoration: none; }
.header-team:hover { color: #fff; text-decoration: underline; }
.button-link { display: inline-block; padding: .4rem .65rem; color: #fff; background: transparent; border: 1px solid rgb(255 255 255 / .4); border-radius: .35rem; text-decoration: none; }
.button-link:hover { color: #fff; background: rgb(255 255 255 / .1); border-color: #fff; }

.public-page { padding-block: 1.25rem 4rem; }
.public-nav { display: flex; gap: .25rem .75rem; overflow-x: auto; padding: .25rem 0 1rem; border-bottom: 1px solid #d7ded8; }
.public-nav a { white-space: nowrap; padding: .45rem .25rem; color: #365247; font-weight: 650; text-decoration: none; border-bottom: 3px solid transparent; }
.public-nav a[aria-current="page"] { color: #093b2d; border-color: #d29a22; }

.hero { padding: 3.75rem 0 2.75rem; max-width: 48rem; }
.landing-hero { padding-top: 5.5rem; }
.hero h1 { margin: .2rem 0 .7rem; color: #092c21; font-size: clamp(2.3rem, 7vw, 4.5rem); line-height: .98; letter-spacing: -.065em; }
.hero p:not(.eyebrow) { margin: 0; color: #52665d; font-size: 1.1rem; line-height: 1.55; }
.hero p.hero-actions { display: flex; gap: .75rem; margin-top: 1.4rem; }
.eyebrow { margin: 0 0 .3rem; color: #087256; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.content-section { padding: 2.25rem 0; border-top: 1px solid #d7ded8; }
.section-heading { display: flex; gap: 1rem; align-items: end; justify-content: space-between; margin-bottom: 1.1rem; }
.section-heading h2 { margin: 0; color: #092c21; font-size: clamp(1.5rem, 4vw, 2.15rem); letter-spacing: -.04em; }
.section-heading > a { padding-bottom: .25rem; font-weight: 700; white-space: nowrap; }

.match-list { display: grid; gap: .75rem; }
.match-card, .team-card, .standing-card, .bracket-match { background: #fff; border: 1px solid #dae2dc; border-radius: .7rem; box-shadow: 0 .1rem .25rem rgb(9 44 33 / .04); }
.match-card { padding: 1rem 1.1rem; }
.match-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; color: #63736b; font-size: .82rem; font-weight: 650; }
.match-meta span:first-child { color: #087256; }
.match-teams { display: flex; gap: .55rem; align-items: baseline; margin-top: .6rem; font-size: 1.06rem; }
.game-results { display: flex; flex-wrap: wrap; gap: .35rem .7rem; margin-top: .7rem; color: #45594f; font-size: .9rem; }
.game-results span { padding: .2rem .45rem; background: #f1f5f1; border-radius: .25rem; }
.winner, .series-note { margin: .7rem 0 0; font-size: .9rem; color: #315346; }
.winner { color: #075c44; font-weight: 750; }
.empty-state { margin: 0; padding: 1.2rem; color: #53675d; background: #edf2ed; border-left: 4px solid #a4b7aa; }
.notice { margin: 0 0 1rem; padding: .9rem 1rem; border-left: 4px solid; border-radius: 0 .35rem .35rem 0; }
.notice-error { color: #772a25; background: #fbe9e7; border-color: #b33b32; }
.notice-success { color: #155c3c; background: #e4f4ea; border-color: #2b8b5c; }

.team-grid, .tournament-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.standings-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.standing-card { overflow: hidden; }
.standing-card h3 { margin: 0; padding: 1rem 1rem .3rem; color: #123b2d; }
.tie-notice { margin: .35rem 1rem .75rem; color: #775417; font-size: .88rem; line-height: 1.4; }
.group-footnotes { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .3rem 1rem 1rem; color: #8a938e; font-size: .78rem; line-height: 1.4; }
.qualify-note, .group-ranking-rules { margin: 0; color: inherit; }
.group-ranking-rules { text-align: right; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: .6rem .55rem; text-align: right; border-top: 1px solid #e1e7e2; white-space: nowrap; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
thead th { color: #5c6d64; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:nth-child(even) { background: #f8faf8; }

.team-card { display: block; padding: 1.1rem; color: inherit; text-decoration: none; }
.team-card:hover { color: inherit; border-color: #087256; }
.team-card h3 { margin: 0; color: #123b2d; font-size: 1.15rem; }
.team-card p { margin: .55rem 0 0; line-height: 1.45; }
.team-card .department { color: #66776e; font-size: .9rem; }
.profile-results-heading { margin-top: 2rem; }
.back-link { margin: .25rem 0 0; }

.tournament-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.tournament-card { display: grid; gap: .45rem; min-height: 9rem; padding: 1.2rem; color: #fff; background: #096147; border-radius: .7rem; text-decoration: none; box-shadow: 0 .3rem .75rem rgb(9 59 45 / .16); }
.tournament-card:hover { color: #fff; background: #074d3a; }
.tournament-card span { color: #d7ecd9; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.tournament-card strong { align-self: center; font-size: 1.35rem; letter-spacing: -.03em; }
.tournament-card small { color: #d7ecd9; }

.bracket { display: flex; gap: 1rem; overflow-x: auto; padding: .25rem .1rem 1rem; }
.bracket-round { flex: 0 0 min(17rem, 80vw); display: flex; flex-direction: column; gap: .75rem; justify-content: space-around; }
.bracket-round h3 { margin: 0 0 .15rem; color: #315346; font-size: .9rem; text-align: center; }
.bracket-match { padding: .75rem; }
.bracket-team { display: flex; justify-content: space-between; gap: .5rem; margin: 0; padding: .35rem .15rem; border-bottom: 1px solid #e4e9e5; }
.bracket-team:last-of-type { border-bottom: 0; }
.bracket-team.awaiting { color: #77877e; font-style: italic; }
.advance, .match-time { margin: .65rem .15rem 0; color: #52675d; font-size: .78rem; }
.advance { color: #075c44; font-weight: 750; }
.bracket-games { display: flex; flex-wrap: wrap; gap: .3rem .5rem; margin-top: .55rem; color: #52675d; font-size: .75rem; }

.team-hero { padding-bottom: 2.25rem; }
.team-hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
.tournament-section:first-of-type { border-top: 0; }
.team-standing { margin-bottom: 2rem; overflow: hidden; background: #fff; border: 1px solid #dae2dc; border-radius: .7rem; }
.team-standing h3 { margin: 0; padding: 1rem 1rem .4rem; color: #123b2d; }
.subsection-heading { margin: 0 0 .9rem; }
.subsection-heading h3 { margin: 0; color: #123b2d; font-size: 1.35rem; letter-spacing: -.025em; }
.team-match-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: 1rem; align-items: start; }
.team-match-card { padding: 1.15rem; }
.status-badge { padding: .08rem .4rem; border-radius: 999px; }
.status-scheduled { color: #76530f; background: #f8edcd; }
.status-completed { color: #155c3c; background: #e4f4ea; }
.match-actions { display: grid; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e1e7e2; }
.match-form { display: grid; gap: .65rem; padding: .85rem; background: #f5f8f5; border-radius: .45rem; }
.match-form label { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; color: #40564b; font-size: .85rem; }
.match-form input { width: 5rem; padding: .48rem .55rem; color: #17251d; background: #fff; border: 1px solid #b9c8be; border-radius: .3rem; }
.match-form input[type="datetime-local"] { width: min(100%, 13.5rem); }
.form-title { color: #123b2d; font-size: .92rem; }
.primary-button, .secondary-button { justify-self: start; padding: .55rem .8rem; font-weight: 700; text-decoration: none; border: 1px solid; border-radius: .35rem; }
.primary-button { color: #fff; background: #087256; border-color: #087256; }
.primary-button:hover { background: #075c44; border-color: #075c44; }
.secondary-button { color: #075c44; background: #fff; border-color: #8ba79a; }
.secondary-button:hover { background: #edf3ef; border-color: #628575; }

.login-page { display: grid; place-items: center; min-height: calc(100vh - 8rem); }
.login-card { width: min(100%, 27rem); padding: 2rem; background: #fff; border: 1px solid #dce5df; border-radius: 1rem; box-shadow: 0 1.25rem 3rem rgb(9 44 33 / .12); }
.login-brand { display: inline-block; margin-bottom: 2rem; color: #093b2d; font-weight: 800; font-size: 1.15rem; letter-spacing: -.04em; text-decoration: none; }
.login-brand span { color: #c9901c; }
.login-card h1 { margin: .15rem 0 .65rem; color: #092c21; font-size: clamp(2rem, 8vw, 3rem); line-height: 1; letter-spacing: -.055em; }
.login-intro { margin: 0 0 1.4rem; color: #52665d; line-height: 1.5; }
.login-form { display: grid; gap: 1rem; }
.login-form label { display: grid; gap: .4rem; color: #334f43; font-size: .9rem; font-weight: 700; }
.login-form input { width: 100%; padding: .75rem .85rem; color: #17251d; background: #f9fbf9; border: 1px solid #b9c8be; border-radius: .5rem; }
.login-form input:focus { outline: 3px solid rgb(8 114 86 / .18); border-color: #087256; background: #fff; }
.login-form button { margin-top: .25rem; justify-self: stretch; padding-block: .75rem; }
.confirmation-card { padding: 1.1rem; background: #fff; border: 1px solid #e1cf9d; border-radius: .7rem; }
.confirmation-card > p { margin-top: 0; }
.confirmation-card ul { display: grid; gap: .5rem; padding-left: 1.25rem; }
.confirmation-card li span { display: block; color: #63736b; font-size: .85rem; }

@media (max-width: 38rem) {
  .header-inner { min-height: 4.25rem; }
  .tournament-state { display: none; }
  .hero { padding: 2.8rem 0 2rem; }
  .section-heading { align-items: start; }
  .section-heading > a { font-size: .86rem; }
  .match-teams { font-size: 1rem; }
  .header-actions > span { display: none; }
  .team-match-list { grid-template-columns: 1fr; }
  .match-form label { grid-template-columns: 1fr; gap: .3rem; }
  .match-form input, .match-form input[type="datetime-local"] { width: 100%; }
}
