/* Interbellum 1936 — Art Deco newsprint theme */
:root {
  --bg: #efe6d2; --bg2: #e6dbc2; --panel: #f8f2e3; --panel2: #f1e8d4; --line: #cdbf9f; --line2: #b9a983;
  --ink: #1f1b16; --sub: #6b604c; --acc: #8c2f1b; --acc2: #b08a3e; --navy: #1f3a5f; --good: #2f6b3a; --bad: #a3271b; --warn: #a86a12;
  --chip: #e9dfc8; --shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 18px rgba(60,40,10,.08); --sea: #b9c9c4; --land: #e4d6b4;
  --r: 6px; --head: 'Playfair Display', Georgia, serif; --body: 'Inter', system-ui, sans-serif; --type: 'Special Elite', 'Courier New', monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #13110e; --bg2: #191612; --panel: #1f1b16; --panel2: #262119; --line: #3a3226; --line2: #4c4232; --ink: #ede3cd; --sub: #a69a82;
  --acc: #d0674a; --acc2: #d4a84f; --navy: #7aa2d6; --good: #6fbf7c; --bad: #e0705f; --warn: #e2a64a; --chip: #2a241c; --shadow: 0 6px 20px rgba(0,0,0,.35);
  --sea: #1d2a2c; --land: #3a3324; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #13110e; --bg2: #191612; --panel: #1f1b16; --panel2: #262119; --line: #3a3226; --line2: #4c4232; --ink: #ede3cd; --sub: #a69a82;
  --acc: #d0674a; --acc2: #d4a84f; --navy: #7aa2d6; --good: #6fbf7c; --bad: #e0705f; --warn: #e2a64a; --chip: #2a241c; --shadow: 0 6px 20px rgba(0,0,0,.35);
  --sea: #1d2a2c; --land: #3a3324; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
body { background-image: radial-gradient(rgba(120,90,40,.05) 1px, transparent 1px); background-size: 4px 4px; }
a { color: var(--acc); }
h1, h2, h3, h4 { font-family: var(--head); margin: 0 0 8px; letter-spacing: .2px; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
i[data-lucide], svg.lucide { width: 16px; height: 16px; stroke-width: 2; vertical-align: -3px; flex: none; }
.sub { color: var(--sub); font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.hidden { display: none !important; }
.up { color: var(--good); } .down { color: var(--bad); }
.wordmark { font-family: var(--head); font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.wordmark b { color: var(--acc); }
.deco { height: 6px; background: repeating-linear-gradient(90deg, var(--acc2) 0 18px, transparent 18px 24px); opacity: .6; border-radius: 2px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font: 600 13px var(--body); cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--acc2); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #fff8ec; }
.btn.red { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; position: relative; }
input, select, textarea { font: 14px var(--body); color: var(--ink); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 8px 10px; width: 100%; }
input[type=range] { padding: 0; accent-color: var(--acc); border: none; background: none; }
input[type=checkbox] { width: auto; accent-color: var(--acc); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--acc2); outline-offset: 1px; }
label { font-weight: 600; font-size: 13px; }
.field { margin-bottom: 14px; } .field label { display: block; margin-bottom: 4px; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel2); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 12px; }
.logo { width: 34px; height: 34px; border-radius: 4px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--head); font-weight: 700; border: 2px double var(--acc2); }
.nav { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); border: none; background: none; color: var(--ink); font: 500 13.5px var(--body); cursor: pointer; text-align: left; width: 100%; }
.nav:hover { background: var(--chip); } .nav.on { background: var(--ink); color: var(--bg); }
.nav .dot { margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px; background: var(--acc); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
.side .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.menuBtn { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); font-size: 12.5px; white-space: nowrap; }
.chip.ok { color: var(--good); } .chip.off { color: var(--bad); }
.search { position: relative; display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); padding: 0 10px; min-width: 220px; }
.search input { border: none; background: none; padding: 7px 0; }
.sres { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); max-height: 320px; overflow: auto; z-index: 40; }
.sres button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 10px; border: none; background: none; color: var(--ink); cursor: pointer; text-align: left; }
.sres button:hover { background: var(--chip); }
#pg { padding: 18px; } .page { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r); background: color-mix(in srgb, var(--acc2) 18%, var(--panel)); border: 1px solid var(--acc2); }
.banner.info { background: color-mix(in srgb, var(--navy) 10%, var(--panel)); border-color: color-mix(in srgb, var(--navy) 40%, transparent); }

