@font-face {
  font-family: "F1 Display";
  src: url("../fonts/f1-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "F1 Display";
  src: url("../fonts/f1-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "F1 Wide";
  src: url("../fonts/f1-wide.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root,
:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --panel: #18191d;
  --panel2: #23252a;
  --line: #34363c;
  --text: #f7f7f5;
  --muted: #9b9da3;
  --accent: #e10600;
  --accent2: #ff1e16;
  --gold: #f4c430;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  --glory-paper: #eeeeea;
  --glory-ink: #111215;
  --glory-header: 72px;
}

:root[data-theme="light"] {
  --bg: #e8e8e4;
  --panel: #ffffff;
  --panel2: #eeeeea;
  --line: #c9cac6;
  --text: #111215;
  --muted: #62646a;
  --accent: #e10600;
  --accent2: #ff1e16;
  --gold: #a97900;
  --shadow: 0 12px 30px rgba(17, 18, 21, 0.09);
}

html {
  min-width: 320px;
  background: #080808;
}

* {
  font-family: "F1 Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body,
[data-theme="dark"] body,
[data-theme="light"] body {
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

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

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid #f4c430;
  outline-offset: 3px;
}
@media (hover: none) and (pointer: coarse) {
  :focus-visible { outline: 0; }
}

::selection {
  color: #fff;
  background: var(--accent);
}

.glory-site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  top: 0;
  right: 0;
  left: 0;
  height: var(--glory-header);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 8, 8, 0.94);
  backdrop-filter: blur(14px);
}

:root[data-theme="light"] .glory-site-header {
  color: var(--glory-ink);
  border-bottom-color: rgba(17, 18, 21, 0.14);
  background: rgba(247, 247, 245, 0.96);
}

.glory-header-inner {
  width: min(calc(100% - 48px), 1180px);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mobile-career-hud {
  display: none;
}

.glory-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "F1 Wide", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

:root[data-theme="light"] .glory-brand {
  color: var(--glory-ink);
}

.glory-brand img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.glory-brand small {
  align-self: flex-end;
  margin: 0 0 12px -4px;
  padding: 2px 5px;
  color: #fff;
  background: var(--accent);
  font-family: "F1 Wide", sans-serif;
  font-size: 7px;
  line-height: 1;
}

.glory-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 32px);
}

.glory-nav a {
  position: relative;
  color: #c8c9cc;
  font-size: 13px;
  white-space: nowrap;
  transition: color 160ms ease;
}

.glory-nav a:hover,
.glory-nav a.is-active {
  color: #fff;
}

.glory-nav a.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -15px;
  left: 0;
  height: 2px;
  background: var(--accent);
}

.glory-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

#themeToggle,
#langToggle {
  position: static;
  z-index: auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 1px solid #3c3e43;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

#themeToggle:hover,
#langToggle:hover,
[data-theme="dark"] #themeToggle:hover,
[data-theme="dark"] #langToggle:hover {
  border-color: #666970;
  background: #222429;
}

:root[data-theme="light"] #themeToggle,
:root[data-theme="light"] #langToggle {
  color: var(--glory-ink);
  border-color: #c9cac6;
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] #themeToggle:hover,
:root[data-theme="light"] #langToggle:hover {
  border-color: #77797e;
  background: #fff;
}

.glory-exit {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  color: #fff;
  border: 1px solid #3c3e43;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.glory-exit:hover {
  border-color: var(--accent);
  background: var(--accent);
}

#intro {
  min-height: max(820px, 100svh);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.74fr);
  align-content: center;
  align-items: center;
  column-gap: clamp(54px, 8vw, 118px);
  row-gap: 19px;
  padding: calc(var(--glory-header) + 66px) max(24px, calc((100vw - 1180px) / 2)) 66px;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.98) 0%, rgba(8, 8, 8, 0.9) 46%, rgba(8, 8, 8, 0.52) 100%),
    url("../images/hero-bg.jpg") center / cover no-repeat;
}

#intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: var(--glory-header) auto 0 0;
  width: 5px;
  height: auto;
  border-radius: 0;
  background: var(--accent);
  animation: none;
}

#intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 1px;
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
}

#intro .flag {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #d0d1d3;
  font-family: "F1 Wide", sans-serif;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0;
  animation: fadeUp 0.5s both;
}

#intro .flag span {
  font-family: inherit;
}

#intro .flag span:first-child {
  color: var(--accent2);
}

#intro .flag span + span {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}

#intro h1 {
  grid-column: 1;
  margin: 0;
  color: #fff;
  font-family: "F1 Wide", sans-serif;
  font-size: clamp(48px, 5.4vw, 78px);
  font-style: normal;
  font-weight: 700;
  line-height: 1.02;
  text-align: left;
  letter-spacing: 0;
  animation: fadeUp 0.5s 0.06s both;
}

#intro h1 span {
  color: var(--accent2);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}

#intro > p {
  grid-column: 1;
  max-width: 640px;
  margin: 0;
  color: #c3c5c8;
  font-size: 15px;
  line-height: 1.75;
  text-align: left;
}

#intro > p:not(.news):not(.legal) {
  animation: fadeUp 0.5s 0.12s both;
}

#intro > .intro-actions {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeUp 0.5s 0.18s both;
}

#intro .intro-actions .btn {
  animation: none;
}

.intro-rank-btn {
  color: #f3f3f3;
  border-color: #55585f;
  background: rgba(17, 18, 21, 0.72);
}

.intro-rank-btn::after {
  display: none;
}

.intro-rank-btn svg {
  width: 17px;
  height: 17px;
}

.intro-rank-btn:hover {
  color: #fff;
  border-color: #8d9097;
  background: #292b30;
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.btn::after {
  content: "→";
  font-size: 18px;
  line-height: 1;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent2);
  background: var(--accent2);
  box-shadow: none;
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost,
.btn.line {
  color: var(--text);
  border: 1px solid #74767d;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
}

.btn.ghost::after,
.btn.line::after {
  display: none;
}

.btn.ghost:hover,
.btn.line:hover {
  color: var(--text);
  border-color: var(--text);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  box-shadow: none;
}

.mode-menu {
  grid-column: 2;
  grid-row: 1 / span 7;
  align-self: center;
  width: 100%;
  max-width: 460px;
  margin: 0;
  gap: 1px;
  border-top: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  animation: fadeUp 0.5s 0.22s both;
}

#intro > .mode-menu {
  display: flex;
}

#intro > .mode-menu[hidden] {
  display: none !important;
}

/* 每周挑战暂时下线：保留功能代码，入口与预留内容不占首页空间。 */
#challengeCard[hidden],
#challengeGrid[hidden] {
  display: none !important;
}

#intro > .mode-menu::before {
  content: none;
}

.mode-menu::before {
  content: "选择比赛模式";
  display: block;
  padding: 17px 19px 15px;
  color: #fff;
  background: rgba(8, 8, 8, 0.93);
  font-family: "F1 Wide", sans-serif;
  font-size: 11px;
}

.mode-card {
  min-height: 84px;
  gap: 15px;
  padding: 17px 19px;
  color: #fff;
  border: 0;
  border-radius: 0;
  background: rgba(17, 18, 21, 0.94);
}

.mode-card.soon {
  opacity: 1;
}

.mode-card.soon .mode-txt,
.mode-card.soon .mode-ico {
  opacity: 0.47;
}

.mode-card.retro-on {
  transition: background-color 160ms ease;
}

.mode-card.retro-on:hover {
  border-color: transparent;
  background: #24262b;
}

.mode-ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #3b3d43;
  border-radius: 4px;
  font-size: 20px;
}

.mode-txt b {
  color: #fff;
  font-size: 15px;
}

.mode-txt small {
  margin-top: 4px;
  color: #92959c;
  line-height: 1.45;
}

.soon-badge,
.new-badge {
  top: 12px;
  right: 12px;
  padding: 4px 7px;
  color: #fff;
  border-radius: 2px;
  background: #4c4f56;
  box-shadow: none;
  transform: none;
  font-family: "F1 Wide", sans-serif;
  font-size: 7px;
}

