:root {
  --bg: #0b0d0c;
  --bg-2: #121612;
  --bg-3: #1a201a;
  --bg-hover: #232b22;
  --panel: #141a15;
  --border: #2a352c;
  --border-hot: #3d7a6a;
  --text: #e8efe6;
  --muted: #8a9a88;
  --accent: #2b8a9e;
  --accent-2: #3aa8bd;
  --accent-dim: rgba(43, 138, 158, 0.18);
  --lonestar: #3b7ec4;
  --valkyra: #c0392b;
  --manticore: #2f9e57;
  --danger: #d64545;
  --ok: #3cbc6d;
  --warn: #d4a017;
  --radius: 2px;
  --font: "Barlow", "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, monospace;
  --cut: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}

.fx-grid,
.fx-scan {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}
.fx-grid {
  background:
    linear-gradient(rgba(43, 138, 158, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 138, 158, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 0%, rgba(43, 138, 158, 0.14), transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(192, 57, 43, 0.08), transparent 45%),
    linear-gradient(180deg, #0e120f 0%, #0b0d0c 60%, #0a0c0a 100%);
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%, 100% 100%;
}
.fx-scan {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.25;
  mix-blend-mode: multiply;
  animation: scanDrift 12s linear infinite;
}
@keyframes scanDrift {
  from { transform: translateY(0); }
  to { transform: translateY(4px); }
}

#app { position: relative; z-index: 1; min-height: 100vh; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #7fd4e4; text-decoration: underline; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #2f97ad 0%, var(--accent) 100%);
  color: #061018;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px;
  clip-path: var(--cut);
  transition: filter .15s, transform .1s;
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button.secondary {
  background: var(--bg-3);
  border-color: var(--border);
  color: var(--text);
}
button.secondary:hover { border-color: var(--accent); color: var(--accent-2); filter: none; }
button.danger {
  background: linear-gradient(180deg, #e25555 0%, var(--danger) 100%);
  border-color: #a83232;
  color: #fff;
}
button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

input, select, textarea {
  width: 100%;
  background: #0a0e0b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  outline: none;
  font-family: var(--mono);
  font-size: 13px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
textarea { min-height: 90px; resize: vertical; font-family: var(--font); }
label {
  display: block;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.boot-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(42px, 10vw, 72px);
  letter-spacing: 0.18em;
  color: var(--text);
  text-shadow: 0 0 24px rgba(43, 138, 158, 0.35);
}
.boot-sub {
  font-family: var(--mono);
  color: var(--accent-2);
  letter-spacing: 0.2em;
  font-size: 12px;
  animation: blink 1.2s steps(2) infinite;
}
@keyframes blink {
  50% { opacity: 0.35; }
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(460px, 94vw);
  background: linear-gradient(160deg, #171e18 0%, #101510 100%);
  border: 1px solid var(--border);
  clip-path: var(--cut);
  padding: 0;
  box-shadow:
    0 0 0 1px rgba(43, 138, 158, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--lonestar), var(--valkyra), var(--manticore));
}
.login-card-inner { padding: 28px 26px 26px; }
.login-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.login-card h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 8vw, 48px);
  letter-spacing: 0.14em;
  line-height: 1;
}
.login-card .tagline {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}
.login-card p { margin: 0 0 22px; color: var(--muted); }
.login-card .error { color: #ff7a7a; margin-bottom: 14px; font-family: var(--mono); font-size: 13px; }
.login-card #loginBtn,
.login-card button { width: 100%; }

.faction-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 0 0 20px;
}
.faction-strip span {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--border);
  text-transform: uppercase;
}
.faction-strip .ls { color: var(--lonestar); border-color: rgba(59, 126, 196, 0.45); background: rgba(59, 126, 196, 0.08); }
.faction-strip .vk { color: #e07066; border-color: rgba(192, 57, 43, 0.45); background: rgba(192, 57, 43, 0.08); }
.faction-strip .mt { color: #5ecb85; border-color: rgba(47, 158, 87, 0.45); background: rgba(47, 158, 87, 0.08); }

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 5; }
}

.sidebar {
  background: linear-gradient(180deg, #121812 0%, #0e120f 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), transparent 40%, var(--valkyra) 100%);
  opacity: 0.55;
}
.brand { padding: 18px 16px 8px; }
.brand-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.16em;
  line-height: 1;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  margin-top: 4px;
}
.guild-pick { padding: 8px 12px 14px; }
.guild-pick select { background: var(--bg-3); }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 0 10px; flex: 1; }
.nav a {
  color: var(--muted);
  padding: 9px 12px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
  border: 1px solid transparent;
  position: relative;
}
.nav a:hover {
  color: var(--text);
  background: var(--accent-dim);
  border-color: rgba(43, 138, 158, 0.25);
  text-decoration: none;
}
.nav a.active {
  color: var(--accent-2);
  background: var(--accent-dim);
  border-color: rgba(43, 138, 158, 0.4);
  text-decoration: none;
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
}
.userbox {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
}
.userbox img {
  width: 36px;
  height: 36px;
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
  background: var(--bg);
  border: 1px solid var(--border);
}
.userbox .ph {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-family: var(--display);
  font-weight: 700;
}
.userbox .meta { flex: 1; min-width: 0; }
.userbox .meta strong {
  display: block;
  font-size: 13px;
  font-family: var(--display);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.userbox .meta span { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.userbox button { padding: 7px 10px; font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 16, 13, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 4;
}
.topbar h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 7px 12px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--warn);
  box-shadow: 0 0 8px currentColor;
}
.dot.on { background: var(--ok); color: var(--ok); }
.dot.off { background: var(--danger); color: var(--danger); }

