/* evo.career components, Atelier. Every value comes from tokens.css (generated from tokens.json).
   Used as-is by the desktop app (src/EvoCareer.App/ui), the website and the in-game pages.
   Load order: fonts/fonts.css (bundled OFL fonts), tokens.css, then this file. */

/* Ground: graphite with a soft top light */
.ec-root { color-scheme: dark; background: radial-gradient(120% 80% at 70% 0%, var(--ground-glow) 0%, var(--ground) 60%) var(--ground); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 24px; -webkit-font-smoothing: antialiased; }
:where(.ec-root) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Type */
.ec-label { font: 400 11px/1 var(--font-label); letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-muted); }
.ec-label-s { font: 400 9px/1 var(--font-label); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-muted); }
.ec-label.accent, .ec-label-s.accent { color: var(--accent); }
.ec-title-xl { margin: 0; font: 200 84px/80px var(--font-title); letter-spacing: -0.03em; }
.ec-title-l { margin: 0; font: 200 60px/58px var(--font-title); letter-spacing: -0.03em; }
.ec-title-m { margin: 0; font: 300 28px/32px var(--font-title); letter-spacing: -0.01em; }
.ec-time-xl { font: 200 112px/1 var(--font-title); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.ec-time { font: 300 26px/1 var(--font-title); font-variant-numeric: tabular-nums; }
.ec-num { font-variant-numeric: tabular-nums; }
.ec-meta { font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.ec-notice { font-size: 12px; line-height: 18px; color: var(--ink-faint); }

/* Wordmark: the racing line, then evo.career in lowercase Michroma */
.ec-wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font: 400 15px/1 var(--font-label); letter-spacing: 0.3em; }
.ec-wordmark::before { content: ""; width: 22px; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.ec-wordmark.lg { font-size: 20px; gap: 14px; }
.ec-wordmark.lg::before { width: 30px; }

/* Monogram: red tile, a thin e and a square dot (inline SVG; see assets/Logos/evo-career-icon.svg) */
.ec-monogram { display: inline-block; width: 40px; height: 40px; border-radius: 24%; flex: none; }

/* Top bar and navigation */
.ec-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 26px 48px; }
.ec-nav { display: flex; flex-wrap: wrap; gap: 36px; font-size: 14px; letter-spacing: 0.04em; }
.ec-nav a, .ec-nav button { color: var(--ink-muted); text-decoration: none; padding: 0 0 6px; border: 0; border-bottom: 1px solid transparent; background: none; font: inherit; letter-spacing: inherit; cursor: pointer; }
.ec-nav [aria-current], .ec-nav .active { color: var(--ink); border-bottom-color: var(--accent); }
.ec-nav .soon { cursor: default; }
.ec-account { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: var(--radius-pill); border: 1px solid var(--glass-edge); background: var(--glass-1); color: var(--ink); font: 500 13px/1 var(--font-body); cursor: pointer; }
.ec-account .avatar { width: 28px; height: 28px; border-radius: var(--radius-pill); display: grid; place-items: center; background: linear-gradient(135deg, #3a3d42, #16181b); font-size: 11px; letter-spacing: 0.04em; overflow: hidden; }
.ec-account .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Buttons: one primary (paper) per screen */
.ec-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 28px; border-radius: var(--radius-pill); border: 1px solid transparent; background: transparent; color: var(--ink); font: 500 15px/1 var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.ec-btn.primary { background: var(--paper); color: var(--on-paper); font-weight: 600; padding: 0 36px; box-shadow: 0 10px 30px rgba(255, 255, 255, 0.10); }
.ec-btn.secondary { border-color: var(--glass-edge-strong); background: rgba(10, 11, 13, 0.3); backdrop-filter: blur(10px); }
.ec-btn.quiet { color: var(--ink-muted); padding: 0 16px; text-transform: none; letter-spacing: 0; }
.ec-btn.sm { min-height: 40px; padding: 0 18px; font-size: 13px; letter-spacing: 0.04em; text-transform: none; }
.ec-btn:disabled { opacity: 0.45; cursor: default; }

/* Glass panels */
.ec-glass { background: linear-gradient(150deg, var(--glass-2), var(--glass-0)); border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); backdrop-filter: blur(24px) saturate(140%); box-shadow: var(--shadow-panel), inset 0 1px 0 var(--glass-highlight); }
.ec-glass.raised { background: linear-gradient(150deg, var(--glass-3), var(--glass-0)); box-shadow: var(--shadow-hero), inset 0 1px 0 var(--glass-highlight); }
.ec-glass.on-photo { background: var(--scrim); }
.ec-glass.sm { border-radius: var(--radius-md); }
.ec-glass.selected { border-color: var(--accent); box-shadow: 0 0 24px var(--accent-glow), var(--shadow-panel); }

/* Photography: a track photo with the car render on top */
.ec-photo { position: relative; overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--glass-edge); background: var(--ground-raised); }
.ec-photo > .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55) saturate(0.7); }
.ec-photo > .shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 11, 13, 0.95) 0%, rgba(10, 11, 13, 0) 60%); }
.ec-photo.selected { border-color: var(--accent); box-shadow: 0 0 24px var(--accent-glow), var(--shadow-panel); }
.ec-car { aspect-ratio: 1.55; object-fit: cover; object-position: 50% 56%; -webkit-mask-image: radial-gradient(ellipse 47% 41% at 50% 56%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 47% 41% at 50% 56%, #000 55%, transparent 100%); }

/* Track outline (drawn from the layout's racing line) */
.ec-track { display: block; width: 100%; height: 100%; overflow: visible; }
.ec-track .line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ec-track .glow { fill: none; stroke: var(--accent); stroke-width: 10; opacity: 0.3; filter: blur(5px); vector-effect: non-scaling-stroke; }
.ec-track .start { fill: var(--accent); }

/* Medals: tags carry the word; the disc is for the result screen */
.ec-medal { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); font: 400 10px/1 var(--font-label); letter-spacing: 0.22em; text-transform: uppercase; }
.ec-medal::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: currentColor; }
.ec-medal.gold { color: var(--medal-gold); background: rgba(230, 207, 138, 0.14); }
.ec-medal.silver { color: var(--medal-silver); background: rgba(213, 216, 219, 0.12); }
.ec-medal.bronze { color: var(--medal-bronze); background: rgba(217, 162, 122, 0.14); }
.ec-medal.none { color: var(--ink-muted); background: var(--glass-1); }
.ec-medal-disc { width: 132px; height: 132px; border-radius: var(--radius-pill); display: grid; place-items: center; flex: none; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
.ec-medal-disc > span { width: 85%; height: 85%; border-radius: var(--radius-pill); display: grid; place-items: center; color: #15171a; font: 400 13px/1 var(--font-label); letter-spacing: 0.2em; text-transform: uppercase; }
.ec-medal-disc.gold { background: conic-gradient(from 210deg, #fff3cf, #b8994a, #f6e3a6, #a88a3e, #fff3cf); }
.ec-medal-disc.gold > span { background: radial-gradient(circle at 35% 30%, #fff1c4, #e6cf8a 60%, #b8994a); }
.ec-medal-disc.silver { background: conic-gradient(from 210deg, #f4f6f8, #9aa1a8, #e9ecef, #8a9097, #f4f6f8); }
.ec-medal-disc.silver > span { background: radial-gradient(circle at 35% 30%, #f2f4f6, #b9bfc5 60%, #8f969d); }
.ec-medal-disc.bronze { background: conic-gradient(from 210deg, #f3c7a5, #8f5a35, #e5b08a, #7f4f2d, #f3c7a5); }
.ec-medal-disc.bronze > span { background: radial-gradient(circle at 35% 30%, #f1c3a0, #d9a27a 60%, #9c6741); }
.ec-medal-disc.none { background: var(--glass-2); }
.ec-medal-disc.none > span { background: var(--ground-raised); color: var(--ink-muted); }

/* Progress: one segment per test, coloured by medal */
.ec-progress { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.ec-progress > span { height: 3px; background: rgba(255, 255, 255, 0.16); }
.ec-progress > .gold { background: var(--medal-gold); }
.ec-progress > .silver { background: var(--medal-silver); }
.ec-progress > .bronze { background: var(--medal-bronze); }
.ec-progress > .next { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* Target scale: where a time landed between gold, silver and bronze */
.ec-scale { position: relative; height: 54px; }
.ec-scale .bands { position: absolute; left: 0; right: 0; top: 22px; height: 4px; border-radius: 2px; display: flex; overflow: hidden; }
.ec-scale .bands > .g { background: var(--medal-gold); }
.ec-scale .bands > .s { background: var(--medal-silver); }
.ec-scale .bands > .b { background: var(--medal-bronze); }
.ec-scale .bands > .n { background: rgba(255, 255, 255, 0.14); }
.ec-scale .tick { position: absolute; top: 36px; transform: translateX(-50%); font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ec-scale .you { position: absolute; top: 8px; width: 3px; height: 32px; margin-left: -1px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }

/* Chips: rules and state words */
.ec-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-pill); border: 1px solid var(--glass-edge); color: var(--ink-2); font-size: 12px; line-height: 16px; }
.ec-chip.danger { border-color: transparent; background: rgba(255, 122, 107, 0.14); color: var(--danger); border-radius: var(--radius-sm); }

/* Licence card */
.ec-licence { position: relative; aspect-ratio: 1.586; box-sizing: border-box; padding: 22px 24px; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(150deg, #24272c 0%, #121417 55%, #1b1d21 100%); border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: var(--shadow-hero), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.ec-licence::before { content: ""; position: absolute; inset: -30% -20% auto 30%; height: 80%; background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 60%); transform: rotate(-12deg); pointer-events: none; }
.ec-licence > * { position: relative; }
.ec-licence .stripe { height: 2px; background: linear-gradient(90deg, var(--accent), rgba(232, 48, 42, 0)); box-shadow: 0 0 12px rgba(232, 48, 42, 0.6); }
.ec-licence .name { font: 200 44px/1 var(--font-title); letter-spacing: -0.02em; }
.ec-licence.earned { box-shadow: var(--shadow-hero), 0 0 60px rgba(232, 48, 42, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.24); }

/* Lap table */
.ec-laps { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.ec-laps th { text-align: left; padding: 14px 20px; font: 400 9px/1 var(--font-label); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-muted); }
.ec-laps td { padding: 13px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.ec-laps .r { text-align: right; }
.ec-laps tr.out td { color: var(--ink-faint); }
.ec-laps tr.invalid .t { color: var(--danger); text-decoration: line-through; }
.ec-laps tr.best { background: rgba(61, 214, 140, 0.06); }
.ec-laps tr.best td { color: var(--timing-personal-best); }
.ec-slower { color: var(--timing-slower); }
.ec-personal-best { color: var(--timing-personal-best); }
.ec-session-best { color: var(--timing-session-best); }

/* Status pill (on track, official, offline) */
.ec-status { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--glass-edge); background: var(--glass-1); font: 400 10px/1 var(--font-label); letter-spacing: 0.22em; text-transform: uppercase; }
.ec-status::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--ink-muted); }
.ec-status.live { background: rgba(232, 48, 42, 0.12); border-color: rgba(232, 48, 42, 0.4); }
.ec-status.live::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.ec-status.ok::before { background: var(--timing-personal-best); }

/* Engineer's note */
.ec-note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--scrim); border: 1px solid var(--glass-edge); backdrop-filter: blur(18px); font-size: 14px; line-height: 22px; }
.ec-note::before { content: ""; flex: none; width: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* In-game banner: top centre, one line */
.ec-banner { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: var(--radius-pill); background: rgba(10, 11, 13, 0.72); border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(12px); color: var(--ink); box-shadow: var(--shadow-overlay); font: 500 14px/20px var(--font-body); white-space: nowrap; }
.ec-banner::before { content: ""; width: 2px; height: 16px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.ec-banner.error::before { background: var(--danger); box-shadow: none; }