.new-badge {
  color: #fff;
  background: var(--accent);
}

.new-badge::after {
  display: none;
}

.retro-caret {
  color: #c9cacc;
}

.decade-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1px 0 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.2);
}

.decade-grid .dec,
#challengeGrid .dec {
  min-height: 46px;
  padding: 8px 4px;
  color: #fff;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  box-shadow: none;
  font-family: "F1 Wide", sans-serif;
  font-size: 11px;
}

.decade-grid .dec:hover:not(:disabled) {
  background: var(--accent2);
}

.decade-grid .dec.locked,
.decade-grid .dec.dec-arch {
  color: #6f7279;
  border: 0;
  background: #17181c;
}

.decade-grid .dec.dec-count {
  color: #fff;
  border: 0;
  background: #93231f;
}

.dec-note {
  margin: 0;
  padding: 12px 10px;
  color: #8c8f96;
  background: #111215;
}

#intro > .news,
#intro > .legal {
  width: 100%;
  max-width: 640px !important;
  margin: 0 !important;
  font-size: 12px !important;
}

#intro > .news:first-of-type {
  margin-top: 8px !important;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

#intro > .news a {
  color: #ff625c !important;
}

#intro > .news + .news {
  display: none;
}

#intro p.legal {
  max-width: 640px;
  margin-top: 3px !important;
  color: #777a81;
  font-size: 9px !important;
  opacity: 1;
}

#identity,
#career {
  width: min(calc(100% - 48px), 1180px);
  max-width: none;
  min-height: 100svh;
  margin: 0 auto;
  padding: calc(var(--glory-header) + 54px) 0 70px;
}

#identity h2 {
  margin: 0;
  font-family: "F1 Wide", sans-serif;
  font-size: clamp(32px, 4vw, 48px);
  font-style: normal;
  line-height: 1.1;
}

#identity h2::before {
  content: "车手身份登记 / 01";
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: "F1 Wide", sans-serif;
  font-size: 10px;
}

#identity .lead {
  max-width: 640px;
  margin: 15px 0 40px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.id-grid {
  gap: 1px;
  border-top: 3px solid var(--accent);
  background: var(--line);
}

.card {
  padding: 24px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

.card::before {
  display: none;
}

.card h3 {
  margin-bottom: 20px;
  color: var(--muted);
  font-family: "F1 Wide", sans-serif;
  font-size: 10px;
  font-style: normal;
  text-align: left;
  letter-spacing: 0;
}

.numplate {
  width: 100%;
  height: 116px;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel2);
  box-shadow: none;
}

[data-theme="dark"] .numplate,
[data-theme="light"] .numplate {
  background: var(--panel2);
}

.numplate span {
  color: var(--text);
  font-family: "F1 Wide", sans-serif;
  font-size: 54px;
  font-style: normal;
}

.field label {
  margin: 14px 0 7px;
  color: var(--muted);
  font-family: "F1 Wide", sans-serif;
  font-size: 8px;
  letter-spacing: 0;
}

.field input {
  min-height: 46px;
  padding: 0 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel2);
  font-size: 14px;
  box-shadow: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.country-list {
  gap: 1px;
  margin-top: 10px;
  padding-right: 4px;
}

.country-list button,
[data-theme="dark"] .country-list button {
  min-height: 40px;
  padding: 7px 9px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--panel2);
  font-size: 12px;
}

.country-list button:hover {
  border-color: #686b72;
  transform: none;
}

.country-list button.sel,
[data-theme="dark"] .country-list button.sel {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: none;
}

.country-picker-trigger,
.country-picker-mobile-head,
.country-picker-backdrop {
  display: none;
}

.style-cards {
  gap: 1px;
  background: var(--line);
}

.style-cards button,
[data-theme="dark"] .style-cards button {
  min-height: 92px;
  padding: 15px;
  color: var(--text);
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: var(--panel2);
}

.style-cards button:hover {
  border-left-color: #777a80;
  transform: none;
  box-shadow: none;
}

.style-cards button.sel,
[data-theme="dark"] .style-cards button.sel {
  color: #fff;
  border-color: var(--accent);
  background: #101114;
  box-shadow: none;
}

