/* ---------------------------------------------------------------------------
   Chronos PSOBB.  Palette taken from the in-game name colours configured in
   tethealla.ini: global GM #1D94F7, local GM #B0CEDE, normal #FFFFFF.
   --------------------------------------------------------------------------- */

:root {
    --bg:          #070b14;
    --bg-grad:     radial-gradient(ellipse at 50% -20%, #12203c 0%, #070b14 60%);
    --panel:       #0e1626;
    --panel-2:     #131f33;
    --border:      #1e3050;
    --border-lit:  #2c4a78;
    --text:        #dbe6f5;
    --muted:       #7d90ad;
    --accent:      #1d94f7;
    --accent-dim:  #14618f;
    --accent-soft: #b0cede;
    --good:        #3ddc97;
    --warn:        #f5c451;
    --bad:         #ff6b6b;
    --radius:      4px;
    --mono:        ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text);
    font: 15px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

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

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* --- header --------------------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(7, 11, 20, .85);
    backdrop-filter: blur(6px);
    position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 58px; }

.brand {
    font-size: 19px; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: #fff; white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand span { color: var(--accent); }

.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
    padding: 6px 11px; border-radius: var(--radius); color: var(--muted);
    font-size: 14px; white-space: nowrap;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.on { color: var(--accent); background: var(--panel-2); }

.badge-count {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px;
    background: var(--accent); color: #04101d; border-radius: 9px;
    font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}

/* --- panels --------------------------------------------------------------- */

main { padding: 32px 0 64px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 20px;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }

h1 { font-size: 27px; margin: 0 0 6px; letter-spacing: .01em; }
h2 { font-size: 19px; margin: 28px 0 12px; }
h3 { font-size: 15px; margin: 20px 0 8px; text-transform: uppercase;
     letter-spacing: .1em; color: var(--accent-soft); }

.lead { color: var(--muted); margin: 0 0 24px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* --- stat tiles ----------------------------------------------------------- */

.tile {
    background: var(--panel-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
}
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tile .v { font-size: 23px; font-weight: 600; font-family: var(--mono); margin-top: 3px; }
.tile .v.small { font-size: 16px; }

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

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th {
    font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
    color: var(--muted); font-weight: 600; white-space: nowrap;
}
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* --- forms ---------------------------------------------------------------- */

label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--accent-soft); }
.field { margin-bottom: 16px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; white-space: pre-line; }

input[type=text], input[type=password], input[type=email], input[type=number],
select, textarea {
    width: 100%; padding: 9px 11px;
    background: #08111f; color: var(--text);
    border: 1px solid var(--border-lit); border-radius: var(--radius);
    font: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(29,148,247,.18);
}
textarea { resize: vertical; min-height: 120px; font-family: inherit; }

.btn {
    display: inline-block; padding: 9px 18px; border: 1px solid var(--accent-dim);
    background: linear-gradient(180deg, #1a5f92, #124467);
    color: #fff; border-radius: var(--radius); cursor: pointer;
    font: inherit; font-weight: 600;
}
.btn:hover { background: linear-gradient(180deg, #2277b4, #16537d); text-decoration: none; }
.btn.secondary { background: var(--panel-2); border-color: var(--border-lit); color: var(--text); }
.btn.secondary:hover { background: #1a2942; }
.btn.danger { background: linear-gradient(180deg, #8f2c2c, #6a1f1f); border-color: #a33; }
.btn.danger:hover { background: linear-gradient(180deg, #a83636, #7d2525); }
.btn.small { padding: 4px 10px; font-size: 12.5px; font-weight: 500; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
form.inline { display: inline; }

/* --- notices -------------------------------------------------------------- */

.notice {
    padding: 11px 15px; border-radius: var(--radius); margin-bottom: 16px;
    border: 1px solid; border-left-width: 3px; font-size: 14px;
}
.notice.success { background: rgba(61,220,151,.09); border-color: rgba(61,220,151,.4); color: #a8f0cf; }
.notice.error   { background: rgba(255,107,107,.09); border-color: rgba(255,107,107,.4); color: #ffb3b3; }
.notice.info    { background: rgba(29,148,247,.09);  border-color: rgba(29,148,247,.4);  color: #a9d6ff; }
.notice.warn    { background: rgba(245,196,81,.09);  border-color: rgba(245,196,81,.4);  color: #f7dd9f; }
.notice p:last-child { margin-bottom: 0; }
.notice p:first-child { margin-top: 0; }

/* --- status pills --------------------------------------------------------- */

.pill {
    display: inline-block; padding: 2px 9px; border-radius: 10px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
    border: 1px solid;
}
.pill.up      { color: var(--good); border-color: rgba(61,220,151,.45);  background: rgba(61,220,151,.1); }
.pill.down    { color: var(--bad);  border-color: rgba(255,107,107,.45); background: rgba(255,107,107,.1); }
.pill.neutral { color: var(--muted); border-color: var(--border-lit); }
.pill.warn    { color: var(--warn); border-color: rgba(245,196,81,.45); background: rgba(245,196,81,.1); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot.on  { background: var(--good); box-shadow: 0 0 6px var(--good); }
.dot.off { background: #394b66; }

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

.char-card {
    display: block; background: var(--panel-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px; color: inherit;
}
a.char-card:hover { border-color: var(--border-lit); text-decoration: none; background: #17263e; }
.char-card .name { font-size: 18px; font-weight: 600; color: #fff; }
.char-card .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.char-card.empty { border-style: dashed; color: var(--muted); text-align: center; }

.slot-label {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
    color: var(--muted); margin-bottom: 6px;
}

/* Section ID colour hints, matching the in-game ID colours. */
.sid { border-left: 3px solid var(--border-lit); padding-left: 9px; }
.sid-0 { border-left-color: #4caf50; } .sid-1 { border-left-color: #8bc34a; }
.sid-2 { border-left-color: #29b6f6; } .sid-3 { border-left-color: #3f51b5; }
.sid-4 { border-left-color: #9c27b0; } .sid-5 { border-left-color: #ec8fc4; }
.sid-6 { border-left-color: #e53935; } .sid-7 { border-left-color: #ff9800; }
.sid-8 { border-left-color: #fdd835; } .sid-9 { border-left-color: #eceff1; }

/* --- item lists ----------------------------------------------------------- */

.items { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.items li {
    padding: 5px 9px; border-bottom: 1px solid rgba(30,48,80,.55);
    display: flex; justify-content: space-between; gap: 12px;
}
.items li:last-child { border-bottom: none; }
.items .eq { color: var(--good); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.items .pct { color: var(--accent-soft); font-family: var(--mono); font-size: 12.5px; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 20px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* --- misc ----------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border); padding: 22px 0; margin-top: 40px;
    color: var(--muted); font-size: 13px;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

pre {
    background: #08111f; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 13px;
}
code { font-family: var(--mono); font-size: .92em; background: #08111f; padding: 1px 5px; border-radius: 3px; }
pre code { background: none; padding: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 8px 15px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 640px) {
    .site-header .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
    .nav { order: 3; width: 100%; }
    h1 { font-size: 22px; }
}
