:root {
  --bg: #15121a;
  --panel: #1f1a26;
  --panel-2: #2a2333;
  --line: #3a3145;
  --text: #ece4d6;
  --muted: #9c90a8;
  --gold: #e0b45c;
  --c: #4fc07a;   /* booked */
  --a: #2f7d55;   /* available */
  --ai: #3fa3a0;  /* available, can host */
  --u: #d8a23a;   /* unclear */
  --o: #9a5c6e;   /* other */
  --w: #d1534b;   /* work */
  --v: #7a68d4;   /* vacation */
  --x: #3b3444;   /* not filled */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: radial-gradient(ellipse at top, #241d2d 0%, var(--bg) 60%) fixed;
  color: var(--text); font: 15px/1.45 var(--sans);
}
header { padding: 28px 24px 0; max-width: 1100px; margin: 0 auto; }
h1 { font: 600 34px/1.1 var(--serif); margin: 0; letter-spacing: .01em; }
h1::before { content: "⚔ "; color: var(--gold); }
h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 8px 24px 48px; }
.campaigns { color: var(--muted); margin: 4px 0 20px; font-style: italic; }
.loading, .muted { color: var(--muted); }
.error { padding: 24px; background: var(--panel); border-radius: 12px; }

.top { align-items: start; display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 760px) { .top { grid-template-columns: 1fr; } }
.hero, .panel, .drawer { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.hero { border-color: #5a4630; background: linear-gradient(160deg, #2b2230, var(--panel)); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; }
.hero h2 { font-size: 32px; margin: 6px 0 2px; }
.when { color: var(--muted); margin-bottom: 14px; }
.verdict { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--panel-2); font-weight: 600; margin: 0 0 14px; }
.verdict.good { background: color-mix(in srgb, var(--c) 25%, transparent); color: #a8f0c2; }
.verdict.close { background: color-mix(in srgb, var(--u) 22%, transparent); color: #f3d08b; }
.verdict.bad { background: color-mix(in srgb, var(--w) 22%, transparent); color: #f4a9a3; }

.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chip { padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border-left: 4px solid var(--x); }
.chip b { display: block; }
.chip span { color: var(--muted); font-size: 13px; }
.chip.s-c { border-color: var(--c); } .chip.s-a { border-color: var(--a); } .chip.s-ai { border-color: var(--ai); }
.chip.s-u { border-color: var(--u); } .chip.s-o { border-color: var(--o); } .chip.s-w { border-color: var(--w); }
.chip.s-v { border-color: var(--v); }
.chip.tent { border-left-style: dashed; }

.side { display: grid; gap: 16px; align-content: start; }
.panel h3 { font-size: 18px; margin-bottom: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.list .date { color: var(--muted); min-width: 92px; font-variant-numeric: tabular-nums; }
.list .what { flex: 1; }
.list .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.list .count.good { color: var(--c); }
.list.free { display: flex; flex-wrap: wrap; gap: 6px; }
.list.free li { margin: 0; background: color-mix(in srgb, var(--c) 18%, transparent); }
.list.free .date { color: #a8f0c2; min-width: 0; }
.clickable { cursor: pointer; }
.list li.clickable:hover { background: var(--panel-2); }

.calendar { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.week { display: grid; grid-template-columns: 38px repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.week.head div { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 0 6px; }
.wk { color: var(--muted); font-size: 11px; align-self: center; text-align: right; padding-right: 4px; }
.day {
  min-height: 72px; border-radius: 9px; background: var(--panel-2); padding: 6px 7px;
  display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; position: relative;
}
.day.empty { background: transparent; border: 1px dashed var(--line); }
.day.clickable:hover { border-color: var(--muted); }
.day.past { opacity: .38; }
.day.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.day.allok { background: color-mix(in srgb, var(--c) 16%, var(--panel-2)); }
.day.planned { background: linear-gradient(160deg, #4a3826, var(--panel-2)); }
.day.planned.allok { background: linear-gradient(160deg, #3d5a33, #2b3b2c); }
.num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.day.today .num { color: var(--gold); font-weight: 700; }
.note { font: 600 13px/1.2 var(--serif); color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots { margin-top: auto; display: flex; gap: 3px; flex-wrap: wrap; }
.dots i, .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.s-c { background: var(--c); } .s-a { background: var(--a); } .s-ai { background: var(--ai); }
.s-u { background: var(--u); } .s-o { background: var(--o); } .s-w { background: var(--w); }
.s-v { background: var(--v); } .s-x { background: var(--x); }
i.tent { opacity: .45; }
.chip.s-c, .chip.s-a, .chip.s-ai, .chip.s-u, .chip.s-o, .chip.s-w, .chip.s-v, .chip.s-x { background: var(--panel-2); }
@media (max-width: 600px) {
  .week { grid-template-columns: 24px repeat(7, 1fr); gap: 3px; }
  .day { min-height: 54px; padding: 4px; }
  .note { display: none; }
  .dots i { width: 6px; height: 6px; }
}
.more {
  display: block; margin: 10px auto 2px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; cursor: pointer; font: inherit;
}
.more:hover { border-color: var(--gold); }

.players { margin-top: 20px; }
.players h3 { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.players ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); }
.players b { color: var(--text); font-weight: 600; }
.players .stale b::after { content: " ⚠"; color: var(--u); }
.legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.legend i { margin-right: 6px; vertical-align: -1px; }
.updated { color: var(--muted); font-size: 12px; margin-top: 14px; }

#detail:empty { display: none; }
#detail { position: fixed; inset: auto 16px 16px auto; width: min(420px, calc(100vw - 32px)); z-index: 10; }
.drawer { box-shadow: 0 20px 60px #000a; border-color: #5a4630; }
.drawer h3 { font-size: 22px; margin: 4px 0 8px; }
.drawer .notes { font: 600 17px/1.35 var(--serif); color: var(--gold); margin: 0 0 10px; }
.dismiss { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; }
.drawer { position: relative; }
