@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;
  /* Team Principal rating colors stay fixed across themes. */
  --tp-car-star-full: #f7f7f5;
  --tp-car-star-empty: #9b9da3;
  --tp-driver-star-full: #f4c430;
  --tp-driver-star-potential: #3d8bd4;
  --tp-driver-star-empty: #6f737c;
  --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;
  --tp-car-star-full: #111215;
  --tp-car-star-empty: #9b9da3;
  --tp-driver-star-full: #f4c430;
  --tp-driver-star-potential: #3d8bd4;
  --tp-driver-star-empty: #6f737c;
  --shadow: 0 12px 30px rgba(17, 18, 21, 0.09);
}

/* These classes are used by the original Team Principal star markup. Keep the
   semantic colors independent from the light/dark text palette. */
.st-c{color:var(--tp-driver-star-full)!important}
.st-p{color:var(--tp-driver-star-potential)!important}
.st-e{color:var(--tp-driver-star-empty)!important}
.perfwrap .st-c,.perfwrap .st-e{color:var(--tp-car-star-full)!important}

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;
  top:0;right:0;bottom:auto;left:0;
  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);
  -webkit-backdrop-filter:blur(14px);
  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 {
  max-width:1180px;width:calc(100% - 48px);
  width: min(calc(100% - 48px), 1180px);
  height: 100%;
  margin-left:auto;margin-right:auto;
  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:18px;
  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.is-active {
  color: #fff;
}

@media (hover: hover) {
  .glory-nav a:hover {
    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;
}

@media (hover: hover){
#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);
}

@media (hover: hover){
: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;
}

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

#intro {
  min-height:820px;min-height:max(820px, 100vh);
  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:54px;
  column-gap: clamp(54px, 8vw, 118px);
  row-gap: 19px;
  padding:calc(var(--glory-header) + 66px) 24px 66px;
  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;
  top:var(--glory-header);right:auto;bottom:0;left:0;
  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;
  top:auto;right:0;bottom:0;left:0;
  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:48px;
  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 i[data-lucide="trophy"],
.intro-rank-btn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: block;
}

@media (hover: hover){
.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;
}

@media (hover: hover){
.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;
}

@media (hover: hover){
.btn.ghost:hover,
.btn.line:hover {
  color: var(--text);
  border-color: var(--text);
  background:rgba(128,128,128,0.1);
  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;
}

@media (hover: hover){
.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;
}

@media (hover: hover){
.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 {
  max-width:1180px;width:calc(100% - 48px);
  width: min(calc(100% - 48px), 1180px);
  max-width: none;
  min-height:100vh;
  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:32px;
  font-size: clamp(32px, 4vw, 48px);
  font-style: normal;
  line-height: 1.1;
}

#identity h2::before {
  content: attr(data-section);
  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 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

#identity #tpNotas {
  width: 100%;
  max-width: none;
  margin: 0 0 18px;
  text-align: left;
}

#identity #tpNotas > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  padding: 15px 22px 12px !important;
  border-top: 3px solid var(--accent);
  border-radius: 0 !important;
  background: var(--panel2) !important;
}

#identity #tpNotas > div > div:first-child {
  grid-column: 1 / -1;
  margin: 0 0 5px !important;
  color: var(--text);
  font-family: "F1 Wide", sans-serif;
  font-size: 13px;
}

#identity #tpNotas > div > div:not(:first-child) {
  min-width: 0;
  margin: 0 !important;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

#identity #tpNotas > div > div:last-child {
  grid-column: 1 / -1;
}

.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 rgba(225,6,0,0.2);
  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;
}

@media (hover: hover){
.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);
}

@media (hover: hover){
.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:var(--panel);
  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;
}

@media (hover: hover){
.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:var(--panel);
  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);
}

@media (hover: hover){
.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:var(--panel);
  background: color-mix(in srgb, var(--gold) 10%, var(--panel));
}

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

#tpGridModal {
  display: none;
  position: fixed;
  top:0;right:0;bottom:0;left:0;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

#tpGridModal[aria-hidden="false"] {
  pointer-events: auto;
}

#tpGridModal .rank-card {
  width:100%;max-width:720px;
  width: min(720px, 100%);
  max-height:calc(100vh - 32px);
  max-height: min(760px, calc(100vh - 32px));
  overflow: hidden;
}

#tpGridModal .rank-list {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

/* Team Principal grid: compact team and driver hierarchy from the source layout. */
#tpGridList {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

#tpGridList .pt-tier {
  margin: 12px 4px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .6px;
  line-height: 1.35;
  text-transform: uppercase;
}

#tpGridList .pt-tier:first-child { margin-top: 2px; }

#tpGridList .pt-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

#tpGridList .pt-row > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tpGridList .pt-row > span[style*="color:var(--muted)"] {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

#tpGridList .pt-row > div {
  flex-basis: 100%;
  min-width: 100%;
}

#tpGridList .pt-row .drv {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

#tpGridList .pt-row .drv b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

#tpGridList .pt-row .pos {
  display: inline-block;
  width: auto;
  margin-left: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  vertical-align: middle;
}

#tpGridList .pt-row .pos.nada {
  background: var(--panel2);
  color: var(--muted);
}

#tpGridList .pt-row .pos.p1 { box-shadow: 0 1px 3px rgba(242, 174, 0, .45); }
#tpGridList .pt-row .pos.p2 { box-shadow: inset 0 0 0 1.2px #aab2c0; }

#tpGridList .pt-row.mio .drv {
  border-color:var(--tc) !important;
  border-color: color-mix(in srgb, var(--tc) 45%, transparent) !important;
  background: var(--panel) !important;
}

.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-left:4px;padding-right:4px;
    padding-inline: 4px;
    font-size: 12px;
    white-space: nowrap;
  }
}

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

/* 排名与姓名保持紧凑，分数继续贴右显示。 */
#rankModal .rank-row {
  gap: 6px;
}

#rankModal .rank-row .rk {
  width: 26px;
  flex: 0 0 26px;
}

/* 排行榜中的本人行与车手生涯保持同一套红色强调。 */
#rankList .rank-row.me,
#rankMe .rank-row.me {
  background: rgba(225, 6, 0, 0.12) !important;
  border: 1px solid rgba(225, 6, 0, 0.38) !important;
  font-weight: 800;
}

.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;
  top:0;right:0;bottom:0;left:0;
  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;
  top:0;right:0;bottom:0;left:0;
  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);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter: blur(10px);
  cursor: default;
}

.era-picker-dialog {
  position: relative;
  width:100%;max-width:520px;
  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;
}

@media (hover: hover){
.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;
}

@media (hover: hover){
.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) {
  #identity #tpNotas > div {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left:16px !important;padding-right:16px !important;
    padding-inline: 16px !important;
  }

  #identity #tpNotas > div > div:last-child {
    grid-column: auto;
  }

  :root,
  :root[data-theme="dark"] {
    --glory-header: 64px;
  }

  .glory-header-inner {
    max-width:1180px;width:calc(100% - 32px);
    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;
    top:0;bottom:0;right:16px;left:16px;
    inset: 0 16px;
    display: grid;
    grid-template-columns: minmax(84px, 1.35fr) repeat(3, minmax(0, 0.78fr));
    grid-template-rows: 58px;
    align-items: stretch;
    color: #fff;
    opacity: 0;
    transform: translateY(-7px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 180ms ease;
  }

  /* Mobile decisions are reflected by the fixed data HUD. Do not render the
     separate gold result paragraph; the original Continue button is untouched. */
  #decSub.outcome {
    display: none;
  }

  :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:100vh;
    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);
  }

  @media (hover: hover) {
    :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:42px;
    font-size: clamp(42px, 12vw, 62px);
  }

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

  #identity,
  #career {
    max-width:1180px;width:calc(100% - 32px);
    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;
    top:0;right:0;bottom:0;left:0;
    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);
    -webkit-backdrop-filter:blur(7px);
    backdrop-filter: blur(7px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .country-picker-body {
    position: fixed;
    z-index: 300;
    top:auto;right:0;bottom:0;left:0;
    inset: auto 0 0;
    right: 0;
    left: 0;
    bottom: var(--f1-kb, 0px); /* 老内核键盘弹出时抬起（C108+ 由 interactive-widget 自动处理） */
    max-height:78vh;
    max-height:min(78vh, 720px);
    max-height: min(78dvh, 720px);
    max-height:calc(min(78dvh, 720px) - var(--f1-kb, 0px));
    min-height:300px; /* 搜索过滤结果变少时弹窗不塌缩 */
    min-height:calc(min(56vh, 460px) - var(--f1-kb, 0px));
    min-height:calc(min(56dvh, 460px) - var(--f1-kb, 0px));
    display: flex;
    flex-direction: column;
    padding:0 16px 14px;
    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-left:18px;padding-right:18px;
    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-left:14px;padding-right:14px;
    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:12px;
    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;
  }
}

/* Restore the original f1-glory result modal styling.
   The Team Principal additions above intentionally share tokens with the
   career screen, but must not flatten the original end-of-career presentation. */
#endModal {
  display: none;
  position: fixed;
  top:0;right:0;bottom:0;left:0;
  inset: 0;
  padding: 20px;
  align-items: center;
  justify-content: center;
  z-index: 50;
  background: rgba(21, 21, 30, 0.45);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter: blur(6px);
}

#endModal .end-card {
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  padding: 0 0 34px;
  overflow-y: auto;
  text-align: center;
  border: 0;
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(21, 21, 30, 0.35);
}

#endModal .end-hero {
  position: relative;
  margin-bottom: 22px;
  padding: 30px 34px 22px;
  overflow: hidden;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(135deg, #15151e 0%, #2b0a08 55%, #e10600 140%);
}

#endModal .end-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 10px;
  background: repeating-conic-gradient(#15151e 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
  opacity: 0.85;
}

#endModal .end-hero h2 {
  margin: 8px 0 2px;
  color: #fff;
  font-family: "F1 Wide", sans-serif;
  font-size: 30px;
  font-style: normal;
  font-weight: 900;
}

#endModal .end-hero .flag-line {
  font-size: 24px;
  letter-spacing: 4px;
}

#endModal .end-hero .legacy {
  margin-bottom: 4px;
  color: transparent;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(92deg, #ffce3a, #ffb800, #ffe066);
  background-clip: text;
  -webkit-background-clip: text;
}

#endModal .end-hero .years {
  padding-bottom: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

#endModal .end-body {
  padding: 0 34px;
}

#endModal .end-stats > div,
#endModal .legend-score,
#endModal .hall .hrow {
  border-radius: 9px;
}

#endModal .end-stats > div {
  padding: 9px 6px;
  background: var(--panel2);
}

#endModal .hall .hrow {
  padding: 6px 12px;
}

#endModal .end-card .shelf {
  margin-bottom: 6px;
  font-size: 26px;
  line-height: 1.5;
  letter-spacing: 5px;
}

#endModal .end-card .verdict {
  margin: 14px 0 20px;
  color: #4a4a55;
  font-size: 14.5px;
  line-height: 1.55;
}

@media (max-width: 520px) {
  #endModal .end-card {
    max-height: 96vh;
    border-radius: 0 0 18px 18px;
  }
  #endModal .end-hero {
    margin-bottom: 22px;
    padding: 24px 18px 22px;
  }
  #endModal .end-body {
    width: 100%;
    padding: 0 18px;
  }

  #endModal .end-stats > div {
    padding: 7px 4px;
    border-radius: 9px;
  }
}

/* 车队经理结算页：获得冠军的统计卡使用源站的金色填充高亮。 */
#endModal .end-stats > div.gold {
  background: linear-gradient(160deg, #ffe6a0 0%, #f3c866 100%);
  border: 1px solid #dfae3c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
#endModal .end-stats > div.gold .v {
  color: #6f4e00;
}
#endModal .end-stats > div.gold .k {
  color: #7c5e0f;
}

