/* guildtracker — palette and component language lifted from stream.notek.se */

:root {
  --bg: #0b0d12; --panel: #12151d; --panel2: #171b25; --text: #e7ecf3;
  --muted: #8b96a7; --accent: #4f8cff; --accent-btn: #3b6fd4;
  --ok: #35d0a5; --bad: #ff5d5d; --warn: #f0b429;
  --border: #232936;
}

* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

html, body { margin: 0; min-height: 100%; }

body {
  background: radial-gradient(1200px 600px at 50% -10%, #14203a 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  padding: 8px 12px; border-radius: 8px; background: var(--panel2);
  color: var(--text); border: 1px solid var(--accent); text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------------------------------------------------------------- chrome */

header {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 18, .6);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px);
}
header h1 { font-size: 16px; margin: 0; letter-spacing: .3px; }
header h1 a { color: inherit; text-decoration: none; }
header h1 a:hover { color: var(--accent); text-decoration: none; }
header .sub { color: var(--muted); font-size: 13px; margin-right: auto; }
header nav { display: flex; gap: 10px; }
header nav a {
  color: var(--muted); font-size: 13px; text-decoration: none;
  padding: 8px 12px; border-radius: 6px;
}
header nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
header nav a.on { color: var(--text); font-weight: 600; background: var(--panel2); }

.livedot {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
}
.livedot i {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--muted); display: inline-block;
}
.livedot.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(53, 208, 165, .15); }

main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 12px; }
main.wide { max-width: 1240px; padding: 14px; }

