:root{
    /* Colors */
  --bg:#0b1220;
  --panel:#0f172a;
  --panel-2:#0b1328;
  --border:#263046;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --subtle:#94a3b8;
  --accent:#363799;      /* primary button */
  --success:#22c55e;     /* green */
  --ghost:#1f2937;
  --danger:#7a2323;      /* red */
  --power: #cbd5e140;    /* silver */
  --unique: #f59e0b40;   /* gold */
  --token: #9a7b4f40;    /* brown */

  --gap:14px;
  
    /* Faction colors (used by charts, UI accents, etc.) */
  --faction-black:  #595959;
  --faction-white:  #e5e7eb;
  --faction-red:    #dc2626;
  --faction-blue:   #3b82f6;
  --faction-green:  #22c55e;
  --faction-yellow: #eab308;
  --faction-orange: #f59e0b;
  --faction-violet: #a78bfa;
  --faction-pink:   #fb7185;
  --faction-cyan:   #06b6d4;
  --faction-teal:   #14b8a6;
  --faction-brown:  #a16207;
}

/* ---------------- Global Reset & Typography --------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
        "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

a {
  color: inherit;
  text-decoration: none;
}

/* Base page wrapper used across app */
.page {
  min-height: calc(100vh - 64px); /* leaves room for header */
}

/* ----------------------------------------------------
   GENERIC LAYOUT
---------------------------------------------------- */

.container {
  max-width: none;
  margin: 0 auto;
  padding: 12px 16px;
}

/* ----------------------------------------------------
   FORM ELEMENTS
---------------------------------------------------- */

label {
  font-size: 12px;
  color: var(--subtle);
}

input[type="text"],
select,
input[type="email"],
input[type="password"] {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
}

input[type="text"]:focus,
select:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: #7c83f8;
}

/* Generic search bar wrapper */
.search-wrap {
  display: flex;
  gap: 8px;
}

.search-wrap input {
  flex: 1 1 auto;
}

/* ----------------------------------------------------
   BUTTONS
---------------------------------------------------- */

.btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1;
  text-decoration: none;
  user-select: none;
}

.btn:hover{
  filter: brightness(1.08);
}

.btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

/* Variants */

.btn-accent{
  background: var(--accent);
  border-color: var(--accent);
}

.btn-ghost{
  background: transparent;
  border-color: rgba(255,255,255,0.18);
}

.btn-danger{
  background: var(--danger);
  border-color: var(--danger);
}

/* Sizes */

.btn-sm{
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  font-size: 0.85rem;
}

/* Toggle Button */

.btn-toggle {
  background: var(--ghost);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  opacity: 0.85;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease,
    transform 0.05s ease;
}

/* Active state */
.btn-toggle.active,
.btn-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

/* ----------------------------------------------------
   FILTER / FIELD GRID (OPTIONAL BUT GENERIC)
---------------------------------------------------- */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.filter-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.filter-block.grow {
  flex: 1 1 240px;
  min-width: 200px;
}

/* ----------------------------------------------------
   HELPERS
---------------------------------------------------- */

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* ----------------------------------------------------
   UTILITIES
---------------------------------------------------- */
.hidden{ display:none !important; }
.muted{ color: var(--muted); }
.error{ color: #f87171; }