/* 车队经理排行榜只有一个榜单，不需要重复的模式切换行。 */
#rankModal #rankTabs {
  display: none !important;
}

/* Match the career ranking: content-sized, with scrolling only at the viewport limit. */
#rankModal .rank-card {
  max-height: 88vh;
  max-height: 88dvh;
  animation: none;
}

#rankModal .rank-head,
#rankModal .rank-me {
  flex-shrink: 0;
}

#rankModal .rank-me:empty {
  display: none;
}

#rankModal .rank-list {
  min-height: 0;
  overscroll-behavior: contain;
}

/* Team Principal 结算页：与 F1 Glory 原站一致的维修区历程布局。 */
#endModal .hall {
  margin: 28px 0 18px;
  text-align: left;
}
#endModal .hall h4 {
  margin: 0 0 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
#endModal .hall .hrow.tpst {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 8px 12px;
  align-items: center;
  margin: 0 4px 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}
#endModal .hall .hrow.tpst .nm {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  font-size: 17px;
  font-weight: 800;
}
#endModal .hall .hrow.tpst .nm .yrs {
  color: var(--muted);
  font-weight: 700;
}
#endModal .hall .hrow.tpst .tt {
  color: #c58a08;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}
#endModal .hall .hrow.tpst .posline {
  display: flex;
  grid-column: 1 / -1;
  gap: 5px;
  padding-left: 0;
}
#endModal .hall .hrow.tpst .pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--panel2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
#endModal .hall .hrow.tpst .pos.p1 {
  background: #ffcf3f;
  color: #714d00;
}
#endModal .hall .hrow.tpst .pos.top {
  background: #c9f0d3;
  color: #178247;
}
#endModal .hall .hrow:not(.tpst) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0 4px 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* 结算摘要沿用 F1 Glory 源站的普通摘要布局：TP 只替换内容，不放大弹窗或改造历程行。 */
#endModal .hall {
  margin: 0 0 22px;
  text-align: left;
}
#endModal .hall h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-align: center;
}
#endModal .hall .hrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
}
#endModal .hall .hrow.tpst {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  grid-template-columns: none;
  grid-template-rows: none;
  gap: 0;
  margin: 0;
  padding: 6px 12px;
}
#endModal .hall .hrow.tpst .nm {
  display: block;
  flex: 1;
  min-width: 0;
  font-size: inherit;
  font-weight: inherit;
}
#endModal .hall .hrow.tpst .tt {
  padding-top: 1px;
  color: var(--gold);
  font-size: inherit;
  font-weight: 800;
}
#endModal .hall .hrow.tpst .posline {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 100%;
  margin-top: 5px;
}
#endModal .hall .hrow.tpst .posline .pos {
  display: inline-block;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: var(--panel2);
  color: var(--text);
  font-size: 10.5px;
  box-shadow: none;
}
#endModal .hall .hrow.tpst .posline .pos.p1 {
  /* 与同一摘要里行首冠军徽章（#ffcf3f）保持同一种金：var(--gold) 在亮色主题下
     是暗芥末色（#c98f00），在成排的浅色胶囊里显得发闷，玩家反馈“背景色不对”。 */
  background: #ffcf3f;
  color: #714d00;
  box-shadow: 0 1px 3px rgba(242, 174, 0, .45);
}
#endModal .hall .hrow.tpst .posline .pos.p2 {
  background: linear-gradient(135deg, #fafbfe, #c4cad6);
  color: #3a4150;
  box-shadow: inset 0 0 0 1.5px #aab2c0;
}
#endModal .hall .hrow:not(.tpst) {
  display: flex;
  grid-template-columns: none;
  gap: 0;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 520px) {
  #endModal .hall .hrow.tpst .nm { font-size: 15px; }
  #endModal .hall .hrow.tpst .tt { font-size: 13px; }
  #endModal .hall .pos { min-width: 56px; padding-left:7px;padding-right:7px;padding-inline: 7px; }
}

