/* /web2 — SSR replica of the LMU Assister app.
   Design tokens transcribed 1:1 from ui/theme/Color.kt + Theme.kt (dark only). */

:root {
  --carbon: #0B0C0F;        /* app background */
  --surface1: #14161B;      /* cards */
  --surface2: #1B1E25;      /* raised cards / chips */
  --surface3: #242833;      /* hover / selected */
  --outline: #2C313C;
  --outline-soft: #20242C;

  --text-high: #F2F4F8;
  --text-med: #ADB3C0;
  --text-low: #6E7585;

  --amber: #FF7A1A;         /* primary */
  --amber-dim: #3A2410;
  --lime: #9BE600;          /* "live" / weekly accent */
  --lime-dim: #24300A;

  --class-hyper: #E2231A;   /* Hypercar (also error) */
  --class-lmp2: #2563EB;
  --class-lmp3: #7C3AED;
  --class-gt3: #16A34A;
  --class-gte: #F59E0B;
  --class-mixed: #C792EA;

  --skill-rookie: #8A93A6;
  --skill-beginner: #57C77A;
  --skill-inter: #E6C04A;
  --skill-adv: #FF8A3D;
  --skill-pro: #FF4D5E;

  --auth-accent: #E7B84E;   /* login gold */
  --steam-logo-bg: #223044;
  --qr-paper: #FAF8F1;
  --danger: #E5484D;

  --rank-gold: #E1A01F;
  --rank-silver: #8F9499;
  --rank-bronze: #977548;
  --rank-platinum: #89B2DD;
  --dist-accent: #7FB2E8;
  --flag-gray: #8A8F98;

  /* MaterialTheme.shapes */
  --r-xs: 8px; --r-s: 12px; --r-m: 16px; --r-l: 22px; --r-xl: 28px;

  --font: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--carbon);
  color: var(--text-high);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, svg { display: block; }

.icon { width: 24px; height: 24px; }

/* ------------------------------------------------- type scale (M3 + Theme.kt) */
.headline-l { font-size: 32px; line-height: 40px; font-weight: 900; letter-spacing: -0.5px; }
.headline-m { font-size: 28px; line-height: 36px; font-weight: 800; letter-spacing: -0.5px; }
.headline-s { font-size: 24px; line-height: 32px; font-weight: 900; }
.title-l { font-size: 22px; line-height: 28px; font-weight: 700; }
.title-m { font-size: 16px; line-height: 24px; font-weight: 600; }
.title-s { font-size: 14px; line-height: 20px; font-weight: 700; }
.body-l { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-m { font-size: 14px; line-height: 20px; font-weight: 400; }
.body-s { font-size: 12px; line-height: 16px; font-weight: 400; }
.label-l { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0.4px; }
.label-m { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.6px; }
.label-s { font-size: 11px; line-height: 16px; font-weight: 500; }

.text-high { color: var(--text-high); }
.text-med { color: var(--text-med); }
.text-low { color: var(--text-low); }
.text-amber { color: var(--amber); }

/* ------------------------------------------------- shell: rail / bottom bar */
.shell { min-height: 100dvh; }
.content { padding: 16px; max-width: 1400px; }

.rail { display: none; }
.bottombar {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  height: 80px; padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface1);
  display: flex; align-items: center; justify-content: space-around;
}
.shell { padding-bottom: 96px; }

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-med); min-width: 56px;
}
.nav-ind {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 32px; border-radius: 16px;
}
.nav-item .nav-label { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.5px; visibility: hidden; height: 16px; }
.nav-item.is-active .nav-label { visibility: visible; color: var(--amber); }
.nav-item.is-active .nav-ind { background: var(--amber); color: var(--carbon); }

@media (min-width: 840px) {
  .bottombar { display: none; }
  .shell { padding-bottom: 0; }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: 80px; background: var(--surface1);
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding-top: 44px;
  }
  .content { margin-left: 80px; padding: 24px; }
}

/* ------------------------------------------------- shared components */
.card {
  background: var(--surface1);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 16px;
}
.card-raised { background: var(--surface2); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 6px; padding: 2px 8px;
  font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase;
}
/* colored pill: set --pill-c */
.pill-tint {
  color: var(--pill-c);
  background: color-mix(in srgb, var(--pill-c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-c) 40%, transparent);
}

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 7px 10px;
  background: var(--surface1); border: 1px solid var(--outline);
  color: var(--text-med); font-size: 12px; font-weight: 700;
}
.chip.is-selected { background: var(--surface3); color: var(--text-high); border-color: var(--outline); }

.btn {
  display: flex; width: 100%; align-items: center; justify-content: center;
  border-radius: 14px; padding: 14px; cursor: pointer;
  border: 1px solid var(--outline); background: rgba(11, 12, 15, 0.58);
  color: var(--text-high); font-size: 14px; line-height: 20px; font-weight: 700;
}
.btn:disabled { opacity: 0.48; cursor: default; }
.btn-gold {
  background: rgba(231, 184, 78, 0.92); border-color: rgba(231, 184, 78, 0.62);
  color: var(--carbon); font-weight: 900;
}
.btn-gold:disabled { background: rgba(231, 184, 78, 0.44); border-color: rgba(231, 184, 78, 0.3); }
.btn-exit {
  height: 48px; padding: 0 12px; border-radius: 12px;
  background: var(--surface1); border: 1px solid var(--outline);
  color: var(--text-med); font-weight: 600; font-size: 14px; letter-spacing: 0.4px;
}
.btn-danger {
  background: rgba(229, 72, 77, 0.10); border-color: rgba(229, 72, 77, 0.45);
  color: var(--danger);
}

.field { display: block; margin-bottom: 12px; }
.field label { display: block; font-size: 12px; line-height: 16px; color: var(--text-med); margin: 0 0 6px 4px; font-weight: 600; letter-spacing: 0.6px; }
.field input {
  width: 100%; padding: 14px 12px; border-radius: 12px;
  background: rgba(11, 12, 15, 0.64); border: 1px solid var(--outline);
  color: var(--text-high); font-size: 14px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--auth-accent); }
.field input:disabled { opacity: 0.5; }
.field input::placeholder { color: var(--text-low); }

.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid transparent; border-top-color: var(--auth-accent); border-left-color: var(--auth-accent);
  animation: spin 0.9s linear infinite;
}
.spinner-dark { border-top-color: var(--carbon); border-left-color: var(--carbon); }
@keyframes spin { to { transform: rotate(360deg); } }

.divider-or { display: flex; align-items: center; gap: 10px; color: var(--text-low); font-size: 11px; font-weight: 700; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--outline) 70%, transparent); }

/* class color helpers (WEC live-timing palette) */
.c-hyper { --pill-c: var(--class-hyper); }
.c-lmp2 { --pill-c: var(--class-lmp2); }
.c-lmp3 { --pill-c: var(--class-lmp3); }
.c-gt3 { --pill-c: var(--class-gt3); }
.c-gte { --pill-c: var(--class-gte); }
.c-mixed { --pill-c: var(--class-mixed); }
