/* the staff panel, in the game's colours: navy, the panels' blue, light blue borders, the pixel font for headings */
@font-face { font-family: 'Silkscreen'; font-weight: 400; src: url(../fonts/Silkscreen-Regular.woff2) format('woff2'); }
@font-face { font-family: 'Silkscreen'; font-weight: 700; src: url(../fonts/Silkscreen-Bold.woff2) format('woff2'); }
:root {
  --navy: #1a284a; --deep: #0c1830; --panel: #133a5e; --panel2: #0f2f4e; --line: #2c5f8a; --edge: #8fdcff;
  --text: #e8f4ff; --muted: #9dbbd6; --gold: #ffd23f; --orange: #f2a81d; --red: #e0606f; --green: #4fc46a; --purple: #c79bff;
  --pixel: 'Silkscreen', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--deep); color: var(--text); font: 14px/1.45 system-ui, 'Segoe UI', sans-serif; }
[hidden] { display: none !important; }
a { color: var(--edge); }
h1, h2, h3 { font-family: var(--pixel); font-weight: 700; letter-spacing: 1px; margin: 0 0 12px; }
h1 { font-size: 22px; color: var(--gold); }
h2 { font-size: 18px; color: var(--edge); }
h3 { font-size: 14px; color: var(--muted); }
button {
  font: inherit; font-weight: 700; color: #fff; cursor: pointer; padding: 7px 14px; border-radius: 9px;
  background: linear-gradient(#4aa3dc, #2f7fb8); border: 2px solid #0c3858; border-bottom-width: 4px;
}
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; filter: none; }
button.primary { background: linear-gradient(#ffc24a, var(--orange)); border-color: #a86a08; }
button.danger { background: linear-gradient(#ec7482, #b23a4a); border-color: #5e222c; }
button.ghost { background: transparent; border: 2px solid var(--line); }
button.small { padding: 3px 9px; font-size: 12px; border-bottom-width: 3px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel2); border: 2px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--muted); }
.box { background: linear-gradient(var(--panel), var(--panel2)); border: 2px solid var(--line); border-radius: 14px; padding: 18px; }
.err { color: #ffb3b3; font-weight: 700; min-height: 1.2em; margin: 0; }
.muted { color: var(--muted); }
.logo { width: 260px; max-width: 80%; image-rendering: pixelated; }
.logo.small { width: 130px; }

/* logging in */
.loginpage { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 30%, #24609a, var(--deep) 70%); }
.loginbox { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; border-color: var(--edge); }
.loginbox .logo { align-self: center; }
.loginbox label { text-align: left; }

/* the page: a bar with the tabs on top, the chosen tab under it */
header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 18px; flex-wrap: wrap;
  background: var(--navy); border-bottom: 3px solid var(--edge);
}
#tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
#tabs button { background: transparent; border: 2px solid transparent; font-family: var(--pixel); font-size: 12px; letter-spacing: .5px; }
#tabs button.on { background: var(--panel); border-color: var(--edge); }
#tabs .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--red); font-family: system-ui; font-size: 11px; }
.me { display: flex; align-items: center; gap: 10px; }
.rankbadge { font-family: var(--pixel); font-size: 11px; padding: 2px 8px; border-radius: 8px; background: #3b2463; color: var(--purple); border: 1px solid var(--purple); }
main { padding: 18px; max-width: 1300px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat { background: linear-gradient(var(--panel), var(--panel2)); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--pixel); font-size: 20px; color: var(--gold); margin-top: 4px; }
.stat.bad b { color: var(--red); } .stat.good b { color: var(--green); }
.two { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

/* tables */
.tablewrap { overflow-x: auto; border-radius: 12px; border: 2px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--panel2); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #1f4a70; vertical-align: top; }
th { background: var(--navy); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; position: sticky; top: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #17436b; }
td.wrap { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 7px; font-size: 11px; font-weight: 800; background: #24507a; }
.tag.red { background: #6b2430; color: #ffc2c8; } .tag.green { background: #1f5a33; color: #b9f5c7; } .tag.gold { background: #6a5214; color: #ffe9a8; }
.tag.purple { background: #3b2463; color: var(--purple); }
.mono { font-family: Consolas, monospace; font-size: 13px; }

/* a player's page */
.playerhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.playerhead h2 { margin: 0; font-size: 22px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.facts div { display: flex; flex-direction: column; } .facts small { color: var(--muted); }
.actions { display: flex; flex-direction: column; gap: 10px; }
.actions .box { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.empty { color: var(--muted); padding: 14px; text-align: center; }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 10px 18px; border-radius: 10px;
  background: var(--navy); border: 2px solid var(--edge); font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
#toast.bad { border-color: var(--red); }