footer {
  color: var(--muted); font-size: 12px; text-align: center;
  padding: 14px; border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.card h2 {
  font-size: 14px; margin: 0 0 12px; text-transform: uppercase;
  letter-spacing: .7px; color: var(--muted); font-weight: 600;
}
.card h2 .count {
  color: var(--muted); font-weight: 500; text-transform: none;
  letter-spacing: 0; margin-left: 4px;
}
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.warn { color: var(--warn); font-size: 13px; margin: 6px 0 0; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ---------------------------------------------------------------- stats */

.stat-grid {
  display: grid; gap: 12px; margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.stat .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
.stat .v { font-size: 19px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat .v.small { font-size: 15px; }
.stat .sub2 { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .6px; font-weight: 600; padding: 6px 8px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
th a { color: inherit; }
th a:hover { color: var(--text); text-decoration: none; }
td { padding: 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(23, 27, 37, .55); }
th.rowhead { text-transform: none; font-size: 13px; color: var(--muted); width: 200px; }

td.who {
  border-left: 3px solid var(--cc, var(--border));
  padding-left: 10px; white-space: nowrap;
}
td.who a { color: var(--cc, var(--text)); font-weight: 600; }
td.who a:hover { text-decoration: underline; }
td.who .cls { color: var(--muted); font-size: 12px; margin-left: 8px; }
.sur { font-weight: 400; opacity: .75; }
tr.gone td { opacity: .45; }

/* ---------------------------------------------------------------- feed */

.feed { list-style: none; margin: 0; padding: 0; }
.feed .ev {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 2px; border-top: 1px solid var(--border);
}
.feed .ev:first-child { border-top: 0; }
.feed .ev .k {
  flex: 0 0 auto; min-width: 86px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted);
}
.feed .ev .t { flex: 1 1 auto; min-width: 0; }
.feed .ev .t a { color: var(--text); }
.feed .ev .t a:hover { color: var(--accent); text-decoration: none; }
.feed .ev .t .d { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.feed .ev .meta { flex: 0 0 auto; color: var(--muted); font-size: 12.5px; }
.feed .ev.fresh { animation: flash 1.6s ease-out 1; }

@keyframes flash {
  from { background: rgba(79, 140, 255, .18); }
  to   { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .feed .ev.fresh { animation: none; }
}

/* ---------------------------------------------------------------- bits */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chips a {
  color: var(--muted); font-size: 12px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel2);
}
.chips a:hover { color: var(--text); text-decoration: none; }
.chips a.on { color: var(--text); border-color: var(--accent); }

.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
}
.badge.ok { background: var(--ok); color: #04231b; }
.badge.bad { background: var(--bad); color: #2a0707; }
.badge.off { background: var(--panel2); color: #aab4c4; border: 1px solid var(--border); }

.member-head { display: flex; gap: 16px; align-items: center; border-left: 3px solid var(--cc, var(--border)); }
.member-head .avatar { border-radius: 10px; border: 1px solid var(--border); display: block; }
.member-head .name { font-size: 20px; margin: 0; color: var(--cc, var(--text)); text-transform: none; letter-spacing: 0; }
.member-head .hint { margin-top: 4px; }
.hint.links { margin: 4px 0 12px; }
.member-head .hint.links { margin: 6px 0 0; }

/* ---------------------------------------------------------------- bars */

.bar-col { width: 22%; min-width: 110px; }
.bar {
  display: block; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--panel2); border: 1px solid var(--border);
}
.bar i { display: block; height: 100%; background: var(--cc, var(--accent)); opacity: .85; }

td.num { white-space: nowrap; text-align: right; font-weight: 600; width: 1%; }

.prof-grid {
  display: grid; gap: 0 16px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.prof-grid .card td.who { width: 45%; }
table.dist td { padding: 5px 8px; }

.digest {
  display: grid; gap: 4px 20px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.digest h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 600; margin: 10px 0 6px;
}
.digest ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.digest li { padding: 3px 0; }
.digest li a { color: var(--text); }
table.dist td.who { color: var(--cc, var(--text)); font-weight: 600; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
form.row input[type=search] { flex: 1 1 240px; min-width: 0; }

/* ---------------------------------------------------------------- gear */

table.gear td { vertical-align: middle; }
table.gear td.slot { white-space: nowrap; width: 110px; }
td.item a { display: inline-flex; align-items: center; gap: 8px; color: var(--q, var(--text)); font-weight: 600; }
td.item a:hover { text-decoration: none; filter: brightness(1.15); }
td.item img, td.item .noicon {
  width: 22px; height: 22px; border-radius: 4px; flex: 0 0 auto;
  border: 1px solid var(--q, var(--border));
}
td.item .noicon { display: inline-block; background: var(--panel2); }
td .d { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 1px; }
td.item .d { margin-left: 30px; }
.miss {
  color: var(--warn); font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- admin */

.card.narrow { max-width: 520px; }
.flash {
  border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; font-size: 13.5px;
  background: var(--panel2); border: 1px solid var(--border);
}
.flash.ok { border-color: var(--ok); }
.flash.bad { border-color: var(--bad); }
table.admin td { vertical-align: top; }
table.admin td.actions { white-space: nowrap; text-align: right; width: 1%; }
table.admin td.actions form { display: inline-block; }
table.admin details { display: inline-block; margin-left: 6px; text-align: left; }
table.admin details summary {
  cursor: pointer; color: var(--bad); font-size: 13px; padding: 6px 4px; list-style: none;
}
table.admin details summary::-webkit-details-marker { display: none; }
table.admin details[open] summary { margin-bottom: 6px; }
table.admin details input { width: 160px; }
form.row.add { margin-top: 14px; }
form.row.add input[name=name] { flex: 1 1 240px; min-width: 0; }
.checks {
  display: grid; gap: 6px 16px; margin: 0 0 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.checks label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.checks input { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.checks code { color: var(--muted); font-size: 11.5px; }
button.quiet { background: var(--panel2); border-color: var(--border); color: var(--text); font-weight: 500; }
a.button {
  display: inline-block; font-size: 14px; border-radius: 8px; padding: 9px 12px;
  background: var(--accent-btn); color: #fff; font-weight: 600;
}
a.button:hover { text-decoration: none; filter: brightness(1.1); }
.signout { justify-content: flex-end; }

.banner {
  background: var(--panel2); border: 1px solid var(--warn);
  border-radius: 10px; padding: 12px 14px; margin: 0 0 16px;
  color: var(--text); font-size: 13.5px;
}
.banner a { color: var(--warn); }

.tag {
  display: inline-block; margin-left: 8px; padding: 1px 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel2); color: var(--muted); vertical-align: middle;
}

.state { margin: 0 0 10px; font-size: 14.5px; color: var(--text); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

input, button {
  font: inherit; font-size: 14px; border-radius: 8px; padding: 9px 12px;
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
}
input:focus { outline: none; border-color: var(--accent); }
button { cursor: pointer; border-color: transparent; background: var(--accent-btn);
         color: #fff; font-weight: 600; }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad); font-weight: 500; }
button:hover { filter: brightness(1.1); }

@media (max-width: 640px) {
  header nav { flex-wrap: wrap; gap: 4px; }
  header nav a { padding: 6px 9px; }
  .prof-grid { grid-template-columns: 1fr; }
  .feed .ev { flex-wrap: wrap; }
  .feed .ev .k { min-width: 0; }
  header .sub { display: none; }
}

/* Day headings in grouped feeds */
.feed .day {
  margin: 14px 0 4px; padding: 0 0 4px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
}
.feed .day:first-child { margin-top: 0; }
.feed .day + .ev { border-top: 0; }
.feed .ev .meta time, td time { cursor: help; }

/* Event counts on activity chips */
.chips a .n { color: var(--muted); font-size: 11.5px; margin-left: 3px; }

/* Chips and a search box on one line */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.toolbar .chips { margin-bottom: 0; flex: 1 1 auto; }
.toolbar .find { flex: 0 1 220px; min-width: 0; margin-bottom: 12px; }

/* A skill at the cap of its rank */
.maxed { color: var(--ok); font-weight: 600; }

/* A heading between groups of cards */
h2.section { margin: 18px 0 10px; font-size: 15px; color: var(--muted); font-weight: 600; }

/* The collapsible data-sources card on member pages */
details.sources > summary { cursor: pointer; list-style: none; }
details.sources > summary::-webkit-details-marker { display: none; }
details.sources > summary h2 { display: inline-block; margin: 0; }
details.sources > summary h2::after { content: " +"; color: var(--muted); }
details.sources[open] > summary h2::after { content: " −"; }
details.sources[open] > summary { margin-bottom: 10px; }

/* Rank names form on the admin page */
form.ranks { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; margin-top: 8px; }
form.ranks label { color: var(--muted); font-size: 12.5px; text-align: right; }
form.ranks input { min-width: 0; }
form.ranks button { grid-column: 2; justify-self: start; }

/* Overview: this week and the latest activity side by side */
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 16px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* Overview: classes, levels and races in one card */
.makeup { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 24px; }
.makeup h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }

/* The footer's status link */
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }
