:root {
  color-scheme: dark;
  --bg: #141914;
  --panel: #212a20;
  --border: #414d39;
  --text: #f6f2e2;
  --muted: #c1c9b5;
  --gold: #efc566;
  --dark: #171d15;
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at 20% 0%, #293b26, var(--bg) 46rem); }
main { max-width: 1400px; padding: 2rem clamp(1rem, 4vw, 3.5rem) 3rem; margin: auto; }
.hero { display: flex; align-items: center; gap: 1.7rem; margin-bottom: 1.8rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.logo { width: clamp(140px, 22vw, 265px); height: auto; display: block; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-size: .82rem; font-weight: 750; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font: 700 clamp(2.25rem, 4.8vw, 3.7rem)/1.05 Georgia, serif; margin: .18rem 0 .4rem; }
#subtitle, .hint, .team { color: var(--muted); }
nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: .6rem; }
button, .button { font: inherit; font-weight: 720; text-decoration: none; display: inline-block; padding: .62rem .9rem; background: var(--gold); color: #21190c; border: 1px solid transparent; border-radius: .45rem; cursor: pointer; }
.ghost { border-color: #647456; background: #253123; color: var(--text); }
button:hover, .button:hover { filter: brightness(1.13); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#scoreboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.score { padding: 1.04rem; border: 1px solid var(--border); border-top: 3px solid #81986b; border-radius: .65rem; background: linear-gradient(165deg, #2c3928, #20281f 68%); min-width: 0; }
.score.winner { border-color: var(--gold); }
.score-meta { color: #e8d399; font-size: .84rem; font-weight: 680; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: space-between; }
.score h2 { font: 700 1.45rem/1.2 Georgia, serif; margin: .38rem 0 .22rem; }
.score h2, .team, .progress { overflow-wrap: anywhere; }
.team { font-size: .9rem; }
.score dl { margin-top: .8rem; }
.score dl div:not(.primary) { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem .5rem; font-size: .88rem; margin: .22rem 0; }
.score dt { color: var(--muted); }
.score dd { font-weight: 720; font-variant-numeric: tabular-nums; }
.primary { border-bottom: 1px solid var(--border); margin-bottom: .55rem; padding-bottom: .5rem; }
.primary dt { font-size: .84rem; }
.primary dd { color: var(--gold); font-size: clamp(1.15rem, 2.1vw, 1.85rem); line-height: 1.2; }
.progress { margin-top: .65rem; padding-top: .55rem; border-top: 1px solid var(--border); font-size: .9rem; }
.score-note { margin: .66rem 0 1.55rem; color: var(--muted); font-size: .88rem; }
.work { display: grid; grid-template-columns: 1.3fr 1fr; gap: .9rem; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: .65rem; padding: 1.2rem; min-width: 0; }
.panel h2 { font-size: 1.19rem; margin-bottom: .65rem; }
form, label, .fields { display: grid; gap: .57rem; min-width: 0; }
form > button { justify-self: start; margin-top: .27rem; }
label { gap: .25rem; font-size: .9rem; color: var(--muted); }
.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
input, select { width: 100%; height: 2.55rem; background: var(--dark); border: 1px solid #5a6953; border-radius: .38rem; padding: .35rem .55rem; color: var(--text); font: inherit; font-size: 1rem; }
.check { display: flex; gap: .55rem; align-items: center; }
.check input { width: 1rem; height: 1rem; accent-color: var(--gold); }
.hint { font-size: .9rem; }
.journal { margin-top: .9rem; }
.journal-head { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .65rem; }
.journal h2 { margin-bottom: .1rem; }
.empty { padding-top: .65rem; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: .6rem; text-align: left; }
td, th { padding: .45rem .5rem; border-bottom: 1px solid var(--border); }
td:first-child { min-width: 9rem; overflow-wrap: anywhere; }
th { color: var(--muted); font-size: .9rem; }
.compact { font-size: .87rem; padding: .3rem .55rem; }
#notice { padding: .6rem .9rem; margin-bottom: .9rem; background: #32492b; border-radius: .4rem; }
#notice.error { background: #713a29; }
body.overlay { background: transparent; }
.overlay main { padding: 1rem; }
.overlay .hero { display: inline-flex; background: #202b1eee; border: 1px solid var(--border); border-radius: .65rem; padding: .45rem .8rem; margin-bottom: .7rem; gap: .9rem; }
.overlay .logo { width: clamp(105px, 17vw, 185px); }
.overlay h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.overlay .score-note { display: table; background: #202b1eee; padding: .28rem .55rem; border-radius: .35rem; color: var(--text); }
@media (max-width: 950px) { #scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 660px) { .hero { flex-wrap: wrap; gap: .8rem; } nav { width: 100%; margin: 0; } .work { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .fields, #scoreboard { grid-template-columns: 1fr; } }

.login { max-width: 34rem; }
.login .hero { justify-content: center; }
.login h1 { font-size: 2.25rem; margin-bottom: .9rem; }
.login [role="alert"] { margin-bottom: .8rem; color: #ffd4bf; }
#admin-nav form > button { margin: 0; }
.single-farm #scoreboard { grid-template-columns: minmax(0, 22rem); }
#farm-tabs { margin: 0 0 .9rem; }
#farm-tabs [aria-current="page"] { border-color: var(--gold); color: var(--gold); }