.style-cards .t {
  font-size: 14px;
}

.style-cards .d {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
}

#identity .actions {
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.career-grid {
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 18px;
}

#driverCard,
.f1state,
.timeline {
  border-top: 3px solid var(--accent);
}

.driver-head {
  gap: 14px;
}

.ovr-badge {
  width: 76px;
  height: 76px;
  border-radius: 4px;
  background: var(--accent) !important;
  box-shadow: none;
}

.ovr-badge::after {
  display: none;
}

.ovr-badge .n {
  font-family: "F1 Wide", sans-serif;
  font-size: 24px;
  line-height: 1;
}

img.tlogo {
  object-fit: contain;
  padding: 2px;
  border-radius: 50%;
  background-color: var(--team-logo-bg, #5d6068);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.tag,
.mini-badge {
  border-radius: 2px;
  box-shadow: none;
}

.tag.red {
  color: #ff6963;
  border-color: rgba(225, 6, 0, 0.5);
  background: rgba(225, 6, 0, 0.12);
}

#teamLine {
  margin-top: 18px;
  font-size: 17px;
}

#teamLine .trole {
  border-radius: 2px;
}

.stats-row {
  gap: 1px;
  margin-top: 17px;
  background: var(--line);
}

.stat {
  padding: 10px 4px;
  border-radius: 0;
  background: var(--panel2);
}

.stat .v {
  font-family: "F1 Wide", sans-serif;
}

.decision {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.decision h3 {
  font-family: "F1 Wide", sans-serif;
  font-size: 20px;
  font-style: normal;
}

.decision p.outcome,
[data-theme="dark"] .decision p.outcome {
  color: var(--text);
  border: 1px solid #5e5126;
  border-radius: 4px;
  background: color-mix(in srgb, var(--gold) 9%, var(--panel));
}

#decRecap,
[data-theme="dark"] #decRecap {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0;
  background: var(--panel);
}

.offers {
  gap: 8px;
}

.offer,
[data-theme="dark"] .offer {
  min-height: 76px;
  padding: 13px 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 3px solid #60636a;
  border-radius: 4px;
  background: var(--panel);
  box-shadow: none;
}

.offer:hover {
  border-color: var(--accent);
  transform: translateX(3px);
  box-shadow: none;
}

.offer.retire,
[data-theme="dark"] .offer.retire {
  background: var(--panel2);
}

.offer.dilemma,
[data-theme="dark"] .offer.dilemma {
  border-color: #66591f;
  background: color-mix(in srgb, var(--gold) 7%, var(--panel));
}

.offer .role,
.trend,
.otrend,
.jprofile,
.fit {
  border-radius: 2px;
}

.f1state {
  margin-bottom: 14px;
  padding: 18px 20px;
}

.f1state h5 {
  font-family: "F1 Wide", sans-serif;
  font-size: 8px;
  letter-spacing: 0;
}

.f1state .srow {
  border-radius: 2px;
}

.timeline {
  overflow: hidden;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

.tl-head {
  color: #e1e2e3;
  background: #111215;
  font-family: "F1 Wide", sans-serif;
  font-size: 8px;
}

.tl-head span {
  font-family: inherit;
}

.tl-row {
  border-color: var(--line);
}

.tl-row:hover,
[data-theme="dark"] .tl-row:hover {
  background: var(--panel2);
}

.tl-row .age,
.pos,
.tl-row .ev.top3,
.tl-row .ovrcell,
.cmcell {
  border-radius: 2px;
}

.tl-row.champ,
[data-theme="dark"] .tl-row.champ {
  background: color-mix(in srgb, var(--gold) 10%, var(--panel));
}

#endModal,
#rankModal {
  z-index: 200;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(10px);
}

.rank-card,
.end-card {
  border: 1px solid #3b3d43;
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}

