/* XTREE web surface — shared styling for the player page and the admin panel.
   The palette matches the game lobby (near-black panels, amber highlight), so
   the site and the game read as one product. */

:root {
  --bg: #05090b;
  --panel: #0d1619;
  --panel-2: #101d21;
  --edge: rgba(255, 255, 255, 0.10);
  --edge-strong: rgba(255, 255, 255, 0.20);
  --paper: #f2f5ef;
  --muted: #a6b4b6;
  --faint: #718084;
  --amber: #d9f477;
  --amber-soft: #ecffac;
  --amber-ink: #1b2109;
  --rust: #ff6b4a;
  --cyan: #36dcff;
  --ok: #78e2a0;
  --radius: 12px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 500px at 12% -10%, rgba(217, 244, 119, 0.10), transparent 65%),
    radial-gradient(800px 480px at 92% 4%, rgba(54, 220, 255, 0.08), transparent 60%);
  background-repeat: no-repeat;
}

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

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; font-weight: 700; }

/* --- layout --------------------------------------------------------------- */

.shell { max-width: 1080px; margin: 0 auto; padding: 28px 22px 64px; }
.shell.wide { max-width: 1360px; }

.brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 26px;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(160deg, var(--amber), #8fae35);
  color: var(--amber-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px;
}
.brand-name { font-weight: 800; letter-spacing: 0.28em; font-size: 13px; }
.brand-sub { color: var(--faint); font-size: 12px; letter-spacing: 0.12em; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.side { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; }

@media (max-width: 900px) {
  .grid.two, .grid.three, .grid.side { grid-template-columns: 1fr; }
}

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

.card {
  background: linear-gradient(180deg, var(--panel), #0a1215);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 22px;
}
.card.tight { padding: 16px; }
.card h2 { font-size: 16px; letter-spacing: 0.10em; text-transform: uppercase; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.section-label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 10px;
}

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

label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 6px;
}

input[type=text], input[type=email], input[type=password], input[type=search] {
  width: 100%; padding: 12px 13px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--paper); font-size: 15px; font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 244, 119, 0.14);
}
input::placeholder { color: #5d6a6d; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px; border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper); font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--edge-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: var(--amber); border-color: var(--amber); color: var(--amber-ink);
}
.btn.primary:hover { background: var(--amber-soft); }
.btn.danger { color: var(--rust); border-color: rgba(255, 107, 74, 0.35); }
.btn.danger:hover { background: rgba(255, 107, 74, 0.12); }
.btn.small { padding: 7px 12px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn.link { background: none; border: none; color: var(--amber); padding: 0; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* --- messages ------------------------------------------------------------- */

.note {
  border-radius: 8px; padding: 11px 14px; font-size: 13.5px;
  border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04);
  margin-bottom: 14px;
}
.note.ok { border-color: rgba(120, 226, 160, 0.4); background: rgba(120, 226, 160, 0.09); color: #c9f6d9; }
.note.err { border-color: rgba(255, 107, 74, 0.4); background: rgba(255, 107, 74, 0.09); color: #ffcbbb; }
.note.info { border-color: rgba(54, 220, 255, 0.32); background: rgba(54, 220, 255, 0.08); color: #c6f2ff; }
.hidden { display: none !important; }

/* --- tabs ----------------------------------------------------------------- */

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--edge); margin-bottom: 20px; }
.tab {
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 14px; font-family: var(--font);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--paper); }
.tab.active { color: var(--amber); border-bottom-color: var(--amber); }

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

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 600; }
.item .meta { color: var(--faint); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 9px; display: block; }
.avatar.lg { width: 56px; height: 56px; border-radius: 12px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(120, 226, 160, 0.7); }

.badge {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--edge-strong); color: var(--muted);
}
.badge.admin { color: var(--amber); border-color: rgba(217, 244, 119, 0.45); }
.badge.banned { color: var(--rust); border-color: rgba(255, 107, 74, 0.45); }
.badge.unverified { color: var(--faint); }
.badge.online { color: var(--ok); border-color: rgba(120, 226, 160, 0.4); }

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

.stats { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: linear-gradient(180deg, var(--panel-2), #0a1215);
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 16px;
}
.stat .k { color: var(--faint); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }
.stat .v.amber { color: var(--amber); }

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

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--edge); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 13px; text-align: left; }
th { white-space: nowrap; }
th {
  color: var(--faint); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--edge); font-weight: 600;
}
tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
td.num { font-family: var(--mono); color: var(--muted); }
td .who { display: flex; align-items: center; gap: 10px; }

/* --- code / mono ---------------------------------------------------------- */

code, .mono { font-family: var(--mono); font-size: 12.5px; }
input.code {
  font-family: var(--mono); font-size: 22px; letter-spacing: 0.5em;
  text-align: center; padding: 14px;
}

/* --- toast ---------------------------------------------------------------- */

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  padding: 11px 18px; border-radius: 10px; font-size: 13.5px;
  background: #16232a; border: 1px solid var(--edge-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  z-index: 50; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
#toast.err { border-color: rgba(255, 107, 74, 0.5); }
#toast.ok { border-color: rgba(120, 226, 160, 0.5); }

/* --- party ---------------------------------------------------------------- */

.party-slot {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 10px; border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--faint); font-size: 13px;
}
.party-slot.filled {
  border-style: solid; border-color: var(--edge); color: var(--paper);
  background: rgba(255, 255, 255, 0.03);
}

/* --- utility -------------------------------------------------------------- */

.mono-sm { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.center { text-align: center; }
.faint { color: var(--faint); }
.muted { color: var(--muted); }
.spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--amber);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