.content { padding: 20px; max-width: 1120px; }
.card {
  background: linear-gradient(165deg, rgba(26, 32, 26, 0.95), rgba(16, 20, 16, 0.98));
  border: 1px solid var(--border);
  clip-path: var(--cut);
  padding: 16px 16px 14px;
  margin-bottom: 16px;
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.7;
}
.card h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.muted { color: var(--muted); }
.flash {
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  clip-path: var(--cut);
}
.flash.ok { background: rgba(60, 188, 109, 0.12); color: #6fdfa0; border-color: rgba(60, 188, 109, 0.35); }
.flash.err { background: rgba(214, 69, 69, 0.12); color: #ff8f8f; border-color: rgba(214, 69, 69, 0.35); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid rgba(42, 53, 44, 0.85);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
td { font-family: var(--mono); font-size: 12px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 6px 10px; font-size: 12px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 14px 12px;
  clip-path: var(--cut);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.55;
}
.stat .v {
  font-family: var(--mono);
  font-size: 26px;
  color: var(--accent-2);
  letter-spacing: 0.04em;
}
.stat .k {
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.guild-list { display: grid; gap: 10px; }
.guild-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 12px 14px;
  cursor: pointer;
  clip-path: var(--cut);
  transition: border-color .15s, background .15s;
}
.guild-item:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.guild-item img, .guild-item .ph {
  width: 46px;
  height: 46px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  clip-path: polygon(18% 0, 100% 0, 100% 82%, 82% 100%, 0 100%, 0 18%);
}
.guild-item strong {
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.empty {
  color: var(--muted);
  padding: 24px 0;
  font-family: var(--mono);
  font-size: 13px;
}

code {
  font-family: var(--mono);
  color: #b7c9b4;
}

/* —— Public site chrome —— */
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 16, 13, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-nav .logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.14em;
  margin-right: 12px;
  color: var(--text);
  text-decoration: none;
}
.site-nav .logo span { color: var(--accent-2); font-size: 11px; letter-spacing: 0.18em; display: block; font-weight: 600; }
.site-nav a.navlink {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--muted);
  padding: 7px 10px;
  border: 1px solid transparent;
  text-decoration: none;
}
.site-nav a.navlink:hover, .site-nav a.navlink.active {
  color: var(--accent-2);
  border-color: rgba(43, 138, 158, 0.35);
  background: var(--accent-dim);
  text-decoration: none;
}
.site-nav .spacer { flex: 1; }
.site-body { padding: 22px 20px 40px; max-width: 1180px; width: 100%; margin: 0 auto; }

.hero {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: 0.12em;
  margin: 0;
  line-height: 1;
}
.hero-sub {
  font-family: var(--mono);
  color: var(--accent-2);
  letter-spacing: 0.16em;
  font-size: 12px;
  margin: 8px 0 0;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.connect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  background: var(--accent);
  color: #0a0c10;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  clip-path: var(--cut);
  cursor: pointer;
}
a.connect-btn:hover { filter: brightness(1.1); color: #0a0c10; }
.connect-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.connect-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.card-head h3 { margin: 0; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.bar {
  display: inline-block;
  vertical-align: middle;
  width: 72px;
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-right: 6px;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.page-head { margin-bottom: 16px; }
.page-head h2 {
  font-family: var(--display);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.score-chip {
  border: 1px solid var(--border);
  padding: 10px;
  clip-path: var(--cut);
  background: var(--bg-2);
}
.score-chip .n { font-family: var(--display); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.score-chip .s { font-family: var(--mono); font-size: 20px; color: var(--accent-2); }

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.roster-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  clip-path: var(--cut);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.roster-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  text-decoration: none;
  color: inherit;
}
.roster-card img, .roster-card .ph {
  width: 48px;
  height: 48px;
  object-fit: cover;
  clip-path: polygon(18% 0, 100% 0, 100% 82%, 82% 100%, 0 100%, 0 18%);
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
}
.roster-card .rn {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.roster-card .rr {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-2);
  letter-spacing: 0.1em;
}
.badge-role {
  display: inline-block;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid rgba(43, 138, 158, 0.4);
  color: var(--accent-2);
  background: var(--accent-dim);
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button {
  padding: 7px 12px;
  font-size: 12px;
  background: var(--bg-3);
  border-color: var(--border);
  color: var(--muted);
}
.tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #061018;
}

.profile-head {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.profile-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 36px;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  margin-right: 6px;
}
.live-dot.off { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