@media (max-width: 520px) {
  #tpGridModal { padding: 10px; }
  #tpGridModal .rank-card {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }
  #tpGridModal .rank-head { padding: 12px 14px; }
  #tpGridModal .rank-head h2 { font-size: 16px; }
  #tpGridModal .rank-list {
    max-height: calc(100vh - 108px);
    padding: 7px 10px 14px;
  }
  #tpGridList { gap: 5px; }
  #tpGridList .pt-row {
    gap: 5px;
    padding: 7px 8px;
    font-size: 13px;
  }
  #tpGridList .pt-row .drv { font-size: 11.5px; }
  #tpGridList .pt-row .pos {
    padding: 1px 5px;
    font-size: 10px;
  }
}

/* 触屏设备没有悬停：点按会给按钮套上 :hover 并"粘"在按钮上（决策选项上的
   红框就是 .offer:hover 的 accent 描边被粘住）。上面的悬停效果只在支持悬停的
   输入设备生效；触屏改用轻微的按压反馈。 */
@media (hover: none) {
  .offer:active {
    transform: scale(.985);
  }
}

/* ================= 🧑‍💼 老板面板：九行布局（移植自 f1-glory.com，所有宽度生效） =================
   源站 Carlos，9 月 20-23 日：车队经理的车手卡不再是「大徽章+标签堆」，
   而是九行信息——姓名/国籍/声望 · 赛车/车队/合同 · 车手席位卡片 · 老板 ·
   董事会 · 目标 · 赛季标题 · 数据 · 荣誉室。旧元素保留但隐藏，数据照常写入。 */

/* 决策页里的席位条副本全部隐藏：席位卡片显示在 PANEL 页（源站 9 月 22 日） */
.garwrap { display: none; }
#panelGaraje { display: none; }
#tpPanelA, #tpPanelB, #tpSeasonHead { display: none; }

#career #driverCard.tp { display: flex; flex-direction: column; }
#career #driverCard.tp .driver-head,
#career #driverCard.tp .team { display: none; }
#career #driverCard.tp #tpPanelA { display: block; order: 1; }
#career #driverCard.tp #panelGaraje { order: 2; border-top: 0; padding-top: 0; }
#career #driverCard.tp #tpPanelB { display: block; order: 3; margin-top: 9px; border-top: 1px solid var(--line); padding-top: 7px; }
#career #driverCard.tp #tpSeasonHead { display: block; order: 4; margin-top: 9px; border-top: 1px solid var(--line); padding-top: 7px; font-size: 12px; }
#career #driverCard.tp #tpSeasonHead .k { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
#career #driverCard.tp .stats-row { order: 5; margin-top: 6px; border-top: 0; padding-top: 0; }
#career #driverCard.tp .trophies { order: 6; }

