:root {
  color-scheme: light;
  --bg: #f3f1e9;
  --paper: #fffdf8;
  --ink: #172d26;
  --muted: #53645b;
  --line: #d8ded1;
  --green: #14362d;
  --green-soft: #dcebdc;
  --orange: #bf4a30;
  --red: #a52e22;
  --gold: #ab7208;
  --radius: 17px;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:disabled { cursor: default; opacity: .55; }
button, input, select, a, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid #b34c22; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.045em; line-height: 1.05; }
h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); font-weight: 760; }
h2 { font-size: 1.58rem; font-weight: 740; }
h3 { font-size: 1.14rem; }
input:not([type=checkbox]), select {
  display: block; min-width: 0; width: 100%; background: #f8f8f1; color: var(--ink);
  border: 1px solid #c9d2c7; border-radius: 8px; min-height: 43px; padding: 8px 10px;
}
input:not([type=checkbox]):focus, select:focus { border-color: #547861; }
input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; margin: 0; }
label { display: grid; gap: 6px; font-weight: 630; font-size: .84rem; }
form { display: grid; gap: 15px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-size: .84rem; font-weight: 650; margin-bottom: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow { color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .115em; line-height: 1.3; text-transform: uppercase; }
.accent-dot { display: inline-block; margin-right: 4px; width: 8px; height: 8px; border-radius: 100%; background: #e47a51; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.04em; font-size: 1.3rem; white-space: nowrap; text-decoration: none; }
.brand-mark { width: 29px; height: 29px; transform: rotate(-9deg); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; flex: none; }
.brand-mark i { display: block; border-radius: 2px; background: #d6e8c8; }
.brand-mark i:nth-child(2) { background: #f08c65; }
.brand-mark i:nth-child(3) { background: #8ab099; }
.button {
  display: inline-flex; width: fit-content; min-height: 43px; align-items: center; justify-content: center; gap: 15px;
  border-radius: 8px; padding: 8px 15px; border: 1px solid transparent; white-space: nowrap; font-weight: 700; font-size: .91rem;
}
.button.primary { background: var(--green); color: #fffdf8; }
.button.primary:hover:not(:disabled) { background: #27513f; }
.button.secondary { color: var(--green); border-color: #9eafa0; background: #f7faf3; }
.button.secondary:hover { background: #e3eddf; }
.button.danger { color: #fff; background: var(--red); }
.button span { font-size: 1.25em; line-height: 1; }
.text-button { padding: 5px 4px; font-weight: 650; font-size: .84rem; color: var(--muted); border: 0; background: transparent; text-underline-offset: 3px; }
.text-button:hover { text-decoration: underline; }
.text-button.destructive { color: var(--red); }
.message { min-height: 19px; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.message.is-error { color: var(--red); }
.loading { margin: 35px; }

.entry { display: grid; grid-template-columns: 1.12fr 1fr; min-height: 100svh; }
.entry-hero { background: var(--green); color: #f6f5e8; position: relative; display: flex; flex-direction: column; padding: clamp(24px, 5vw, 72px); overflow: hidden; }
.entry-hero .brand { position: relative; z-index: 2; align-self: flex-start; }
.entry-content { position: relative; z-index: 1; margin: max(50px, 11vh) 0 30px; }
.entry-content .eyebrow { color: #aec2ad; margin-bottom: 16px; }
.entry-content h1 { font-size: clamp(3.6rem, 7vw, 7.5rem); line-height: .95; letter-spacing: -.075em; }
.entry-content > p:last-child { margin-top: 24px; font-size: 1rem; max-width: 285px; color: #e0ebd9; line-height: 1.5; }
.entry-art {
  position: relative; margin: auto 0 -14px auto; width: min(370px, 84%); min-height: 175px; aspect-ratio: 1.85;
  border: 1px solid #ffffff30; border-radius: 11px; background-color: #1c4838;
  background-image: linear-gradient(#c4e3c236 1px, transparent 1px), linear-gradient(90deg, #c4e3c236 1px, transparent 1px);
  background-size: 12.5% 25%; transform: rotate(-7deg); box-shadow: 0 14px 30px #10271f70;
}
.art-route { position: absolute; left: 30%; bottom: 25%; width: 38%; height: 48%; border: 1px dashed #c7ebcb90; border-left: 0; border-top: 0; }
.art-pawn { position: absolute; display: grid; place-items: center; width: 10%; aspect-ratio: 1; border-radius: 30%; font-size: clamp(.85rem, 3vw, 1.2rem); font-weight: 800; }
.art-pawn.p1 { left: 26%; bottom: 14%; background: #cfe8bb; color: #203727; }
.art-pawn.p2 { left: 63%; top: 15%; background: #fa9369; color: #402314; }
.art-pawn.p3 { left: 13%; top: 15%; background: #edd197; color: #3a301b; }
.art-coord { position: absolute; bottom: 9px; right: 11px; color: #deead5; font-size: .62rem; font-weight: 700; letter-spacing: .12em; }
.entry-form { display: grid; place-items: center; padding: 35px 24px; }
.form-card { width: min(100%, 380px); padding: 15px 0; }
.form-card h2 { font-size: clamp(2.2rem, 5vw, 3.35rem); margin-top: 9px; }
.form-card > p:not(.eyebrow) { color: var(--muted); margin: 12px 0 28px; line-height: 1.4; }
.form-card .button { width: 100%; justify-content: space-between; margin-top: 5px; }

.topbar { background: var(--green); color: #f7f6eb; }
.toolbar { max-width: 1300px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px); min-height: 66px; display: flex; align-items: center; gap: clamp(18px, 5vw, 58px); }
.toolbar nav { display: flex; align-self: stretch; gap: 18px; align-items: stretch; }
.toolbar nav button { border: 0; border-bottom: 3px solid transparent; padding: 3px 0 0; background: transparent; color: #d6e4d8; font-weight: 620; font-size: .86rem; white-space: nowrap; }
.toolbar nav button.active { color: #fffdf2; border-bottom-color: #ee956d; }
.account { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.account .text-button { color: #e5eddb; margin-left: 8px; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: #d9e8d5; color: #233e32; font-weight: 780; font-size: .71rem; }
.account-name { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { max-width: 1300px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px) 40px; }
.match-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 36px 0 25px; }
.match-intro h1 { overflow-wrap: anywhere; }
.match-intro .eyebrow { margin-bottom: 7px; }
.match-intro .eyebrow span:not(.accent-dot) { margin: 0 3px; }
.cutoff { display: flex; align-items: center; gap: 9px; background: #ebece2; border: 1px solid #d9dfd3; border-radius: 10px; padding: 8px 13px; min-width: max-content; }
.cutoff-icon { font-size: 1.35rem; color: #48634e; }
.cutoff span:not(.cutoff-icon) { display: block; font-size: .64rem; font-weight: 760; letter-spacing: .07em; color: var(--muted); }
.cutoff strong { display: block; font-size: .87rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.game-layout, .host-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 365px); gap: 20px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-head p:not(.eyebrow) { margin-top: 5px; color: var(--muted); font-size: .87rem; line-height: 1.36; }
.remaining { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: max-content; background: #e6efe2; color: #2f583d; border-radius: 40px; font-size: .76rem; font-weight: 730; padding: 6px 9px; }
.remaining span { width: 7px; height: 7px; border-radius: 50%; background: #53865e; }
.board-column, .order-column { display: grid; gap: 16px; min-width: 0; }
.grid-shell { margin: 15px auto 13px; width: 100%; max-width: 650px; }
.tile-grid {
  display: grid; grid-template-columns: clamp(16px, 3.9vw, 25px) repeat(var(--size, 7), minmax(0, 1fr));
  gap: 2px; padding: 4px; background: #d8e1d5; border: 1px solid #c9d6ca; border-radius: 11px;
}
.tile, .coordinate, .grid-origin { display: grid; place-items: center; min-width: 0; }
.coordinate, .grid-origin { align-self: stretch; font-size: clamp(.56rem, 1.18vw, .72rem); min-height: 20px; font-weight: 760; color: #44594e; font-variant-numeric: tabular-nums; }
.grid-origin { color: #647a6b; }
.tile { aspect-ratio: 1; position: relative; background: #f4f7eb; border-radius: 2px; container-type: inline-size; }
.tile.alt { background: #eaf1e3; }
.tile.exposed { background: repeating-linear-gradient(135deg, #e6ded0 0, #e6ded0 3px, #efe8e0 3px, #efe8e0 7px); }
.tile.supply { background: #f8e9ba; box-shadow: inset 0 0 0 1px #d1ab57; }
.diamond { width: 28%; aspect-ratio: 1; border: 2px solid #996b18; transform: rotate(45deg); border-radius: 3px; background: #edc25c; }
.supply-corner { position: absolute; top: 4px; right: 4px; width: 12%; aspect-ratio: 1; transform: rotate(45deg); background: #986509; }
.pawn { display: inline-grid; place-items: center; width: 27px; height: 27px; flex: none; border-radius: 30%; background: var(--pawn, #34624b); color: #fff; font-weight: 760; font-size: .65rem; overflow: hidden; }
.tile .pawn { width: 65%; height: 65%; max-width: 48px; max-height: 48px; font-size: clamp(.43rem, 29cqw, .94rem); text-align: center; }
.pawn.own { outline: 2px solid var(--pawn); outline-offset: 2px; }
.pawn.out { background: #69746b; }
.fern { --pawn: #3b6c4c; } .orange { --pawn: #a5442d; } .blue { --pawn: #345a80; } .plum { --pawn: #754770; }
.gold { --pawn: #835c1d; } .teal { --pawn: #2b6767; } .rose { --pawn: #904451; } .slate { --pawn: #4e576f; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; color: var(--muted); font-size: .77rem; }
.legend > span { display: flex; align-items: center; gap: 6px; }
.legend-key { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.player-key { background: #3a6c4c; }
.supply-key { transform: rotate(45deg) scale(.78); background: #edc25c; border: 1px solid #996b18; }
.exposed-key { background: repeating-linear-gradient(135deg,#d4bdab 0,#d4bdab 2px,#f3e9de 2px,#f3e9de 4px); border: 1px solid #c4ab97; }

.orders .eyebrow { margin-bottom: 5px; }
.orders form { margin-top: 15px; gap: 12px; }
.point-badge { min-width: max-content; font-size: .79rem; border: 1px solid #cbd9ca; background: #eef4ea; color: #315640; padding: 6px 8px; border-radius: 7px; }
.point-badge.overspent { color: var(--red); background: #fbebe8; border-color: #e6b4ae; }
.order-slots { display: grid; gap: 7px; }
.order-slot { display: grid; grid-template-columns: 25px repeat(2,minmax(0,1fr)); align-items: end; gap: 8px; border: 1px solid var(--line); background: #fafbf4; border-radius: 9px; padding: 8px; }
.order-slot select { min-height: 35px; background: #fffdf8; padding: 4px 5px; font-size: .84rem; }
.order-slot label { font-size: .72rem; gap: 3px; }
.slot-number { align-self: center; margin-top: 10px; font-weight: 760; color: #5c7061; font-size: .72rem; font-variant-numeric: tabular-nums; }
.order-slot .boost-option { grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; }
.boost-note { color: #785319; font-size: .78rem; }
.boost-note span { color: #9a6a15; }
.order-actions { display: flex; gap: 12px; }
.roster { padding-bottom: 10px; }
.roster ul, .account-list { list-style: none; margin: 10px 0 0; padding: 0; }
.roster li { display: grid; grid-template-columns: 28px minmax(0,1fr) 30px 64px; gap: 8px; padding: 8px 0; align-items: center; border-top: 1px solid #e4e8dd; }
.player-name { overflow-wrap: anywhere; font-size: .88rem; font-weight: 680; }
.player-name small { color: #50675a; font-size: .56rem; margin-left: 5px; font-weight: 780; }
.player-location { color: var(--muted); font-weight: 670; font-size: .72rem; text-align: center; }
.hearts { color: #adb7ae; text-align: right; font-size: .91rem; letter-spacing: .08em; }
.hearts .full { color: #ad4735; }
.hearts.eliminated { color: var(--muted); font-size: .69rem; letter-spacing: 0; }
.result-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.result-card h2 { margin-top: 5px; }
.result-card p, .result-card ul { color: var(--muted); font-size: .84rem; }
.result-detail ul { margin: 0; padding-left: 16px; }
.result-detail strong { display: block; margin-top: 5px; font-size: .82rem; }
.page > .result-card { margin-bottom: 16px; }
.rules { max-width: 700px; margin: 20px 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.rules summary { cursor: pointer; width: fit-content; color: var(--ink); font-weight: 730; }
.rules div { margin-top: 6px; }
.empty-match { display: grid; justify-items: center; align-content: center; gap: 12px; text-align: center; min-height: 340px; }
.empty-match p { color: var(--muted); }
.empty-mark { display: grid; place-items: center; width: 57px; height: 57px; color: #356449; background: #dcebdc; border-radius: 14px; font-size: 1.95rem; }
.host-layout { grid-template-columns: minmax(0, 1.07fr) minmax(0, .93fr); }
.host-message:empty { display: none; }
.host-message:not(:empty) { margin-bottom: 13px; }
.manage form { margin-top: 16px; }
.manage .quiet { color: var(--muted); font-size: .85rem; }
.form-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 23px; }
.roster-checks { display: flex; flex-wrap: wrap; gap: 7px; }
.roster-checks label { border: 1px solid var(--line); padding: 5px 7px; border-radius: 6px; background: #f7f8f1; }
.schedule-summary { display: flex; justify-content: space-between; gap: 10px; margin-top: 15px; padding: 10px; background: #edf3e9; border-radius: 7px; font-size: .83rem; }
.host-footer { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 16px; }
.host-footer p { flex-basis: 100%; color: var(--red); font-size: .85rem; }
.account-list li { display: flex; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.account-list li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.account-list strong { font-size: .87rem; }
.account-list small { display: block; margin-top: 2px; font-size: .72rem; color: var(--muted); }
.invite-output { display: grid; gap: 8px; margin: 14px 0; padding: 11px; border-radius: 8px; border: 1px solid var(--line); background: #edf3e9; }
.invite-output p { font-size: .76rem; color: var(--muted); }
.audit { margin-top: 16px; }
.audit p { margin: 5px 0 10px; color: var(--muted); font-size: .84rem; }
.audit pre { max-height: 400px; overflow: auto; background: #f2f5ed; padding: 12px; border-radius: 6px; font-size: .8rem; }
@media (max-width: 780px) {
  .game-layout, .host-layout { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; }
  .entry-hero { min-height: 290px; padding: 24px; }
  .entry-content { margin: 38px 0 8px; }
  .entry-content h1 { font-size: clamp(2.8rem, 8vw, 4.5rem); }
  .entry-content > p:last-child { margin-top: 16px; }
  .entry-art { position: absolute; width: 34%; min-height: 105px; right: -8px; bottom: 9px; opacity: .5; }
  .entry-form { padding: 26px 24px; }
}
@media (max-width: 480px) {
  .toolbar { flex-wrap: wrap; min-height: 58px; gap: 4px 15px; padding-top: 10px; }
  .toolbar nav { order: 3; flex-basis: 100%; min-height: 35px; }
  .account-name { display: none; }
  .match-intro { padding: 23px 0 15px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .panel { padding: 14px; }
  .tile-grid { gap: 1px; }
  .result-card { display: grid; }
  .grid-shell { margin-top: 11px; }
  .form-row { gap: 8px; }
  .cutoff { padding: 5px 8px; }
}