.end-card {
  --end-scroll-track: #111215;
  --end-scroll-thumb: #55585f;
  --end-scroll-thumb-hover: #777a82;
  scrollbar-width: thin;
  scrollbar-color: var(--end-scroll-thumb) var(--end-scroll-track);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

:root[data-theme="light"] .end-card {
  --end-scroll-track: #e8e8e4;
  --end-scroll-thumb: #96989c;
  --end-scroll-thumb-hover: #6f7176;
}

.end-card::-webkit-scrollbar {
  width: 8px;
}

.end-card::-webkit-scrollbar-track {
  background: var(--end-scroll-track);
  border-left: 1px solid var(--line);
}

.end-card::-webkit-scrollbar-thumb {
  min-height: 56px;
  border: 2px solid var(--end-scroll-track);
  border-radius: 999px;
  background: var(--end-scroll-thumb);
  background-clip: padding-box;
}

.end-card::-webkit-scrollbar-thumb:hover {
  background: var(--end-scroll-thumb-hover);
  background-clip: padding-box;
}

.end-card::-webkit-scrollbar-thumb:active {
  background: var(--accent);
  background-clip: padding-box;
}

.end-card::-webkit-scrollbar-button,
.end-card::-webkit-scrollbar-corner {
  display: none;
  background: transparent;
}

.rank-head,
.end-hero {
  border-radius: 0;
  background: #111215;
}

.rank-head {
  border-top: 3px solid var(--accent);
}

.rank-head h2,
.end-hero h2 {
  font-family: "F1 Wide", sans-serif;
  font-style: normal;
}

.rank-x {
  border: 1px solid #4d5057;
  border-radius: 4px;
  background: transparent;
}

.rank-tabs {
  gap: 1px;
}

.rank-tabs button {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel2);
}

.rank-tabs button.on {
  border-color: var(--accent);
  background: var(--accent);
}

@media (max-width: 700px) {
  .rank-tabs button {
    min-width: 0;
    padding-inline: 4px;
    font-size: 12px;
    white-space: nowrap;
  }
}

.rank-row,
.hall .hrow,
.legend-score,
.end-stats > div {
  border-radius: 2px;
}

.end-hero {
  padding-top: 34px;
  border-top: 4px solid var(--accent);
}

.end-hero::after {
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

#reopenBtn {
  border-radius: 4px;
  background: var(--accent);
  box-shadow: none;
}

#reopenBtn {
  bottom: 22px;
}

#previewBar {
  bottom: 16px;
  padding: 8px 14px;
  border: 1px solid #3b3d43;
  border-radius: 4px;
  background: #111215;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.era-picker-open {
  overflow: hidden;
}

.era-picker {
  position: fixed;
  z-index: 250;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.era-picker[hidden] {
  display: none;
}

.era-picker-backdrop {
  position: absolute;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  cursor: default;
}

.era-picker-dialog {
  position: relative;
  width: min(520px, 100%);
  color: var(--text);
  border: 1px solid #3b3d43;
  border-top: 4px solid var(--accent);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  animation: fadeUp 220ms ease-out both;
}

.era-picker-header {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.era-picker-header span {
  display: block;
  margin-bottom: 9px;
  color: var(--accent2);
  font-family: "F1 Wide", sans-serif;
  font-size: 8px;
}

.era-picker-header h2 {
  margin: 0;
  font-family: "F1 Wide", sans-serif;
  font-size: 24px;
  font-style: normal;
  line-height: 1.15;
}

.era-picker-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.era-picker-close:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.era-year-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.era-year {
  min-width: 0;
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--text);
  border: 0;
  border-radius: 0;
  background: var(--panel2);
  font-family: "F1 Wide", sans-serif;
  font-size: 27px;
  transition: color 160ms ease, background-color 160ms ease;
}

.era-year:hover,
.era-year:focus-visible {
  color: #fff;
  background: var(--accent);
}

@media (max-width: 1040px) {
  .glory-nav a:not(.is-active) {
    display: none;
  }

  #intro {
    column-gap: 44px;
  }
}

