@font-face {
    font-family: "DM Sans";
    src: url("/assets/fonts/dm-sans.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("/assets/fonts/barlow-700.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("/assets/fonts/barlow-800.woff2") format("woff2");
    font-style: normal;
    font-weight: 800;
    font-display: swap;
}
@font-face {
    font-family: "Barlow Condensed";
    src: url("/assets/fonts/barlow-900-italic.woff2") format("woff2");
    font-style: italic;
    font-weight: 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --paper: #f4eee4;
    --surface: #fbf6ee;
    --ink: #211612;
    --muted: #5e493e;
    --line: #c6b6a6;
    --edge: #786357;
    --brand: #ff6600;
    --brand-hover: #ff8538;
    --brand-text: #8b300d;
    --stadium: #211715;
    --chalk: #fff1df;
    --live-light: #ff9c63;
    --post-it: #ffda8f;
    --post-it-light: #eadfce;
    --focus: #8b300d;
    --error: #8b251d;
    --error-bg: #f9e1d9;
    --success: #20543d;
    --success-bg: #e1eee2;
    --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
    --sans: "DM Sans", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --page-max: 76rem;
    --gutter: clamp(1rem, 4vw, 3rem);
    --section-gap: clamp(1.2rem, 4vw, 2.75rem);
    --radius: 0;
    --thumb: #856955;
    --thumb-hover: #654c3e;
    background: var(--paper);
    color: var(--ink);
    font: 400 100%/1.5 var(--sans);
    scrollbar-gutter: stable;
}

* { box-sizing: border-box; scrollbar-color: var(--thumb) var(--paper); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--thumb); border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:is(:hover,:active) { background: var(--thumb-hover); }
@media (forced-colors: active) { * { scrollbar-color: auto; } }

body { min-height: 100vh; margin: 0; }
[hidden] { display: none !important; }
:is(h1,h2,h3,p,figure) { margin: 0; }
:is(h1,h2,h3) { overflow-wrap: anywhere; line-height: .98; }
:is(button,input,textarea) { font: inherit; }
:is(a,button,summary,input,textarea) { scroll-margin-block-start: 4.5rem; }
:is(a,button,summary,input,textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: var(--brand-text); text-underline-offset: .23em; }
a:hover { text-decoration-thickness: 2px; }
:is(button,summary) { cursor: pointer; }
button:disabled { cursor: default; }
button[aria-busy="true"] { cursor: wait; }

.wrap { width: min(calc(100% - var(--gutter) * 2), var(--page-max)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; min-height: 44px; padding-block: .48rem; }
.brand-logo { display: block; width: clamp(7.2rem, 10vw, 9.5rem); max-width: 100%; height: auto; }
.header-link, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.header-link { color: var(--ink); font: 700 .8rem/1.2 var(--mono); letter-spacing: .035em; text-transform: uppercase; }
.skip-link { position: absolute; inset: .5rem auto auto .5rem; transform: translateY(-200%); padding: .6rem; background: var(--surface); z-index: 5; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 1rem; margin-block: 3rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; }
.site-footer a { color: inherit; }

.eyebrow, .phase, .match-time, .stamp {
    font: 600 .78rem/1.42 var(--mono);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.phase { display: inline-flex; align-items: center; gap: .58rem; }
.phase::before { content: ""; width: .48rem; height: .48rem; flex: none; background: currentColor; }
.stadium {
    --focus: var(--live-light);
    position: relative;
    isolation: isolate;
    display: grid;
    align-content: center;
    min-height: clamp(17rem, 34vw, 26rem);
    padding: clamp(1.25rem, 4.6vw, 3.5rem);
    overflow: hidden;
    border-bottom: .45rem solid var(--brand);
    background: var(--stadium);
    color: var(--chalk);
}
.stadium-image {
    position: absolute;
    inset: 0 0 0 26%;
    z-index: -2;
    width: 74%;
    height: 100%;
    object-fit: cover;
    object-position: 58% center;
    clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
}
.stadium::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, var(--stadium) 10%, #211715e8 28%, #21171590 52%, #21171510 82%);
}
.match-hero .phase { color: var(--live-light); }
.match-hero[data-match-phase="upcoming"] .phase { color: var(--chalk); }
.match-hero[data-match-phase="upcoming"] .stadium-image { filter: saturate(.72); }
.match-hero:is([data-match-phase="final"],[data-match-phase="archived"]) .stadium-image { filter: saturate(.38) brightness(.75); }
.match-hero[data-match-phase="archived"] { border-color: var(--edge); }
.match-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .4rem clamp(.7rem, 3.5vw, 2rem);
    width: max-content;
    max-width: 100%;
    margin-block: .8rem 1.1rem;
}
.team-names { display: grid; gap: .14em; min-width: 0; }
.team-name {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(.55rem, 1.5vw, 1rem);
    min-width: 0;
}
.team-word {
    display: block;
    padding-inline-end: .035em;
    font: italic 900 clamp(2.65rem, 9.3vw, 8.75rem)/.77 var(--display);
    letter-spacing: -.018em;
    text-transform: uppercase;
    text-wrap: balance;
}
.team-word.is-long { font-size: clamp(2rem, 6vw, 5.7rem); line-height: .86; }
.score {
    display: grid;
    gap: .22rem;
    align-self: end;
    min-width: 2.5ch;
    padding: .45em .29em .38em;
    border-top: 3px solid var(--brand);
    background: var(--stadium);
    color: var(--chalk);
    font: 800 clamp(2rem, 6vw, 5.5rem)/.82 var(--display);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
}
.score small { font: 600 .63rem/1.1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.team-mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--mark-size, clamp(2.25rem, 5vw, 4rem));
    height: var(--mark-size, clamp(2.25rem, 5vw, 4rem));
    padding: .17em;
    background: var(--chalk);
    color: var(--ink);
    border: 1px solid var(--line);
    font: 800 clamp(.75rem, 1.8vw, 1.15rem)/1 var(--display);
    letter-spacing: .06em;
}
.team-mark > * { grid-area: 1 / 1; }
.team-mark--dark { background: var(--stadium); color: var(--chalk); }
.team-mark img { display: block; max-width: 83%; max-height: 83%; width: auto; height: auto; object-fit: contain; }
.team-mark:has(img:not([hidden])) .team-abbr { visibility: hidden; }
.crest-pair { --mark-size: 2.45rem; display: inline-flex; flex: none; gap: .3rem; }

