/* very dark theme, near black */
:root {
  --bg: #050508;
  --bg-elevated: #0a0a0e;
  --bg-card: #0c0c10;
  --border: #16161a;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #a1a1aa;
  --focus: #3f3f46;
  --radius: 10px;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-head: 'Syne', system-ui, sans-serif;

  /* type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 0.9375rem;
  --text-lg: 1rem;
  --text-xl: 1.125rem;
  --text-2xl: 1.25rem;
  --text-3xl: 1.5rem;
  --text-display: 1.75rem;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-muted: 0.01em;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
}

/* ----- login ----- */
.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.page-login .backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #151518 0%, transparent 60%);
  pointer-events: none;
}

.page-login .center-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.card-head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.icon-wrap .icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.card-head .title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 0.25rem 0;
}

.card-head .subtitle {
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  color: var(--text-muted);
  margin: 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.label {
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: var(--tracking-muted);
  color: var(--text-muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap-password .input {
  padding-right: 44px;
}

.input-toggle {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.input-toggle:hover {
  color: var(--text);
  background: var(--focus);
}

.input-toggle svg {
  width: 18px;
  height: 18px;
}

.input-toggle .icon-hide {
  display: none;
}

.input-toggle.visible .icon-show {
  display: none;
}

.input-toggle.visible .icon-hide {
  display: block;
}

.input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 44px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:hover {
  border-color: var(--focus);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus);
}

.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  margin-top: 0.5rem;
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.9;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.login-divider span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  background: #5865f2;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-discord:hover {
  opacity: 0.9;
}
.btn-discord:active {
  transform: scale(0.98);
}
.btn-discord-icon {
  width: 20px;
  height: 20px;
}
.btn-discord.is-loading {
  pointer-events: none;
  opacity: 0.85;
  cursor: wait;
}
.btn-discord.is-loading .btn-discord-icon {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field-error {
  color: #f87171;
  margin-top: 0.25rem;
}

.hint {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ----- dashboard ----- */
.page-dashboard {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.page-dashboard .backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 70% 20%, #151518 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* dashboard layout is in dashboard.css */

/* floating sidebar */
.sidebar-float {
  position: fixed;
  top: 0.5rem;
  left: 1.25rem;
  width: 200px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
  margin: 0 0.4rem;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
  box-sizing: border-box;
}

.sidebar-brand .nav-icon {
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.nav {
  flex: 1;
  padding: 0.6rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem;
  margin: 0 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 500;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.6rem 0.4rem 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar-footer .nav-item {
  color: var(--text-muted);
}

.dashboard-loading-wrap {
  padding: 2rem 0;
}

.dashboard-loading-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.dashboard-loading-icon {
  margin-bottom: 0;
}

.dashboard-loading-icon .icon {
  animation: spin 1.2s linear infinite;
}

.dashboard-loading-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.dashboard-loaded {
  display: block;
  padding-bottom: 2rem;
}

/* card sections with title */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.card-section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 1rem 1.25rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.card-section-title-inset {
  background: transparent;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: none;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* linked accounts: Discord + Brawlhalla */
.accounts-section {
  margin-bottom: 1.5rem;
}

.accounts-section .accounts-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.accounts-section .account-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.account-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.account-row:last-child {
  border-bottom: none;
}

.account-row:hover {
  background: var(--bg-elevated);
}

.account-row-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.account-row-icon svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  flex-shrink: 0;
}

.account-row-discord .account-row-icon {
  background: rgba(88, 101, 242, 0.2);
  color: #5865f2;
}

.account-row-brawlhalla .account-row-icon {
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border);
}

.account-row-brawlhalla .account-row-icon svg {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
}

.account-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  justify-content: center;
}

.account-row-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.account-row-value {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.account-row-value.empty {
  color: var(--text-muted);
  font-weight: 500;
}

.soon-block {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  padding: 2rem;
}

.soon-text {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* user at top */
.user-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.user-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.user-hero-meta {
  min-width: 0;
}

.user-hero-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.2rem 0;
  line-height: 1.2;
}

.user-hero-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* stats block: definition list, not cards */
.stats-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.stats-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row dt {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

.stat-row dd {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-align: right;
}

.stat-row dd.stat-value {
  color: var(--text);
}
.stat-row dd.stat-value:empty {
  color: var(--text-muted);
  font-weight: 400;
}
.stat-row dd.stat-value:empty::before {
  content: "—";
}

.stats-note {
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  border-top: 1px solid var(--border);
}