/* cards & grids */
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; position: relative; }
.card > h3:first-child { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.card.stat small { display: flex; align-items: center; gap: 6px; color: var(--sub); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.card.stat b { display: block; font: 700 24px var(--head); margin: 4px 0 2px; }
.card.stat em { font-style: normal; color: var(--sub); font-size: 12px; }
.item { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--chip); border: 1px solid var(--line); white-space: nowrap; }
.tag.g { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); } .tag.r { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.tag.y { color: var(--warn); } .tag.b { color: var(--navy); } .tag.a { color: var(--acc); border-color: var(--acc2); }
.bar { height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; margin-top: 6px; } .bar i { display: block; height: 100%; background: var(--acc2); border-radius: 3px; transition: width .6s; }
table { width: 100%; border-collapse: collapse; font-size: 13px; } th { text-align: left; font-weight: 600; color: var(--sub); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
th, td { padding: 8px 8px; border-bottom: 1px solid var(--line); } tr.click { cursor: pointer; } tr.click:hover td { background: var(--chip); }
.scroll { overflow: auto; } canvas.chart { width: 100%; height: 220px; display: block; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 12px; color: var(--sub); text-align: center; }
.empty svg { width: 28px; height: 28px; opacity: .6; }
.skel { height: 80px; border-radius: var(--r); background: linear-gradient(90deg, var(--panel2), var(--chip), var(--panel2)); background-size: 200% 100%; animation: sk 1.2s infinite; } @keyframes sk { to { background-position: -200% 0; } }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; } .tabs button { padding: 7px 12px; border: 1px solid var(--line2); background: var(--panel); border-radius: var(--r); color: var(--ink); cursor: pointer; font: 600 12.5px var(--body); } .tabs button.on { background: var(--ink); color: var(--bg); }
.flag { display: inline-block; width: 1.5em; height: 1em; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); overflow: hidden; flex: none; }
.flag svg { width: 100%; height: 100%; display: block; }
.hero { display: flex; gap: 18px; align-items: flex-start; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 4px; background: repeating-linear-gradient(90deg, var(--acc) 0 30px, var(--acc2) 30px 36px); }
.hero .bigflag { width: 96px; height: 64px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); overflow: hidden; flex: none; }
.hero h1 { font-size: 30px; margin: 0; }
.seats { display: flex; flex-wrap: wrap; gap: 3px; } .seats i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.post { border-bottom: 1px solid var(--line); padding: 10px 0; } .post .who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: 13px; } .post p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.newsp { font-family: var(--head); } .newsp h2 { font-size: 22px; } .newsp .col { columns: 2 260px; column-gap: 22px; column-rule: 1px solid var(--line); }

/* modal & toasts */
#modal { position: fixed; inset: 0; background: rgba(20,15,8,.55); display: grid; place-items: center; z-index: 100; padding: 16px; }
#modal .m { background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#modal .m > h2 { display: flex; gap: 8px; align-items: center; } #modal .body { margin: 10px 0 14px; } #macts { justify-content: flex-end; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line2); border-left: 4px solid var(--good); border-radius: var(--r); box-shadow: var(--shadow); font-size: 13px; }
.toast.err { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--warn); }
#busybar { position: fixed; left: 50%; top: 12px; transform: translate(-50%, -80px); transition: .25s; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; display: flex; gap: 8px; align-items: center; z-index: 150; font-size: 13px; }
#busybar.on { transform: translate(-50%, 0); } #busybar .sub { color: var(--line2); }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.notif { position: absolute; right: 0; top: 40px; width: min(360px, 90vw); max-height: 420px; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); z-index: 50; }
.notif div.n { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; } .notif div.n.unread { background: color-mix(in srgb, var(--acc2) 12%, var(--panel)); }
.badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--acc); color: #fff; font-size: 10.5px; display: grid; place-items: center; }

/* gate & start */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.gatebox { width: min(470px, 100%); background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; padding: 28px; box-shadow: var(--shadow); text-align: center; position: relative; }
.gatebox h1 { font-size: 34px; margin: 10px 0 2px; } .gatebox .stack { margin-top: 18px; text-align: left; }
.poster { font-family: var(--head); font-style: italic; color: var(--sub); }
.start { min-height: 100vh; display: flex; flex-direction: column; }
.stbar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel2); flex-wrap: wrap; }
.stgrid { flex: 1; display: grid; grid-template-columns: 1fr 420px; min-height: 0; }
.stglobe { position: relative; min-height: 420px; background: radial-gradient(circle at 50% 45%, #2a2a33 0%, #0e0d10 70%); }
.stpanel { padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow: auto; max-height: calc(100vh - 60px); }
.stlist { display: flex; flex-direction: column; max-height: 46vh; overflow: auto; }
.stlist button { display: flex; gap: 10px; align-items: center; padding: 8px; border: none; border-bottom: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; text-align: left; }
.stlist button:hover, .stlist button.on { background: var(--chip); }
.globe-tip { position: absolute; pointer-events: none; padding: 4px 8px; background: rgba(0,0,0,.75); color: #fff; border-radius: 4px; font-size: 12px; transform: translate(10px, 10px); white-space: nowrap; }

/* map */
#map { height: calc(100vh - 210px); min-height: 420px; border-radius: var(--r); border: 1px solid var(--line); background: var(--sea); }
.leaflet-container { font-family: var(--body); background: var(--sea); }
.leaflet-tooltip { font-family: var(--body); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; } .legend i { width: 14px; height: 10px; display: inline-block; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.fullscreen3d { position: fixed; inset: 0; z-index: 90; background: #0b0a09; }
.fullscreen3d .hud { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; pointer-events: none; }
.fullscreen3d .hud > * { pointer-events: auto; }
.hudcard { background: rgba(20,17,13,.82); color: #efe5cf; border: 1px solid rgba(212,168,79,.45); border-radius: 6px; padding: 8px 12px; font-size: 13px; backdrop-filter: blur(4px); }
.hudcard .btn { background: rgba(255,255,255,.06); color: #efe5cf; border-color: rgba(212,168,79,.5); }
.hudcard .btn.pri { background: #8c2f1b; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stgrid { grid-template-columns: 1fr; } .stglobe { min-height: 46vh; } .stpanel { max-height: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .side { position: fixed; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: .2s; box-shadow: var(--shadow); } .side.open { transform: none; }
  .menuBtn { display: inline-grid; } .g2, .g3 { grid-template-columns: 1fr; } .search { min-width: 0; flex: 1; } #pg { padding: 16px; } .hero { flex-direction: column; } .chip.hm { display: none; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .card.stat b { font-size: 19px; } .top { padding: 8px 12px; } }
