:root {
  color-scheme: dark;
  --bg: #242824;
  --panel: #343a34;
  --border: #505a50;
  --border-dark: #171b17;
  --text: #e9ede3;
  --muted: #b7c0b4;
  --orange: #e8a04a;
  --orange-hover: #f2b66b;
  --green: #91bd79;
  --red: #e28d7b;
}
* { box-sizing: border-box; }
html { font-family: Arial, Helvetica, sans-serif; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-hover); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(29px, 4vw, 42px); line-height: 1.15; margin-bottom: 12px; }
h1 em { color: var(--orange); font-style: normal; }
h2 { font-size: 23px; margin-bottom: 12px; }
h3 { font-size: 18px; }
p { color: var(--muted); }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 60px; padding: 0 28px; display: flex; align-items: center; gap: 24px; background: #2d332d; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-icon { display: grid; place-items: center; width: 31px; height: 31px; background: var(--orange); color: #241c11; font-weight: 900; font-size: 22px; }
.brand strong { display: block; font-size: 16px; line-height: 1.05; letter-spacing: .05em; }
.brand small { display: block; font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.nav { display: flex; align-items: stretch; gap: 3px; min-height: 59px; margin-left: 12px; }
.nav a { display: grid; place-items: center; padding: 0 14px; color: var(--muted); font-size: 13px; }
.nav a:hover, body[data-nav=dashboard] .nav a[data-nav=dashboard], body[data-nav=game] .nav a[data-nav=game], body[data-nav=profile] .nav a[data-nav=profile], body[data-nav=admin] .nav a[data-nav=admin] { background: #414941; color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#home-login { margin-left: auto; }
.account { color: var(--muted); font-size: 12px; }
main { width: min(1040px, calc(100% - 36px)); margin: 0 auto; flex: 1; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 17px 28px; border-top: 1px solid var(--border); color: #a9b4a7; font-size: 11px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 8px 17px; border: 1px solid #ae7535; border-radius: 4px; color: #291f12; background: var(--orange); font-size: 14px; font-weight: 700; text-align: center; }
.button:hover { color: #291f12; background: var(--orange-hover); }
.button-outline, .button-ghost { color: var(--text); border-color: #647064; background: #4c564c; }
.button-outline:hover, .button-ghost:hover { color: #fff; background: #586358; }
.button.small { min-height: 31px; padding: 4px 9px; font-size: 12px; box-shadow: none; }
.button.full { width: 100%; }
.eyebrow, .overline, .panel-caption { color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: .07em; }
.panel-caption { margin-bottom: 14px; }
.muted, .fine { color: var(--muted); }
.fine { font-size: 12px; }
p.fine { margin: 18px 0 0; }
.reset-local { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.panel { padding: 22px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.start-screen { max-width: 680px; margin: 70px auto 42px; }
.screen-title { margin-bottom: 28px; }
.screen-title h1 { margin: 7px 0 8px; }
.screen-title p { font-size: 16px; }
.server-card { padding: 18px 20px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
.server-card-line { display: flex; align-items: center; gap: 15px; margin-top: 7px; }
.server-card-line strong { font-size: clamp(16px, 3vw, 21px); overflow-wrap: anywhere; }
.server-card-line .small-control { margin-left: auto; }
.small-control { margin-left: auto; padding: 5px 9px; border: 1px solid #687368; color: var(--text); background: #4a534a; font-size: 12px; }
.start-actions { display: flex; gap: 10px; margin-top: 18px; }
.instructions { max-width: 680px; margin: 0 auto 70px; border-top: 1px solid var(--border); padding-top: 24px; }
.instructions h2 { font-size: 18px; }
.instructions ol { margin: 7px 0 0; padding-left: 23px; color: var(--muted); }
.instructions li { margin: 9px 0; padding-left: 3px; }
.instructions strong { color: var(--text); }
.mod-download { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.mod-download strong { display: block; margin-bottom: 3px; }
.mod-download p { margin: 0; font-size: 13px; }
.mod-download .button { flex: 0 0 auto; }
.single-mod { margin: 15px 0 0; font-size: 13px; }
.login-screen { max-width: 440px; margin: 65px auto 80px; }
.login-screen .screen-title { margin-bottom: 22px; }
.login-panel { padding: 25px; }
.form-separator { display: flex; align-items: center; gap: 10px; margin: 17px 0; color: var(--muted); font-size: 12px; }
.form-separator::before, .form-separator::after { content: ''; height: 1px; flex: 1; background: var(--border); }
.auth-links { display: flex; justify-content: space-between; gap: 15px; margin-top: 20px; font-size: 13px; }
.simple-page { max-width: 680px; margin: 0 auto; padding: 42px 0 70px; }
.page-heading { margin: 42px 0 24px; }
.simple-page .page-heading { margin-top: 0; }
.page-heading h1 { margin: 6px 0 9px; }
.page-heading p { margin-bottom: 0; }
.page-heading .game-mod-link { margin-top: 9px; font-size: 13px; }
.narrow { max-width: 520px; }
label { display: block; margin: 13px 0 6px; color: var(--text); font-size: 13px; }
label small { color: var(--muted); }
input:not([type=checkbox]), select { display: block; width: 100%; min-height: 39px; margin-top: 5px; padding: 7px 9px; color: var(--text); background: #242a24; border: 2px solid #171b17; box-shadow: inset 1px 1px #111, 1px 1px #596359; outline: 0; border-radius: 1px; }
input:focus, select:focus { border-color: var(--orange); }
input::placeholder { color: #8d998d; }
form .button { margin-top: 13px; }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0; }
.check input { margin-top: 2px; accent-color: var(--orange); }
.warning { padding: 12px; margin: 18px 0; color: #ffd19b; background: #4a3d2c; border: 1px solid #ad793c; }
.warning p { margin: 4px 0 0; color: #e4c8a6; }
.warning.slim { font-size: 13px; }
.dashboard-summary { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; max-width: 720px; }
.dashboard-summary strong { display: block; margin-top: 5px; font-size: 19px; overflow-wrap: anywhere; }
.dashboard-actions { display: flex; gap: 10px; margin-top: 18px; }
.dashboard-download { margin-top: 24px; font-size: 13px; }
.data-line, .connection-detail { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-line span, .connection-detail span { color: var(--muted); }
.data-line strong, .connection-detail strong { text-align: right; overflow-wrap: anywhere; }
.game-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; margin-bottom: 65px; }
.game-panel h2 { margin: 11px 0 6px; }
.game-side { display: grid; gap: 10px; align-content: start; }
.status-pill { color: var(--orange); border: 1px solid #9b713e; padding: 3px 7px; font-size: 11px; }
.panel-action { margin-top: 20px; }
.panel-action .fine { margin: 10px 0 0; }
.trust-state { margin: 8px 0; font-weight: 700; }
.trust-state.ok { color: var(--green); }
.text-button { padding: 0; border: 0; background: none; color: var(--orange); }
.profile-grid, .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.profile-grid { margin-bottom: 65px; }
.profile-grid form { margin-top: 23px; }
.admin-access form { max-width: 520px; }
.admin-section { margin-bottom: 10px; }
.list { margin-top: 13px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.list-row small { display: block; color: var(--muted); font-size: 11px; }
.list-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.list-row button { padding: 5px 8px; border: 1px solid #667266; color: var(--text); background: #4b554b; font-size: 11px; }
.nick-editor { width: 100%; margin-top: 4px; padding: 14px 0 4px; border-top: 1px solid var(--border); }
.nick-editor p { margin: 0 0 10px; font-size: 12px; }
.nick-editor-fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
.nick-editor-fields label { margin: 0; }
.nick-editor .check { margin: 12px 0; }
.nick-editor-actions { display: flex; gap: 7px; }
.list-row .nick-editor button { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.list-row .nick-editor button[type=submit] { border-color: #ae7535; color: #291f12; background: var(--orange); font-weight: 700; }
.result-link, pre { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; font-size: 11px; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: min(400px, calc(100vw - 36px)); padding: 11px 15px; color: var(--text); background: #385038; border: 1px solid var(--green); z-index: 10; }
.toast.error { background: #583732; border-color: var(--red); }
.page-loading { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 20px; color: var(--text); background: rgba(36, 40, 36, .94); font-size: 15px; }
.page-loading.is-error { color: #ffd1c8; }
.page-loading.is-error .spinner { display: none; }
.spinner, .is-loading::before { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading::before { content: ''; width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .is-loading::before { animation-duration: 1.5s; } }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 58px; padding: 9px 16px; flex-wrap: wrap; gap: 9px; }
  .nav { order: 3; width: 100%; min-height: 36px; margin-left: 0; overflow: auto; }
  .nav a { padding: 0 9px; white-space: nowrap; }
  .top-actions { margin-left: auto; }
  .account { display: none; }
  .footer { padding: 15px 18px; flex-wrap: wrap; }
  .dashboard-summary, .game-layout, .profile-grid, .admin-grid { grid-template-columns: 1fr; }
  .nick-editor-fields { grid-template-columns: 1fr; }
  .start-screen, .login-screen { margin-top: 38px; }
  .mod-download { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 460px) {
  .start-actions, .dashboard-actions { flex-direction: column; }
  .server-card-line { align-items: flex-start; flex-direction: column; }
  .server-card-line .small-control { margin-left: 0; }
  .small-control { margin-left: 0; }
}
