/* ThreeChest - Material 3 expressive dark theme */
:root {
  --bg: #141218;
  --surface: #1d1b20;
  --surface-2: #211f26;
  --surface-3: #2d2a34;
  --outline: #443f50;
  --primary: #d0bcff;
  --primary-dim: #4f378b;
  --primary-mid: #6750a4;
  --on-primary: #381e72;
  --text: #e6e0e9;
  --muted: #938f99;
  --green: #81c995;
  --red: #f28b82;
  --yellow: #ffcb6b;
  --radius: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #2a1e4d 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem 2rem;
  background: rgba(29, 27, 32, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--outline);
  position: sticky; top: 0; z-index: 10;
}
header.site .brand {
  font-weight: 600; font-size: 1.25rem; color: var(--primary);
  letter-spacing: 0.3px;
}
header.site nav { display: flex; gap: 1.1rem; flex: 1; }
header.site nav a { color: var(--text); opacity: 0.85; }
header.site nav a:hover { opacity: 1; text-decoration: none; color: var(--primary); }

main { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }

.card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.card h2 { margin-top: 0; font-weight: 600; }

h1, h2, h3 { font-weight: 600; }
h1 .accent, h2 .accent { color: var(--primary); }
.muted { color: var(--muted); }
.pill {
  display: inline-block; padding: 0.15rem 0.8rem; border-radius: 999px;
  background: var(--primary-dim); color: var(--primary); font-size: 0.85rem;
}

table { width: 100%; border-collapse: collapse; margin: 0.6rem 0; }
th {
  text-align: left; font-weight: 600; font-size: 0.85rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--outline);
}
td { padding: 0.55rem 0.8rem; border-bottom: 1px solid rgba(68, 63, 80, 0.4); }
tr:hover td { background: rgba(103, 80, 164, 0.08); }
td.rank-1 { color: var(--yellow); font-weight: 600; }

.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--primary-mid); color: #fff;
  padding: 0.55rem 1.5rem; border-radius: 999px;
  font-family: inherit; font-size: 0.95rem; font-weight: 500;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--primary); color: var(--on-primary); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.secondary { background: var(--surface-3); color: var(--text); }

input[type="text"], input[type="url"], input[type="number"], input[type="password"],
input[type="email"], input[type="datetime-local"], select, textarea {
  background: var(--surface-3); border: 1px solid var(--outline); color: var(--text);
  border-radius: 10px; padding: 0.5rem 0.9rem; font-family: inherit; font-size: 0.95rem;
  color-scheme: dark; /* dark native calendar/time pickers */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-mid); border-color: transparent; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary-mid); width: 1.05rem; height: 1.05rem; }

.wicon {
  width: 18px; height: 18px; border-radius: 4px; vertical-align: -0.25em;
  border: 1px solid var(--outline);
}

.conn-row { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.conn-row input[type="radio"], .conn-row input[type="checkbox"] { margin: 0; flex-shrink: 0; }
.conn-row .pill { line-height: 1.4; flex-shrink: 0; }

.btn.danger { background: #8c1d18; color: #f9dedc; }
.btn.danger:hover { background: #b3261e; color: #fff; }

/* Auth pages (allauth form.as_p output) */
.auth-card { max-width: 440px; margin: 3rem auto; }
.auth-card form p { margin: 0.8rem 0; }
.auth-card form label { display: block; font-size: 0.88rem; color: var(--muted); margin-bottom: 0.3rem; }
.auth-card form input:not([type="checkbox"]):not([type="radio"]) { width: 100%; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-logo { vertical-align: -0.25em; margin-right: 0.55rem; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #6b78f5; color: #fff; }
.btn-bnet { background: #148eff; color: #fff; }
.btn-bnet:hover { background: #3fa3ff; color: #fff; }
.divider-text { text-align: center; font-size: 0.85rem; margin: 1.2rem 0; }
.errorlist { color: var(--red); list-style: none; padding: 0; margin: 0.3rem 0; font-size: 0.9rem; }
.helptext { color: var(--muted); font-size: 0.8rem; display: block; margin-top: 0.25rem; }

/* Bare allauth pages (anything without a custom override) */
main button:not([class]) {
  background: var(--primary-mid); color: #fff; border: none; cursor: pointer;
  padding: 0.55rem 1.5rem; border-radius: 999px; font-family: inherit; font-size: 0.95rem;
}
main button:not([class]):hover { background: var(--primary); color: var(--on-primary); }
main input:not([type="checkbox"]):not([type="radio"]) { max-width: 100%; }

/* Wide tables (pool, leaderboards) scroll inside their card instead of spilling out */
.card { overflow-x: auto; }

/* Home page step cards */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.steps .card { margin-bottom: 0; }
.steps .num {
  display: inline-block; width: 2rem; height: 2rem; line-height: 2rem; text-align: center;
  border-radius: 50%; background: var(--primary-dim); color: var(--primary);
  font-weight: 600; margin-bottom: 0.5rem;
}
.hero { padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: 2.2rem; margin: 0 0 0.6rem; }
.hero p { font-size: 1.05rem; max-width: 720px; }

.check { padding: 0.25rem 0; }
.check.pass { color: var(--green); }
.check.warn { color: var(--yellow); }
.check.fail { color: var(--red); }

.notice {
  border-radius: 12px; padding: 0.7rem 1.1rem; margin: 0.7rem 0 1rem;
  background: var(--surface-3); border: 1px solid var(--yellow);
  font-size: 0.92rem;
}
.notice p:first-child { color: var(--yellow); }

.messages { list-style: none; padding: 0; }
.messages li {
  border-radius: 12px; padding: 0.7rem 1.1rem; margin-bottom: 0.7rem;
  background: var(--surface-3); border: 1px solid var(--outline);
}
.messages li.success { border-color: var(--green); color: var(--green); }
.messages li.error { border-color: var(--red); color: var(--red); }

footer.site {
  text-align: center; color: var(--muted); font-size: 0.85rem; padding: 2.5rem 0 1.5rem;
}