.home-hero { margin-top: var(--section-gap); gap: .55rem; }
.home-hero h1 {
    max-width: 8em;
    font: italic 900 clamp(3.15rem, 9vw, 8.2rem)/.76 var(--display);
    letter-spacing: -.015em;
    text-transform: uppercase;
}
.home-hero .eyebrow { color: var(--live-light); }
.home-hero .intro { max-width: 27ch; margin-top: .5rem; font-weight: 600; }
.home-match {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem clamp(.85rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-top: 0;
    background: var(--surface);
}
.home-match h2 { margin: .18rem 0; font: 800 clamp(1.75rem, 5vw, 3.35rem)/.9 var(--display); text-transform: uppercase; }
.match-card-body, .fixture-name { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.match-card-body > div { min-width: 0; }
.home-match .eyebrow, .home-match .stamp { color: var(--muted); }

[data-board] { margin-top: var(--section-gap); }
.halftime {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem 1.5rem;
    padding: clamp(.95rem, 3vw, 1.6rem) clamp(1rem, 4vw, 2.75rem);
    background: var(--brand);
    color: var(--ink);
}
.halftime h2 { max-width: 22em; margin-top: .13em; font: 800 clamp(1.85rem, 4.6vw, 3.75rem)/.88 var(--display); }
.halftime--closed { background: var(--post-it-light); border-block-end: 1px solid var(--line); }
.halftime .button { flex: none; }
.halftime .button::before { content: "+"; margin-right: .48em; font: 500 1.35rem/1 var(--mono); }
.board-grid { display: grid; gap: var(--section-gap); margin-block-start: var(--section-gap); align-items: start; }
.panel {
    padding: clamp(1rem, 3vw, 1.65rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow-wrap: anywhere;
}
.panel h2, .feed-section h2 { margin-bottom: .65rem; font: 800 clamp(1.8rem, 4vw, 2.5rem)/.9 var(--display); text-transform: uppercase; }
.panel p + p { margin-top: .4rem; }
.composer-panel { border-top: 4px solid var(--brand); }
.composer-panel summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    color: var(--ink);
    font: 800 clamp(1.5rem, 3vw, 2rem)/.9 var(--display);
    text-transform: uppercase;
    list-style: none;
}
.composer-panel summary:hover { color: var(--brand-text); }
.composer-panel summary::-webkit-details-marker { display: none; }
.composer-plus { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border: 1px solid currentColor; font: 700 1.3rem/.8 var(--mono); }
.composer-panel[open] .composer-plus { transform: rotate(45deg); }
.answer-context, .published-question, .closed-notice { padding: .7rem .85rem; background: var(--post-it-light); border-left: 3px solid var(--brand); }
.published-question { margin-top: .8rem; }
.closed-notice { color: var(--muted); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: fit-content;
    max-width: 100%;
    padding: .5rem .85rem;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-weight: 750;
    text-decoration: none;
    text-align: center;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.button:hover:not(:disabled) { background: var(--post-it-light); border-color: var(--ink); }
.button:active:not(:disabled) { box-shadow: inset 0 2px 0 #21161242; }
.button.primary { background: var(--brand); border-color: var(--brand-text); }
.button.primary:hover:not(:disabled) { background: var(--brand-hover); }
.button.ink { background: var(--stadium); color: var(--chalk); border-color: var(--stadium); }
.button.ink:hover:not(:disabled) { background: #482b24; border-color: #482b24; }
.button.danger { color: var(--error); border-color: var(--error); }
.button.danger:hover:not(:disabled) { background: var(--error-bg); border-color: var(--error); }
.button:disabled { opacity: .68; }
.quiet-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand-text);
    text-decoration: underline;
    text-underline-offset: .23em;
    text-align: left;
}
.quiet-link:hover:not(:disabled) { text-decoration-thickness: 2px; }
.quiet-link:disabled { color: var(--muted); text-decoration: none; }
.update-button { position: sticky; top: .65rem; z-index: 1; margin-top: .8rem; box-shadow: 3px 3px 0 var(--stadium); }
.halftime:not(.halftime--closed) { --focus: var(--stadium); }

form:not([data-report]):not(.moderation-actions):not(.inline-form) { display: grid; justify-items: stretch; gap: .42rem; }
.panel form { margin-top: .75rem; }
label { font-weight: 750; }
input, textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: .58rem .68rem;
    background: var(--surface);
    color: var(--ink);
    font-size: 1rem;
}
textarea { min-height: 5.2rem; resize: none; }
#messaggio { min-height: 7rem; }
input[readonly] { background: var(--post-it-light); }
input + label, textarea + .button, input + .button, .small + .button { margin-top: .44rem; }
[aria-invalid="true"] { border: 2px solid var(--error); }
.field-error { color: var(--error); font-weight: 650; font-size: .88rem; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
.password-field .button { padding-inline: .65rem; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.feedback { margin-top: .85rem; padding: .55rem .8rem; border-left: 3px solid var(--success); background: var(--success-bg); color: var(--success); font-weight: 600; }
.feedback.is-error { border-color: var(--error); background: var(--error-bg); color: var(--error); }
.feedback:empty { display: none; }
.empty { margin-top: .7rem; color: var(--muted); }

.feed-section { scroll-margin-top: 3.8rem; }
.feed-section + .feed-section { margin-top: var(--section-gap); padding-top: .9rem; border-top: 1px solid var(--line); }
.feed-section:first-child h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
.note-grid { display: grid; gap: .85rem; align-items: start; }
.note {
    min-width: 0;
    padding: .8rem .85rem .2rem;
    border-left: 4px solid var(--ink);
    background: var(--post-it);
    box-shadow: 0 2px 0 #21161220;
    overflow-wrap: anywhere;
}
.note:nth-child(even) { background: var(--post-it-light); }
.note-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.note .note-message { font-size: clamp(1rem, 2vw, 1.18rem); font-weight: 680; line-height: 1.3; }
.note-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .6rem;
    margin-top: .55rem;
    color: var(--muted);
    font: 550 .78rem/1.4 var(--mono);
    overflow-wrap: anywhere;
}
.note-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 .65rem; font-size: .84rem; }
.note-actions form { margin-left: auto; }
.note-actions > span { color: var(--muted); font-weight: 700; }
#in-evidenza .note:first-child { grid-column: 1 / -1; border-color: var(--brand); background: var(--stadium); color: var(--chalk); }
#in-evidenza .note:first-child :is(.note-meta,.note-actions > span,.quiet-link) { color: var(--chalk); }
#in-evidenza .note:first-child .note-message { font: 800 clamp(1.75rem, 4vw, 3.5rem)/.94 var(--display); }
#in-evidenza .note:first-child :focus-visible { --focus: var(--live-light); }

.account-panel, .message-panel { max-width: 40rem; margin: var(--section-gap) auto 0; border-top: 5px solid var(--brand); }
.account-panel h1, .message-panel h1 { margin: .28rem 0 .86rem; font: 800 clamp(2.5rem, 7vw, 5rem)/.87 var(--display); text-transform: uppercase; }
.admin-heading {
    --focus: var(--live-light);
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem 1.1rem;
    margin-block: var(--section-gap) 1rem;
    padding: clamp(1.05rem, 4vw, 2.6rem);
    border-bottom: 5px solid var(--brand);
    background: var(--stadium);
    color: var(--chalk);
}
.back-link + .admin-heading { margin-top: 0; }
.admin-heading > div { min-width: 0; }
.admin-heading h1 { font: 800 clamp(2.65rem, 7vw, 5.7rem)/.84 var(--display); text-transform: uppercase; }
.admin-heading .eyebrow { margin-bottom: .43rem; color: var(--live-light); }
.admin-heading .quiet-link { color: var(--chalk); }
.admin-heading .fixture-name { align-items: center; flex-wrap: wrap; }
.admin-heading .fixture-name .crest-pair { --mark-size: 2.7rem; }
.admin-grid { display: grid; gap: 1rem; align-items: start; margin-top: .9rem; }
.admin-grid .panel { border-top: 3px solid var(--ink); }
.admin-grid .panel:first-child { border-top-color: var(--brand); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: .6rem; }
.match-list { margin: 0; padding: 0; list-style: none; }
.match-list li + li { border-top: 1px solid var(--line); }
.fixture-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .4rem .75rem;
    min-height: 64px;
    padding: .5rem .25rem;
    color: var(--ink);
    text-decoration: none;
}
.fixture-row:hover { background: var(--post-it-light); }
.fixture-row .fixture-title { font: 800 1.42rem/.95 var(--display); overflow-wrap: anywhere; }
.fixture-row .stamp { color: var(--muted); font-size: .67rem; text-align: right; }
.panel [data-copy] { margin-top: .6rem; }
.score-form { padding-top: .85rem; margin-top: .9rem; border-top: 1px solid var(--line); }
.score-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; align-items: end; }
.score-fields label { display: block; margin-bottom: .2rem; }
.result strong { margin-left: .35rem; font: 800 2.1rem/.9 var(--display); font-variant-numeric: tabular-nums; }
.moderation-list { display: grid; margin-top: 1rem; border-top: 1px solid var(--line); }
.moderation-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem 1rem;
    border-top: 0;
    border-inline: 0;
    border-bottom: 1px solid var(--line);
}
.moderation-note[data-reported] { border-left: 4px solid var(--brand); }
.moderation-note[data-hidden-note] { background: var(--post-it-light); }
.moderation-note > div { flex: 1 1 20rem; min-width: 0; }
.report-count { color: var(--error); font-weight: 750; }
.moderation-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.confirm-dialog { width: min(31rem,calc(100% - 2rem)); max-height: calc(100% - 2.5rem); border: 1px solid var(--edge); border-top: 5px solid var(--brand); color: var(--ink); }
.confirm-dialog::backdrop { background: #211715ad; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

@media (min-width: 46rem) {
    .admin-grid, .note-grid { grid-template-columns: minmax(0,1.17fr) minmax(0,1fr); }
    .admin-grid--dashboard { grid-template-columns: minmax(16rem,.92fr) minmax(0,1.3fr); }
    .note:nth-child(even) { margin-top: .3rem; }
}
@media (min-width: 54rem) {
    .board-grid { grid-template-columns: minmax(0,2fr) minmax(17rem,1fr); }
    .composer { grid-area: 1 / 2; }
    .feed { grid-area: 1 / 1; }
}
@media (max-width: 45.99rem) {
    .stadium-image { inset-inline-start: 15%; width: 85%; object-position: 59% center; }
    .stadium::before { background: linear-gradient(90deg,var(--stadium),#211715d3 28%,#21171562 63%,#21171515); }
    .halftime { flex-wrap: wrap; }
}
@media (max-width: 30rem) {
    .fixture-row { grid-template-columns: auto minmax(0,1fr); }
    .fixture-row .stamp { grid-column: 2; text-align: left; }
    .note .quiet-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