@media (max-width: 820px) {
  :root,
  :root[data-theme="dark"] {
    --glory-header: 64px;
  }

  .glory-header-inner {
    width: min(calc(100% - 32px), 1180px);
    transition: opacity 160ms ease, transform 180ms ease;
  }

  .glory-site-header {
    transition: height 180ms ease, border-color 180ms ease;
  }

  .mobile-career-hud {
    position: absolute;
    inset: 0 16px;
    display: grid;
    grid-template-columns: minmax(84px, 1.35fr) repeat(3, minmax(0, 0.78fr));
    align-items: stretch;
    color: #fff;
    opacity: 0;
    transform: translateY(-7px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 180ms ease;
  }

  :root[data-theme="light"] .mobile-career-hud {
    color: var(--glory-ink);
  }

  .mobile-career-context,
  .mobile-career-metric {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .mobile-career-context {
    padding-right: 10px;
    border-left: 3px solid var(--accent);
    padding-left: 10px;
  }

  .mobile-career-context span,
  .mobile-career-metric span {
    overflow: hidden;
    color: #92949a;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-career-context strong {
    overflow: hidden;
    margin-top: 4px;
    font-family: "F1 Wide", sans-serif;
    font-size: 12px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-career-metric {
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
  }

  :root[data-theme="light"] .mobile-career-metric {
    border-left-color: rgba(17, 18, 21, 0.14);
  }

  :root[data-theme="light"] .mobile-career-context span,
  :root[data-theme="light"] .mobile-career-metric span {
    color: #686a70;
  }

  .mobile-career-metric > strong {
    margin-top: 4px;
    font-family: "F1 Wide", sans-serif;
    font-size: 16px;
    line-height: 1;
  }

  .mobile-career-titles > strong {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f4c430;
  }

  .mobile-career-titles i {
    font-size: 12px;
    font-style: normal;
  }

  .mobile-career-titles b {
    font-family: inherit;
    font-weight: 700;
  }

  body.mobile-career-scrolled .glory-site-header {
    height: 58px;
    border-bottom-color: rgba(225, 6, 0, 0.64);
  }

  :root[data-theme="light"] body.mobile-career-scrolled .glory-site-header {
    border-bottom-color: rgba(225, 6, 0, 0.42);
    background: rgba(247, 247, 245, 0.97);
  }

  body.mobile-career-scrolled .glory-header-inner {
    opacity: 0;
    transform: translateY(-7px);
    pointer-events: none;
  }

  body.mobile-career-scrolled .mobile-career-hud {
    opacity: 1;
    transform: translateY(0);
  }

  .glory-brand {
    font-size: 16px;
  }

  .glory-brand img {
    width: 34px;
    height: 34px;
  }

  .glory-brand small,
  .glory-nav {
    display: none;
  }

  #intro {
    min-height: 100svh;
    grid-template-columns: 1fr;
    row-gap: 17px;
    padding: calc(var(--glory-header) + 58px) 24px 56px;
    background:
      linear-gradient(180deg, rgba(8, 8, 8, 0.68) 0%, rgba(8, 8, 8, 0.96) 43%, #080808 100%),
      url("../images/hero-bg.jpg") 58% top / auto 530px no-repeat,
      #080808;
  }

  :root[data-theme="light"] #intro {
    background:
      linear-gradient(180deg, rgba(232, 232, 228, 0.2) 0%, rgba(232, 232, 228, 0.9) 34%, #e8e8e4 66%),
      url("../images/hero-bg.jpg") 58% top / auto 530px no-repeat,
      #e8e8e4;
  }

  :root[data-theme="light"] #intro h1 {
    color: var(--glory-ink);
  }

  :root[data-theme="light"] #intro .flag,
  :root[data-theme="light"] #intro > p {
    color: #55585e;
  }

  :root[data-theme="light"] #intro .flag span + span,
  :root[data-theme="light"] #intro > .news:first-of-type {
    border-color: rgba(17, 18, 21, 0.2);
  }

  :root[data-theme="light"] #intro p.legal {
    color: #686a70;
  }

  :root[data-theme="light"] .intro-rank-btn {
    color: var(--glory-ink);
    border-color: #77797e;
    background: rgba(255, 255, 255, 0.56);
  }

  :root[data-theme="light"] .intro-rank-btn:hover {
    color: #fff;
    border-color: #111215;
    background: #111215;
  }

  #intro .flag,
  #intro h1,
  #intro > p,
  #intro > .intro-actions,
  .mode-menu {
    grid-column: 1;
  }

  #intro h1 {
    font-size: clamp(42px, 12vw, 62px);
  }

  .mode-menu {
    grid-row: auto;
    max-width: none;
    margin-top: 18px;
  }

  #identity,
  #career {
    width: min(calc(100% - 32px), 1180px);
    padding-top: calc(var(--glory-header) + 38px);
  }

  /* iOS Safari zooms the page when a focused input is rendered below 16px. */
  #identity .field input {
    font-size: 16px;
  }

  body.country-picker-open {
    overflow: hidden;
  }

  #cardCountry {
    position: static;
  }

  #cardStyle {
    scroll-margin-top: calc(var(--glory-header) + 12px);
  }

  .country-picker-trigger {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 14px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel2);
    text-align: left;
  }

  .country-picker-trigger > span {
    min-width: 0;
    display: grid;
    gap: 5px;
  }

  .country-picker-trigger small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
  }

  .country-picker-trigger strong {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .country-picker-trigger svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: var(--accent2);
  }

  .country-picker-backdrop {
    position: fixed;
    z-index: 299;
    inset: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(7px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .country-picker-body {
    position: fixed;
    z-index: 300;
    inset: auto 0 0;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(78dvh, 720px);
    display: flex;
    flex-direction: column;
    padding: 0 16px calc(14px + env(safe-area-inset-bottom));
    border-top: 4px solid var(--accent);
    color: var(--text);
    background: var(--panel);
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.55);
    transform: translateY(104%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms;
  }

  .country-picker-mobile-head {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
  }

  .country-picker-mobile-head span {
    color: var(--accent2);
    font-family: "F1 Wide", sans-serif;
    font-size: 8px;
  }

  .country-picker-mobile-head h4 {
    margin-top: 7px;
    font-family: "F1 Wide", sans-serif;
    font-size: 18px;
  }

  .country-picker-mobile-head button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
  }

  .country-picker-mobile-head svg {
    width: 19px;
    height: 19px;
  }

  .country-picker-body .country-search {
    flex: 0 0 auto;
  }

  .country-picker-body .country-list {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .country-picker-body .country-list button {
    min-height: 48px;
    font-size: 13px;
  }

  body.country-picker-open .country-picker-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  body.country-picker-open .country-picker-body {
    transform: translateY(0);
    visibility: visible;
  }

  .id-grid,
  .id-grid.duo,
  .id-grid.cuatro {
    grid-template-columns: 1fr;
  }

  .career-grid {
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .ovr-badge .n {
    font-size: 22px;
  }

  .glory-exit span:last-child {
    display: none;
  }

  .glory-exit {
    width: 40px;
    justify-content: center;
    padding: 0;
    font-size: 18px;
  }

  #intro {
    padding-inline: 18px;
  }

  #intro .flag {
    gap: 10px;
    font-size: 8px;
  }

  #intro .flag span + span {
    padding-left: 10px;
  }

  #intro > p {
    font-size: 14px;
  }

  #intro > .intro-actions {
    width: 100%;
  }

  #intro > .intro-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 14px;
    white-space: nowrap;
  }

  .decade-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #identity,
  #career {
    width: calc(100% - 20px);
  }

  #identity h2 {
    font-size: 31px;
  }

  .card {
    padding: 16px;
  }

  #identity .actions {
    flex-wrap: wrap;
  }

  #identity .actions .btn {
    flex: 1 1 150px;
  }

  .agev {
    padding-right: 0;
  }

  .f1state .cols {
    grid-template-columns: 1fr;
  }

  .end-body {
    padding: 0 18px;
  }

  .era-picker {
    align-items: center;
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  }

  .era-picker-dialog {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
  }

  .era-picker-header {
    min-height: 96px;
    padding: 18px;
  }

  .era-picker-header h2 {
    font-size: 21px;
  }

  .era-year {
    min-height: 92px;
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .glory-site-header {
    display: none !important;
  }
}