/* 第一行：姓名 · 国籍 · 声望 */
.tpl-l1 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.tpl-l1 > b { font-size: 13.5px; letter-spacing: .02em; }
.tpl-nat { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.tpl-right { margin-left: auto; font-size: 11px; }
.tpl-con { color: var(--muted); font-weight: 700; font-size: 11px; white-space: nowrap; flex-shrink: 0; }
/* 第二行：赛车徽章 + 队徽 + 车队名 · 合同 */
.tpl-l2 { display: flex; align-items: center; gap: 5px; margin-top: 9px; min-width: 0; }
.tpl-l2 .team-dot { width: 24px; height: 24px; flex-shrink: 0; }
.tpl-car {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 900;
}
.tpl-car .n { font-size: 20px; line-height: 1; }
.tpl-car .l { font-size: 7.5px; letter-spacing: 1px; opacity: .9; }
.tpl-l2r { min-width: 0; flex: 1; }
.tpl-l2a { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tpl-team { font-weight: 800; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-con { margin-top: 2px; }
/* 老板 · 董事会 · 目标 · 队长的任性 */
.tpl-kv { font-size: 12px; margin: 4px 0; line-height: 1.45; }
.tpl-kv .k { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
/* 车库席位卡片：细边框 + 队色左肩条 */
#panelGaraje .gpil { border: 1px solid var(--line); border-left: 3px solid var(--team, var(--line)); border-radius: 8px; padding: 5px 9px; margin: 6px 0; background: var(--panel2); }
#panelGaraje .gpil.libre { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; }
#panelGaraje .gp1 { font-weight: 700; font-size: 12.5px; }
#panelGaraje .gp2 { font-size: 11px; color: var(--muted); margin-top: 1px; }
#panelGaraje .gpil.gswap { cursor: pointer; font-weight: 700; font-size: 12px; user-select: none; }
#career #driverCard.tp #teamRole { display: none; }
#career #driverCard.tp .stats-row { grid-template-columns: repeat(3, 1fr); }
#career #driverCard.tp .stats-row .stat:first-child { display: none; }
#career #driverCard.tp #panelGaraje { display: block; margin-top: 9px; }

/* 📱 牌组里老板面板的字放大一档（窄屏上卡片占满宽度，有空间） */
@media (max-width: 980px) {
  body.deck-movil .tpl-l1 { font-size: 14px; }
  body.deck-movil .tpl-l1 > b { font-size: 17px; }
  body.deck-movil .tpl-nat { font-size: 13px; }
  body.deck-movil .tpl-right { font-size: 13.5px; }
  body.deck-movil .tpl-team { font-size: 16px; }
  body.deck-movil .tpl-con { font-size: 12.5px; }
}

/* ========== 🏗️ 创建你自己的车队（移植自原站 TU PROPIO EQUIPO，2026-09-27） ========== */
.fund{width:100%;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card,16px);padding:14px 16px;display:flex;flex-direction:column;gap:8px;box-shadow:var(--shadow)}
.fund-l{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.fund-in{font:inherit;font-size:17px;font-weight:700;color:var(--text);background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:10px 12px;width:100%}
.fund-in:focus{outline:2px solid var(--accent);outline-offset:1px}
.fund-pal{display:flex;flex-wrap:wrap;gap:10px;margin-top:2px}
.fund-sw{border:2px solid transparent;background:none;border-radius:50%;padding:3px;cursor:pointer;line-height:0}
.fund-sw .team-dot{width:44px;height:44px}
.fund-sw.on{border-color:var(--text)}
.fund-mix .team-dot{display:flex;align-items:center;justify-content:center;font-size:20px;background:var(--panel2);border:1.5px dashed var(--muted)}
.fund-err{font-size:13px;color:var(--accent);min-height:0}
.fund-err:empty{display:none}
/* 🏛️ 输入名称时提示的真实品牌 */
.fund-sug{display:flex;flex-direction:column;gap:6px}
.fund-sug:empty{display:none}
.fund-sug button{display:flex;align-items:center;gap:10px;width:100%;text-align:left;font:inherit;color:var(--text);background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:6px 10px;cursor:pointer}
.fund-sug .team-dot,.fund-real .team-dot{width:34px;height:34px;flex-shrink:0}
.fund-sug b{font-size:15px}
.fund-sug small{display:block;color:var(--muted);font-size:12px}
.fund-real{display:flex;align-items:center;gap:12px;background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.fund-real .team-dot{width:48px;height:48px}
.fund-real .sw2{display:inline-block;width:18px;height:18px;border-radius:5px;vertical-align:middle;margin-right:4px;border:1px solid rgba(0,0,0,.15)}
.fund-real button{margin-left:auto;font:inherit;font-size:12px;color:var(--muted);background:none;border:none;text-decoration:underline;cursor:pointer}

/* ========== 🧠 车队经理赛季判定徽章（时间线行内，移植自原站） ========== */
.tp-verdict{grid-column:2/-1;justify-self:start;display:inline-block;font-size:12px;font-weight:800;margin:4px 0 2px;padding:4px 10px;border-radius:8px}
.tp-verdict.ok{background:rgba(18,146,63,.13);color:#12923f}
.tp-verdict.titulo{background:linear-gradient(90deg,rgba(230,179,37,.2),transparent);color:#b3860a}
.tp-verdict.gracia{background:rgba(201,138,30,.14);color:#b47417}
.tp-verdict.fallo{background:rgba(225,6,0,.10);color:#c62222}
.tp-verdict.fuera{background:rgba(225,6,0,.16);color:#c62222}
.tp-verdict.fundacion{background:rgba(18,146,63,.10);color:#3d7a52}
.tl-row.tp .tp-verdict{line-height:1.5;margin-top:6px;display:block;width:100%}
#career .tl-row .tp-verdict{grid-column:1/-1;justify-self:start}
[data-theme="dark"] .tp-verdict.ok{color:#4cd07f}
[data-theme="dark"] .tp-verdict.titulo{color:#e6b325}
[data-theme="dark"] .tp-verdict.fallo,[data-theme="dark"] .tp-verdict.fuera{color:#ff7a72}
[data-theme="dark"] .tp-verdict.fundacion{color:#7cc79a}

/* ========== 🛡️ 车队徽章（首字母剪影 + 双色配色，移植自原站 .spbadge） ========== */
.spbadge{border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  vertical-align:middle;flex:none;
  /* 刻意扁平：不带白边和阴影，徽章要像它的 PNG 一样干净 */
  border:none !important; box-shadow:none !important; text-shadow:none}
.spbadge i{display:block;width:82%;height:82%}
.spbadge img{display:block;width:82%;height:82%;object-fit:contain;border:none;box-shadow:none}
.spbadge.mb{width:20px;height:20px}

/* ========== 🎬 创建面板动效（沿用游戏 fadeUp 入场 + 位移过渡语言） ========== */
#offerList .fund{animation:fadeUp 220ms ease-out both}
#offerList .fund ~ .offer{animation:fadeUp 220ms ease-out both;animation-delay:60ms}
.fund-sw{transition:transform .12s ease,border-color .12s ease}
@media (hover: hover){ .fund-sw:hover{transform:translateY(-2px)} }
.fund-sw.on{transform:translateY(-2px)}
.fund-sw:active{transform:translateY(0) scale(.94)}
.fund-sug button,.fund-real{transition:border-color .12s ease,transform .12s ease}
@media (hover: hover){ .fund-sug button:hover{border-color:var(--accent);transform:translateX(3px)} }

/* ========== 低版本 WebView (Chrome 66-83) flex gap 兜底 ==========
   flex 容器的 gap 到 Chrome 84 才生效（grid 的 gap 66 就有，
   所以不能用 @supports not (gap:...) 探测）。
   组合条件精确命中 66-83：gap 可用(66+) 且 appearance 未加前缀不存在(84+) 且 inset 不存在(87+)。
   C84+ 全部为假，不影响现代浏览器。 */
@supports (gap: 1px) and (not (appearance: auto)) and (not (inset: 0)) {
  .glory-header-inner > * + * { margin-left: 24px; }
  .glory-nav > * + * { margin-left: 24px; }
  .glory-header-actions > * + * { margin-left: 9px; }
  .glory-brand > * + * { margin-left: 10px; }
  #intro .flag > * + * { margin-left: 16px; }
  #intro > .intro-actions > * + * { margin-left: 10px; }
  .btn > * + * { margin-left: 12px; }
  .era-picker-header > * + * { margin-left: 24px; }
  .country-picker-trigger > * + * { margin-left: 16px; }
  .country-picker-mobile-head > * + * { margin-left: 18px; }
  #tpGridList > * + * { margin-top: 7px; }
  #tpGridList .pt-row > * + * { margin-left: 9px; }
}

/* ========== 触屏设备：为安卓底部操作栏/手势条预留安全区 ==========
   env() 在 WebView 未上报 insets 的设备上为 0（该情况需 APK 侧配置
   WindowInsets 才能彻底解决），有上报的设备由此获得底部留白。 */
@media (pointer: coarse) {
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
