/* Core Keeper dashboard.
   Structure and class names deliberately mirror the Valheim and Project Zomboid dashboards so the
   sites feel like siblings; only the palette changes. Valheim is Norse gold on blue-black. This is
   the Core: its cyan glow in the dark of the caves, with the family's amber eye for food. */
:root {
  color-scheme: dark;
  --bg: #0b1016;
  --panel: #121a22;
  --panel-2: #18232d;
  --line: #27363f;
  --text: #dbe6ea;
  --muted: #8ba0ab;
  --accent: #5ecbe0;
  --amber: #e6a53c;
  --green: #62b47c;
  --red: #d0564c;
  --blue: #5f8fe0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #14222c 0%, var(--bg) 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}
button { font: inherit; }
button:focus-visible, .skills-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 22, 0.8); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rune { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px solid var(--accent);
  background: radial-gradient(circle, var(--amber) 0 28%, transparent 32%); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-name { font-size: 20px; font-weight: 600; }
.brand-hint { font-size: 12px; color: var(--muted); }
.hint-label { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.pill-online { background: rgba(98,180,124,.15); color: var(--green); border-color: rgba(98,180,124,.4); }
.pill-offline { background: rgba(208,86,76,.15); color: var(--red); border-color: rgba(208,86,76,.4); }
.pill-unknown { background: var(--panel-2); color: var(--muted); }
.count { color: var(--muted); font-size: 14px; }
.updated { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .updated { display: none; } }

.brandmark { display: flex; justify-content: center; padding: 2px 0 0; }
.brandmark-logo { height: 170px; width: auto; display: block; max-width: 100%;
  filter: drop-shadow(0 0 18px rgba(94,203,224,.14)) drop-shadow(0 4px 12px rgba(0,0,0,.5)); }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; display: grid; gap: 16px; }
main > * { min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: .02em;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.subtle { color: var(--muted); font-size: 12px; font-weight: 400; }
.muted { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col > * { min-width: 0; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* a name you can point at, or tap, for skill levels */
.skills-tip { position: relative; font-weight: 600; cursor: help; border-bottom: 1px dotted var(--muted); justify-self: start; }
.tip-box { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 4;
  width: min(290px, 74vw); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-weight: 400; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.skills-tip:hover .tip-box, .skills-tip:focus .tip-box { display: block; }
.tip-grid { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 2px 10px; font-size: 13px; }
.tip-grid b { color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; }
.tip-grid .zero { color: var(--muted); }
.tip-grid .zero + b { color: var(--muted); font-weight: 400; }

/* who's online */
.online-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.online-list li.who { display: grid; grid-template-columns: auto auto 1fr auto; gap: 4px 10px; align-items: center; }
.who-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(98,180,124,.7); }
.who-biome { color: var(--muted); font-size: 13px; }
.who-meta { color: var(--muted); font-size: 13px; grid-column: 4; }
.vitals { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; }
.vital { display: grid; grid-template-columns: 44px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 7px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; }
.bar .hp { background: var(--red); }
.bar .fd { background: var(--amber); }
.bar .mp { background: var(--blue); }
@media (max-width: 480px) {
  .online-list li.who { grid-template-columns: auto 1fr auto; }
  .who-biome { grid-column: 2 / -1; grid-row: 2; }
  .who-meta { grid-column: 3; grid-row: 1; }
  .vitals { grid-column: 1 / -1; }
}

/* boss progression: undiscovered, found and beaten, as on Valheim */
.boss-list { list-style: none; margin: 0; padding: 0; }
.boss-list li.boss { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.boss-list li.boss:last-child { border-bottom: none; }
.boss-trophy { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 8px; font-size: 22px; }
/* the game's trophies are 16px pixel art, so they scale by a whole number and stay sharp */
.boss-trophy img { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.boss.done .boss-trophy { background: rgba(94,203,224,.14); box-shadow: 0 0 8px rgba(94,203,224,.35); }
.boss.pending .boss-trophy { background: var(--panel-2); }
.boss.pending .boss-trophy img { filter: grayscale(1) brightness(.75); opacity: .6; }
.boss.undiscovered .boss-trophy { border: 1px dashed var(--line); color: var(--muted); }
.boss-info { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.boss-name { font-weight: 600; }
.boss-biome { color: var(--muted); font-size: 13px; }
.boss-state { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.boss.done .boss-state { color: var(--accent); font-weight: 600; }
.boss.undiscovered .boss-name { color: var(--muted); font-weight: 500; }

/* playtime */
.playtime-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: pt; }
.pt-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; counter-increment: pt; }
.pt-row::before { content: counter(pt); color: var(--muted); font-size: 12px; min-width: 12px; }
.pt-on { border-color: var(--accent); }
.pt-deaths { margin-left: auto; color: var(--red); font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-hours { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-unit { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.pt-meta { flex-basis: 100%; color: var(--muted); font-size: 12px; }

/* in memoriam */
.deaths-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 460px; overflow-y: auto; }
.deaths-list li.death { border-left: 2px solid var(--red); padding: 2px 0 2px 12px; }
.d-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.d-name { font-weight: 600; }
.d-when { color: var(--muted); font-size: 12px; margin-left: auto; }
.d-cause { opacity: .9; font-size: 14px; }
.d-where { color: var(--muted); font-size: 12px; }

/* kills */
.kill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.sheet { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.sheet-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sheet-name { font-weight: 600; }
.big { font-size: 24px; font-weight: 700; color: var(--accent); margin-left: auto; font-variant-numeric: tabular-nums; }
.kill-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }

/* world stats */
.lens-tabs { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lens-tab { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; cursor: pointer; }
.lens-tab[aria-selected="true"] { color: var(--accent); border-color: var(--accent); background: rgba(94,203,224,.12); }
.build-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stat-num { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.person-table { border-collapse: collapse; font-size: 14px; width: 100%; min-width: 480px; }
.person-table th, .person-table td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.person-table th:first-child, .person-table td:first-child { text-align: left; }
.person-table th { color: var(--muted); font-weight: 600; font-size: 12px; }

/* footer and release notes, the same structure as the sibling dashboards */
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 26px; }
.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.version-btn { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.version-btn:hover { color: var(--accent); border-color: var(--accent); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; max-width: 640px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.changelog-body { padding: 16px 18px; overflow-y: auto; }
.cl-entry { margin-bottom: 18px; }
.cl-ver { font-weight: 700; color: var(--accent); }
.cl-date { color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 400; }
.cl-title { font-weight: 600; margin: 2px 0 6px; }
.cl-entry ul { margin: 0; padding-left: 18px; }
.cl-entry li { margin-bottom: 4px; }
