:root {
  color-scheme: light;
  --ink: #202f29;
  --muted: #59685e;
  --green: #286943;
  --green-dark: #1b5132;
  --line: #dce3d9;
  --soft: #edf3e9;
  --danger: #a32d2d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: #f5f6f0;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--green); text-underline-offset: .2em; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
button { white-space: normal; }
input, button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #925512; outline-offset: 4px; }
input:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-color: var(--green); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: .75rem; }
h3 { font-size: 1rem; margin-bottom: .25rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: #182b23; color: #f8faf6; border-bottom: 4px solid #77aa56; }
.header-inner { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 14px; min-width: 0; font-size: 1rem; font-weight: 800; letter-spacing: .12em; }
.brand small { display: block; color: #c0cfbf; font-weight: 400; font-size: .76rem; letter-spacing: .025em; margin-top: 3px; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; background: linear-gradient(#79b559 0 30%, #557940 30% 38%, #927153 38% 70%, #785940 70%); box-shadow: inset -8px 0 #0002, 4px 4px #0c1c14; }
.header-caption { color: #c0cfbf; font-size: .85rem; }
.navigation { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.navigation form { margin: 0; }
.navigation a, .nav-button { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 6px; font-size: .9rem; text-decoration: none; color: #e0e9dc; background: transparent; border: 1px solid transparent; }
.navigation a[aria-current="page"] { background: #304737; color: #d7f2b9; }
.navigation a:hover, .nav-button:hover { background: #354f3f; }
.nav-button { border-color: #526358; margin-left: 8px; }
.site-header :focus-visible { outline-color: #e6cf73; }
.main-content { flex: 1; padding-block: 52px 64px; }
.site-footer { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; padding-block: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.eyebrow, .step-label { display: block; color: var(--green); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.step-label { display: inline-block; padding: 5px 9px; background: var(--soft); border-radius: 3px; letter-spacing: .06em; }
.lead { color: var(--muted); font-size: 1.05rem; line-height: 1.75; max-width: 48ch; }
.muted, .field-help { color: var(--muted); }
.card { background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 0 #e6ebdf80; min-width: 0; }
.auth-layout, .password-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.welcome h1 { font-size: clamp(2.8rem, 5vw, 4.6rem); letter-spacing: -.05em; line-height: 1.06; margin-block: 22px; }
.welcome h1 span { color: var(--green); }
.welcome .lead { max-width: 39ch; }
.auth-card { padding: clamp(24px, 3vw, 40px); }
.form-stack { display: grid; gap: 22px; }
.auth-card > .form-stack, .add-card > .form-stack { margin-top: 26px; }
.field { display: grid; gap: 8px; min-width: 0; }
label { font-size: .9rem; font-weight: 650; }
input:not([type="hidden"]) { display: block; width: 100%; min-width: 0; min-height: 50px; border: 1px solid #9cae9e; border-radius: 6px; padding: 12px 14px; color: var(--ink); background: #fcfdfb; }
input::placeholder { color: #68786b; opacity: 1; }
input:user-invalid { border-color: var(--danger); outline-color: var(--danger); }
.field-help { font-size: .8rem; line-height: 1.6; margin: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 48px; padding: 12px 18px; border: 1px solid transparent; border-radius: 6px; font-weight: 650; font-size: .9rem; text-align: center; text-decoration: none; line-height: 1.5; }
.button-primary { background: var(--green); color: white; border-color: var(--green-dark); box-shadow: 0 3px 0 var(--green-dark); }
.button-primary:hover { background: var(--green-dark); }
.button-primary:active { box-shadow: none; transform: translateY(2px); }
.button-full { width: 100%; }
.button-danger { background: var(--danger); color: white; }
.button-danger:hover { background: #812222; }
.inset-note { padding: 18px 20px; border-left: 3px solid #83a768; background: var(--soft); border-radius: 0 6px 6px 0; font-size: .87rem; }
.inset-note strong { display: block; margin-bottom: 5px; }
.inset-note p { color: var(--muted); }
.auth-card > .inset-note { margin-top: 32px; }
.connection { display: grid; gap: 5px; min-width: 0; }
.connection .eyebrow { margin: 0; font-size: .65rem; }
.connection code { font-size: clamp(.95rem, 2vw, 1.1rem); font-weight: 650; }
.connection .muted { font-size: .76rem; }
.connection-compact { padding: 18px 22px; border: 1px solid var(--line); background: #edf1e6; border-radius: 8px; }
.world-art { position: relative; height: 142px; max-width: 410px; margin-block: 24px; overflow: hidden; background: #e6ecdf; border-bottom: 4px solid #506d3b; }
.pixel-sun { position: absolute; width: 30px; height: 30px; right: 38px; top: 20px; background: #ddbe62; box-shadow: 0 0 0 7px #e5d8a655; }
.pixel-cloud { position: absolute; width: 54px; height: 10px; top: 29px; left: 45px; background: #ffffffb8; box-shadow: 12px -9px #ffffffb8, 19px 1px #ffffffb8; }
.terrain { position: absolute; inset: auto 0 0; height: 62px; }
.terrain-back { background: #a8be91; clip-path: polygon(0 50%, 14% 50%, 14% 20%, 35% 20%, 35% 50%, 56% 50%, 56% 0, 82% 0, 82% 25%, 100% 25%, 100% 100%, 0 100%); }
.terrain-front { height: 37px; background: repeating-linear-gradient(90deg, transparent 0 29px, #00000008 29px 31px), linear-gradient(#7a9d57 0 14px, #a08762 14px 25px, #927751 25px); clip-path: polygon(0 25%, 25% 25%, 25% 0, 50% 0, 50% 50%, 75% 50%, 75% 25%, 100% 25%, 100% 100%, 0 100%); }
.pixel-tree { position: absolute; width: 12px; height: 57px; left: 30%; bottom: 32px; background: #735c3d; }
.pixel-tree::before { content: ""; position: absolute; width: 56px; height: 37px; top: -9px; left: -22px; background: #557c47; box-shadow: inset -13px -10px #42693a; }
.page-intro { max-width: 470px; }
.password-layout { align-items: start; padding-top: 20px; }
.page-intro .inset-note { margin-top: 28px; }
.onboarding-steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; color: var(--muted); font-size: .88rem; }
.onboarding-steps li { display: flex; align-items: center; gap: 12px; }
.onboarding-steps span { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid #a8b7a1; border-radius: 4px; }
.onboarding-steps [aria-current] { color: var(--green); font-weight: 650; }
.onboarding-steps [aria-current] span { background: var(--green); color: white; border-color: var(--green); }
.text-link { font-size: .87rem; padding: 8px; }
.centered { text-align: center; }
.page-heading { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.page-heading > div { min-width: 0; }
.page-heading h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.page-heading .lead { margin: 0; }
.page-heading .eyebrow { margin-bottom: 10px; }
.page-heading .connection .eyebrow { margin: 0; }
.players-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.card-heading { padding: 26px; display: flex; gap: 16px; justify-content: space-between; align-items: start; }
.card-heading h2 { font-size: 1.25rem; }
.card-heading .muted { font-size: .8rem; }
.count-badge { display: grid; place-items: center; min-width: 34px; min-height: 34px; padding: 3px 8px; background: var(--soft); color: var(--green); border-radius: 5px; font-weight: 700; }
.player-list { list-style: none; padding: 0; margin: 0; }
.player-row { padding: 20px 26px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.player-avatar { display: grid; place-items: center; width: 40px; height: 40px; font-family: ui-monospace, monospace; font-weight: 700; background: #e6efda; color: #3d6533; border: 1px solid #c9d9b8; border-bottom-width: 4px; border-radius: 3px; }
.player-identity { min-width: 0; }
.player-identity h3 { overflow-wrap: anywhere; letter-spacing: 0; }
.player-identity .muted { font-size: .75rem; }
.protected-badge { border: 1px solid #d3dec9; background: #f1f5ec; border-radius: 4px; color: #456039; padding: 5px 8px; font-size: .72rem; }
.remove-player { min-width: 0; max-width: 100%; }
.remove-player summary { min-height: 44px; padding: 11px 8px; color: var(--danger); font-size: .8rem; border-radius: 4px; text-decoration: underline; text-underline-offset: .2em; }
.remove-player summary:hover { background: #fff0ee; }
.remove-player[open] { grid-column: 2 / -1; width: 100%; }
.remove-confirmation { padding: 16px; border: 1px solid #e7bdb5; border-radius: 6px; background: #fff4f0; font-size: .85rem; overflow-wrap: anywhere; }
.remove-confirmation .field-help { margin-top: 12px; }
.roster-footnote { padding: 18px 26px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.empty-state { padding: 26px; text-align: center; border-top: 1px solid var(--line); }
.empty-state p { font-size: .9rem; max-width: 32ch; margin-inline: auto; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; background: var(--soft); color: var(--green); margin: 0 auto 18px; border-radius: 4px; font-size: 1.7rem; }
.sidebar { min-width: 0; display: grid; gap: 22px; }
.add-card { padding: 26px; border-top: 4px solid #739d51; }
.add-card h2 { font-size: 1.35rem; }
.add-card > .muted { font-size: .9rem; }
.help-card { background: #eaf0e3; padding: 24px 26px; border: 1px solid #d7e0cf; border-radius: 8px; font-size: .85rem; }
.help-card h2 { font-size: 1rem; letter-spacing: -.015em; }
.help-card ol { padding-left: 20px; margin-block: 18px; }
.help-card li { padding-left: 4px; margin-block: 10px; }
.help-card p { border-top: 1px solid #cbd8c1; padding-top: 16px; color: #4b6244; }
.flash-stack { display: grid; gap: 12px; margin-bottom: 28px; }
.notice { padding: 18px 22px; border: 1px solid #c2d0d5; border-left-width: 4px; border-radius: 6px; background: #edf3f5; color: #304a54; font-size: .9rem; overflow-wrap: anywhere; }
.notice strong { display: block; margin-bottom: 4px; }
.notice p { margin-bottom: 6px; }
.notice p:last-child { margin: 0; }
.notice a { color: inherit; font-weight: 650; }
.notice-error { background: #fff1ed; border-color: #bd6456; color: #823128; }
.notice-success { background: #edf5e8; border-color: #719758; color: #315b2c; }
.notice-warning { background: #fff7e2; border-color: #b18a38; color: #71501a; }
.bridge-notice { margin-bottom: 24px; }
.locked-card { max-width: 650px; margin: 20px auto; padding: 32px; }
.skip-link { position: absolute; left: 16px; top: -120px; background: white; padding: 12px 18px; z-index: 10; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  .players-layout { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading .connection { width: 100%; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .auth-layout, .password-layout { gap: 28px; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { padding-block: 20px; flex-wrap: wrap; gap: 20px; min-height: 0; }
  .header-caption { display: none; }
  .navigation { width: 100%; }
  .navigation form { margin-left: auto; }
  .navigation a, .nav-button { padding-inline: 12px; }
  .nav-button { margin-left: 0; }
  .main-content { padding-block: 32px 40px; }
  .auth-layout, .password-layout { grid-template-columns: minmax(0, 1fr); }
  .password-layout { padding-top: 0; }
  .welcome h1 { font-size: 3rem; }
  .welcome .lead { max-width: none; }
  .world-art { height: 110px; max-width: none; margin-block: 20px; }
  .auth-card { padding: 24px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .card-heading, .add-card, .help-card { padding: 22px; }
  .player-row { padding: 18px; gap: 10px; grid-template-columns: 36px minmax(0, 1fr) auto; }
  .player-avatar { width: 36px; height: 36px; }
  .protected-badge { font-size: .67rem; padding-inline: 6px; }
  .roster-footnote { padding: 18px; overflow-wrap: anywhere; }
  .site-footer { font-size: .75rem; padding-block: 20px; }
}
@media (max-width: 360px) {
  .player-row { grid-template-columns: 36px minmax(0, 1fr); }
  .protected-badge, .remove-player { grid-column: 2; justify-self: start; }
  .connection-compact { padding: 16px; }
  .brand { font-size: .9rem; gap: 10px; }
  .brand small { font-size: .68rem; }
}
