:root {
  color-scheme: dark;
  --bg: #0b121a;
  --surface: #121e2b;
  --input: #0d1722;
  --border: #34475a;
  --ink: #f1f6fb;
  --muted: #b4c3d2;
  --accent: #a0ebde;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }
main { max-width: 1140px; margin: auto; padding: 0 28px 56px; }
a { color: var(--accent); }
p { margin: 0; color: var(--muted); }
h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.02em; }
.masthead { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 850; font-size: 1.25rem; letter-spacing: .015em; }
.masthead a { font-size: .88rem; text-underline-offset: 4px; }
.hero { position: relative; isolation: isolate; display: flex; align-items: end; overflow: hidden; min-height: 178px; padding: 22px 28px; background: #163044; border: 1px solid var(--border); border-radius: 14px; }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 54%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#091522fa 0%,#0b1a29d9 25%,#0b1a291f 73%); }
.hero h1 { font-size: clamp(2.15rem, 6vw, 3.5rem); line-height: 1; letter-spacing: -.05em; margin: 0 0 8px; }
.hero p { color: #dae7f1; }
.panel-nav { display: flex; gap: 24px; margin: 10px 0 20px; border-bottom: 1px solid var(--border); }
.panel-nav a { color: var(--muted); text-decoration: none; padding: 12px 2px; border-bottom: 2px solid transparent; font-weight: 650; }
.panel-nav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.overview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.card, fieldset { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; min-width: 0; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
#game-state { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px; border-radius: 20px; background: #263445; color: #e1ecf8; font-size: .9rem; }
#game-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
#game-state[data-state="online"] { background: #15392f; color: var(--accent); }
#game-state[data-state="unreachable"] { background: #483722; color: #ffdb9c; }
#checked, .detail p { font-size: .86rem; }
.detail { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; }
.detail > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.detail code, .detail output { display: block; margin-top: 2px; }
.detail + .detail { margin-top: 10px; border-top: 1px solid var(--border); }
.toolbar, .inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-actions { justify-content: end; }
button, input, select { min-height: 44px; font: inherit; color: var(--ink); background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; }
button { cursor: pointer; font-size: .9rem; font-weight: 650; }
button:enabled:hover { border-color: var(--accent); }
button:disabled { opacity: .56; cursor: not-allowed; }
.primary { background: var(--accent); color: #102823; border-color: var(--accent); }
.danger { color: #ffc1bd; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#notice, #confirm-owner { display: block; margin: 12px 0; color: var(--accent); }
#notice:empty { display: none; }
#settings-heading { font-size: 1.6rem; }
.settings-tools { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: end; gap: 10px; margin: 16px 0 10px; }
.search-field, .grid label { display: grid; gap: 5px; }
.search-field input, .grid input, .grid select { width: 100%; min-width: 0; }
fieldset { margin: 14px 0; }
legend { font-weight: 750; padding: 0 6px; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 20px; }
small { color: var(--muted); }
.settings-icon { width: 25px; height: 25px; margin-right: 9px; padding: 4px; vertical-align: middle; color: var(--accent); background: #15392f; border-radius: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.setting-range { display: block; margin-top: 3px; color: var(--accent); font-variant-numeric: tabular-nums; }
#world-settings > p + p { margin-top: 4px; }
.preview-note { font-size: .85rem; padding: 8px 0 0; }
@media (max-width: 680px) {
  main { padding: 0 15px 36px; }
  .masthead { min-height: 48px; }
  .hero { min-height: 120px; padding: 14px 17px; }
  .hero-image { object-position: 66% center; }
  .hero::after { background: linear-gradient(90deg,#091522f5 0%,#0b1a299e 50%,#0b1a291a 100%); }
  .overview, .grid { grid-template-columns: 1fr; }
  .overview { gap: 12px; }
  .card, fieldset { padding: 14px; }
  .settings-tools { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-field { grid-column: 1 / -1; }
}
