:root {
  color-scheme: light;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #f5f5eb;
  color: #202a21;
  --deep: #101b15;
  --green: #284b33;
  --muted: #586358;
  --border: #dce0d2;
  --paper: #fffef9;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #9a671b; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.shell { max-width: 1080px; width: min(100% - 40px, 1080px); margin: 0 auto; }
.topbar { background: var(--deep); color: #f6f8e9; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #d5de8e; color: #25391c; font-size: 19px; }
.profile-button { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; min-height: 38px; padding: 0 12px; border: 1px solid #536455; border-radius: 7px; color: #f6f8e9; background: #233529; font-size: .87rem; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; }
.page-title h1 { font-size: clamp(1.46rem, 4vw, 2.2rem); line-height: 1.16; }
.date-label { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.primary, .secondary, .quiet, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 42px; padding: 7px 13px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; }
.primary { color: #fffef1; background: var(--green); }
.page-title .primary { white-space: nowrap; }
.secondary { background: #eaf0e4; color: #284632; border-color: #d0dfca; }
.quiet { background: var(--paper); border-color: var(--border); color: var(--green); }
.danger { background: #fff2ed; border-color: #eac9bd; color: #854429; }
.primary:hover, .secondary:hover, .quiet:hover, .danger:hover { filter: brightness(.95); }
.tabs { display: flex; gap: 24px; margin-top: 11px; border-bottom: 1px solid var(--border); }
.tabs button { position: relative; min-height: 49px; padding: 0 3px; border: 0; background: none; color: var(--muted); }
.tabs button[aria-pressed="true"] { font-weight: 750; color: var(--green); }
.tabs button[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; border-radius: 2px; background: #416a48; }
.map-overview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.map-tile { display: grid; gap: 5px; min-height: 92px; text-align: left; align-content: start; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); color: #223222; }
.map-tile[aria-pressed="true"] { background: #edf2e7; border-color: #718669; }
.map-name { font-size: .98rem; overflow-wrap: anywhere; }
.map-metrics { color: #395637; font-size: .8rem; font-weight: 750; }
.map-next { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.map-tile[data-live="true"] .map-metrics { color: #1f6430; }
.board-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 15px 0; }
select, input:not([type="checkbox"]) { min-height: 42px; min-width: 0; padding: 8px 10px; color: #202a21; background: var(--paper); border: 1px solid #cfd6c8; border-radius: 7px; }
.board-tools select { font-size: .88rem; }
.sync { color: var(--muted); font-size: .78rem; margin-left: auto; }
.text-button { min-height: 40px; padding: 0 7px; border: 0; background: none; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.map-room { margin: 0 0 14px; padding: 10px; border: 1px solid #acb6a3; border-radius: 8px; background: #f2f4e9; }
.room-header { display: flex; align-items: center; gap: 8px; }
.room-header h2 { font-size: 1rem; }
.chat-messages { overflow: auto; max-height: 190px; min-height: 74px; list-style: none; padding: 7px 9px; margin: 7px 0; background: #fffef9; border: 1px solid #cfd6c8; font-size: .87rem; }
.chat-messages li { padding: 4px 0; overflow-wrap: anywhere; }
.chat-messages time { color: var(--muted); font-size: .75rem; }
.chat-messages strong { color: var(--green); }
.chat-empty { color: var(--muted); }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.chat-form input { width: 100%; }
.slot .waitlist { color: #6c4b13; }
.slot .waitlist strong { font-size: .86rem; }
.my-waitlist { color: #6c4b13; margin-top: 8px; font-size: .86rem; }
.group-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; padding-bottom: 36px; }
.group-card, .empty, .points-policy, .player-card { border: 1px solid var(--border); border-radius: 12px; background: var(--paper); }
.group-card { padding: 16px; scroll-margin-top: 10px; }
.group-card:target { outline: 2px solid #79934f; outline-offset: 3px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-header h2 { font-size: 1.23rem; }
.card-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.channel { display: inline-block; padding: 4px 6px; border-radius: 5px; background: #e8ede1; color: #324c34; font-weight: 750; font-size: .88rem; }
.group-type { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding-bottom: 4px; }
.counts div { display: grid; justify-items: start; gap: 3px; }
.counts strong { color: #25482f; font-size: 1.39rem; line-height: 1.15; }
.counts span { color: var(--muted); font-size: .75rem; }
.status { flex: none; border-radius: 5px; color: #3f5a43; background: #edf1e7; padding: 5px 7px; font-size: .74rem; font-weight: 720; }
.status.soon { color: #714b0e; background: #fbefca; }
.status.live { color: #245238; background: #e0efde; }
.slot { background: #f4f4ec; border-left: 3px solid #c7cdbb; padding: 9px 10px; margin-top: 7px; border-radius: 5px; }
.slot.active { background: #edf2e7; border-color: #66805a; }
.slot-label { font-weight: 750; color: #456046; font-size: .79rem; }
.slot-time { display: block; margin-top: 4px; font-weight: 700; font-size: .96rem; line-height: 1.45; }
.slot details { margin-top: 5px; color: var(--muted); font-size: .85rem; }
summary { width: fit-content; cursor: pointer; }
.roster, .history { list-style: none; padding: 0; margin: 8px 0 0; }
.roster li, .history li { padding: 6px 0; border-top: 1px solid #dce3d7; overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.card-actions button { min-height: 39px; font-size: .83rem; }
.empty { grid-column: 1 / -1; min-height: 145px; padding: 22px; text-align: center; }
.empty h2, .points-policy h2 { font-size: 1.17rem; }
.empty p, .points-policy p { margin-top: 7px; color: var(--muted); font-size: .93rem; line-height: 1.6; }
.empty button { margin-top: 13px; }
.points-policy { padding: 16px; margin: 15px 0 10px; }
.points-list { display: grid; gap: 7px; padding-bottom: 36px; }
.player-card { padding: 12px 14px; }
.player-card summary { width: 100%; overflow-wrap: anywhere; }
.score { color: var(--green); font-weight: 750; }
.history { font-size: .86rem; }
dialog { width: min(100% - 24px, 490px); max-height: calc(100% - 28px); padding: 19px; border: 1px solid #d2dbce; border-radius: 14px; background: var(--paper); color: #202a21; box-shadow: 0 16px 64px #07160e48; }
dialog::backdrop { background: #0d1a13a3; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.dialog-top h2 { font-size: 1.24rem; }
.icon-button { width: 40px; height: 40px; font-size: 1.45rem; line-height: 1; border: 1px solid var(--border); border-radius: 8px; background: #f4f5ec; color: var(--green); }
.editor-form, .stack { display: grid; gap: 10px; }
.editor-form label:not(.check) { display: grid; gap: 4px; font-size: .89rem; }
.editor-form input, .editor-form select { width: 100%; }
.editor-form p, .editor-note { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.form-row.time { grid-template-columns: minmax(0, 1fr); }
.editor-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.check { display: flex; align-items: center; gap: 7px; min-height: 40px; }
.editor-form .form-error { color: #8b3022; }
.editor-form .actions, .stack .actions { display: flex; gap: 7px; flex-wrap: wrap; }
.editor-form textarea { width: 100%; min-height: 104px; font: inherit; color: #202a21; }
#toast { position: fixed; z-index: 5; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); padding: 10px 14px; border-radius: 8px; color: #fff; background: #23392a; box-shadow: 0 4px 20px #0002; font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 650px) {
  .shell { width: calc(100% - 26px); }
  .page-title { margin-top: 13px; }
  .map-overview { grid-template-columns: minmax(0, 1fr); }
  .map-tile { grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 50px; gap: 4px 8px; }
  .map-next { grid-column: 1 / -1; }
  .group-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 375px) {
  .shell { width: calc(100% - 20px); }
  .board-tools { column-gap: 5px; }
  .board-tools select { max-width: 154px; padding-inline: 6px; }
  .page-title { flex-wrap: wrap; }
}

:root {
  background: #f0efdc;
  color: #202c23;
  --deep: #20382e;
  --green: #2f593e;
  --paper: #fffbed;
  --border: #c1c4a5;
}
.topbar { border-bottom: 4px solid #acc183; }
.page-title h1 { letter-spacing: .03em; }
.brand-mark, .profile-button, .primary, .secondary, .quiet, .danger, .status, .slot, select, input:not([type="checkbox"]), dialog, .group-card, .player-card, .empty, .points-policy, .map-room { border-radius: 2px; }
.brand-mark { position: relative; box-shadow: 2px 2px 0 #0e2018; }
.brand-mark::before { content: ""; width: 20px; height: 20px; background: #325239; clip-path: polygon(44% 0,56% 0,56% 15%,71% 15%,71% 29%,86% 29%,86% 50%,100% 50%,100% 65%,71% 65%,71% 80%,56% 80%,56% 100%,44% 100%,44% 80%,29% 80%,29% 65%,0 65%,0 50%,14% 50%,14% 29%,29% 29%,29% 15%,44% 15%); }
.primary { box-shadow: 2px 2px 0 #1a3328; }
.quiet, .secondary { box-shadow: 2px 2px 0 #c3c7ae; }
.map-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; }
.map-panel { border: 1px solid #aab095; border-left: 5px solid var(--map-edge); background: var(--paper); box-shadow: 2px 3px 0 #d3d2b8; min-width: 0; }
.map-snow { --map-edge: #78a6bd; --map-background: #e5f1f5; }
.map-crown { --map-edge: #bc923d; --map-background: #f6ebcc; }
.map-cliff { --map-edge: #a36b4b; --map-background: #f7e9de; }
.map-forest { --map-edge: #527a61; --map-background: #e1ecdf; }
.map-ruins { --map-edge: #80729b; --map-background: #eae3ef; }
.map-tile { width: 100%; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "icon name status arrow" "icon metrics metrics arrow"; align-items: center; align-content: center; min-height: 49px; padding: 6px 9px; gap: 3px 7px; background: var(--map-background); border: 0; border-radius: 0; }
.map-tile[aria-pressed="true"] { background: var(--map-background); box-shadow: inset 0 -2px 0 var(--map-edge); }
.map-icon { grid-area: icon; width: 21px; height: 20px; background: var(--map-edge); clip-path: polygon(35% 0,65% 0,65% 25%,80% 25%,80% 50%,100% 50%,100% 100%,0 100%,0 50%,20% 50%,20% 25%,35% 25%); }
.map-crown .map-icon { clip-path: polygon(0 20%,20% 20%,20% 40%,40% 40%,40% 0,60% 0,60% 40%,80% 40%,80% 20%,100% 20%,100% 85%,0 85%); }
.map-forest .map-icon { clip-path: polygon(40% 0,60% 0,60% 25%,75% 25%,75% 45%,90% 45%,90% 68%,60% 68%,60% 100%,40% 100%,40% 68%,10% 68%,10% 45%,25% 45%,25% 25%,40% 25%); }
.map-name { grid-area: name; }
.map-state { grid-area: status; padding: 3px 5px; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.map-active { color: #723517; background: #fae3b6; }
.map-booked { color: #3d3970; background: #e5def0; }
.map-free { color: #335543; background: #dcedd9; }
.map-metrics { grid-area: metrics; }
.map-arrow { grid-area: arrow; font-size: 1.3rem; color: #3d5540; }
.map-next { margin: 0; padding: 5px 9px 6px; }
.map-channel { border-top: 1px solid #dbd8be; padding: 5px 8px; }
.overview-occupants { margin-top: 13px; padding: 8px; border: 1px solid var(--border); background: var(--paper); }
.overview-occupants h2 { font-size: .98rem; margin: 0 0 5px 8px; }
.group-list { padding-bottom: 14px; }
.map-channel p { display: flex; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; font-size: .87rem; }
.map-channel p span, .map-channel small { font-size: .76rem; color: #5e573a; }
.occupants { padding: 0; margin: 4px 0 0; list-style: none; }
.occupant { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, auto); gap: 5px; align-items: center; padding: 4px 0; border-top: 1px dashed #dacfb8; }
.occupant div { display: grid; gap: 1px; overflow-wrap: anywhere; }
.occupant strong { font-size: .82rem; }
.occupant span:not(.portrait) { font-size: .7rem; color: var(--muted); }
.occupant-times { text-align: right; }
.portrait { --sprite: #528456; --portrait-background: #e2ead5; display: inline-grid; place-items: center; width: 23px; height: 23px; border: 1px solid #b7b99d; background: var(--portrait-background); flex: none; vertical-align: middle; }
.portrait i { width: 16px; height: 16px; background: var(--sprite); clip-path: polygon(62.5% 0,100% 0,100% 37.5%,87.5% 37.5%,87.5% 62.5%,62.5% 62.5%,62.5% 75%,37.5% 75%,37.5% 87.5%,12.5% 87.5%,12.5% 100%,0 100%,0 75%,12.5% 75%,12.5% 37.5%,25% 37.5%,25% 25%,37.5% 25%,37.5% 12.5%,62.5% 12.5%); }
.portrait-mage { --sprite: #734a91; --portrait-background: #f1e5f5; }
.portrait-mage i { clip-path: polygon(50% 0,75% 0,75% 23%,63% 23%,63% 46%,75% 46%,75% 65%,90% 65%,90% 84%,100% 84%,100% 100%,0 100%,0 84%,15% 84%,15% 65%,30% 65%,30% 45%,43% 45%,43% 18%,50% 18%); }
.portrait-knight { --sprite: #568394; --portrait-background: #e3f0f2; }
.portrait-knight i { clip-path: polygon(12% 12%,88% 12%,88% 30%,100% 30%,100% 70%,87% 70%,87% 88%,63% 88%,63% 100%,37% 100%,37% 88%,12% 88%,12% 70%,0 70%,0 30%,12% 30%); }
.portrait-fox { --sprite: #b66434; --portrait-background: #fae6cb; }
.portrait-fox i { clip-path: polygon(0 0,25% 0,25% 30%,75% 30%,75% 0,100% 0,100% 64%,75% 64%,75% 82%,60% 82%,60% 100%,40% 100%,40% 82%,25% 82%,25% 64%,0 64%); }
.portrait-slime { --sprite: #4b9f73; --portrait-background: #dff3e1; }
.portrait-slime i { clip-path: polygon(38% 13%,63% 13%,63% 25%,78% 25%,78% 40%,90% 40%,90% 63%,100% 63%,100% 88%,86% 88%,86% 100%,14% 100%,14% 88%,0 88%,0 63%,10% 63%,10% 40%,22% 40%,22% 25%,38% 25%); }
.portrait-archer { --sprite: #a37732; --portrait-background: #f7ebd0; }
.portrait-archer i { clip-path: polygon(62% 0,100% 0,100% 38%,84% 38%,84% 63%,63% 63%,63% 78%,38% 78%,38% 88%,13% 88%,13% 100%,0 100%,0 85%,25% 85%,25% 70%,45% 70%,45% 55%,63% 55%,63% 38%,77% 38%,77% 18%,62% 18%); }
.avatar-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px 6px; margin: 2px 0; padding: 5px; border: 1px solid var(--border); }
.editor-form .avatar-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px; cursor: pointer; }
.editor-form .avatar-choice input { width: auto; min-height: 0; }
.avatar-choice:has(input:checked) { background: #e4ebd7; outline: 1px solid #77866d; }
.return-time { padding: 6px 8px; background: #e8ecdc; color: #344c35; font-weight: 700; font-size: .88rem; }
.editor-form details .form-row { margin-top: 8px; }
.chat-zone { color: var(--muted); font-size: .73rem; }
.points-history { max-height: 55vh; overflow: auto; }
.roster-actions { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 5px; }
.roster-actions button { min-height: 30px; padding: 3px 6px; font-size: .75rem; }
.attendance-check { display: inline-block; margin-left: 4px; color: #743f17; font-size: .72rem; }
.remove-chat { min-height: 28px; font-size: .75rem; }
@media (max-width: 650px) {
  .map-overview { grid-template-columns: 1fr; gap: 7px; }
}
