/* HOME 04 — Individual time trial. Inherits the HOME 01–03 visual system. */
.solo-mode {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  overflow: clip;
  scroll-margin-top: 82px;
  color: var(--hero-cream);
  background:
    radial-gradient(ellipse at 22% 42%, rgb(255 133 0 / 13%), transparent 42%),
    radial-gradient(ellipse at 86% 72%, rgb(96 155 45 / 7%), transparent 30%),
    linear-gradient(132deg, #0b0805 0%, #1b1008 52%, #120c08 100%);
  border-bottom: 1px solid rgb(255 211 107 / 14%);
}

.solo-mode::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.26;
  background: url("../assets/brand/el-palo-hero-arcade.webp") 14% 50% / cover no-repeat;
}

.solo-mode::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(11 8 5 / 42%), rgb(11 8 5 / 88%) 48%, rgb(22 15 9 / 94%));
}

.solo-mode__glow {
  position: absolute;
  top: 14%;
  left: 0;
  width: min(52vw, 850px);
  aspect-ratio: 1.45;
  pointer-events: none;
  background: radial-gradient(ellipse, rgb(255 178 26 / 13%), transparent 68%);
  filter: blur(24px);
}

.solo-mode__inner {
  position: relative;
  z-index: 1;
  width: min(var(--hero-max), calc(100% - (2 * var(--hero-gutter))));
  margin-inline: auto;
  padding-block: clamp(82px, 8vw, 132px);
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(380px, 0.82fr);
  grid-template-areas:
    "demo intro"
    "demo message"
    "demo actions";
  column-gap: clamp(44px, 6vw, 112px);
  align-items: start;
}

.solo-mode .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.solo-mode__intro { grid-area: intro; padding-top: clamp(8px, 1.2vw, 20px); }
.solo-mode__demo { grid-area: demo; min-width: 0; margin: 0; align-self: center; }
.solo-mode__message { grid-area: message; margin-top: clamp(30px, 3.6vw, 52px); }
.solo-mode__actions { grid-area: actions; margin-top: 30px; }

.solo-mode__eyebrow {
  width: fit-content;
  margin: 0 0 18px;
  color: #b9dc91;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.14em;
}

.solo-mode__title {
  max-width: 12ch;
  margin: 0;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(2.45rem, 3.75vw, 4.4rem);
  font-weight: 400;
  line-height: 1.01;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.solo-mode__title span { display: block; }
.solo-mode__title span + span { margin-top: 0.16em; color: var(--hero-gold); }

.solo-mode__lead {
  max-width: 59ch;
  margin: 24px 0 0;
  color: var(--hero-muted);
  font-size: clamp(1rem, 0.94rem + 0.2vw, 1.15rem);
  line-height: 1.75;
}

.solo-mode__demo-label {
  margin: 0 0 12px;
  color: var(--hero-muted);
  font-size: 0.75rem;
  text-align: left;
}

.solo-console {
  overflow: hidden;
  border-radius: 16px;
  background: #130d09;
  box-shadow: 0 30px 78px rgb(0 0 0 / 38%), inset 0 1px rgb(255 211 107 / 20%);
}

.solo-stage {
  position: relative;
  min-height: clamp(270px, 27vw, 410px);
  overflow: hidden;
  background: #120b08;
}

.solo-stage__gameplay,
.solo-stage__shade,
.solo-stage__character {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.solo-stage__gameplay {
  object-fit: cover;
  object-position: 48% 50%;
  filter: saturate(0.78) sepia(0.18) brightness(0.72);
}

.solo-stage__shade {
  background:
    linear-gradient(90deg, rgb(9 6 4 / 82%) 0%, rgb(9 6 4 / 30%) 58%, rgb(9 6 4 / 60%) 100%),
    linear-gradient(180deg, rgb(9 6 4 / 18%), rgb(9 6 4 / 78%));
}

.solo-stage__character {
  left: auto;
  right: -17%;
  width: 76%;
  object-fit: cover;
  object-position: 50% 48%;
  opacity: 0.48;
  mix-blend-mode: screen;
  transform: rotate(2.4deg) scale(1.06);
  transform-origin: 58% 82%;
  pointer-events: none;
}

.solo-stage__source {
  position: absolute;
  top: 18px;
  left: 20px;
  padding: 7px 10px 6px;
  border-radius: 999px;
  color: var(--hero-gold);
  background: rgb(20 12 7 / 78%);
  font-size: 0.63rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.09em;
}

.solo-stage__score {
  position: absolute;
  left: clamp(20px, 3.2vw, 42px);
  bottom: clamp(36px, 4vw, 58px);
  display: grid;
  justify-items: start;
}

.solo-stage__score-label {
  color: var(--hero-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.solo-stage__time {
  margin-top: 2px;
  color: var(--hero-cream);
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(3.35rem, 6.7vw, 6.8rem);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.038em;
  text-shadow: 0 12px 32px rgb(0 0 0 / 54%);
  white-space: nowrap;
}

.solo-stage__record {
  margin-top: 9px;
  padding: 6px 9px 5px;
  border-radius: 999px;
  color: #251406;
  background: var(--hero-gold);
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.07em;
}

.solo-stage__balance {
  position: absolute;
  right: 24px;
  bottom: 22px;
  left: 24px;
  height: 4px;
  border-radius: 999px;
  background: rgb(255 243 220 / 19%);
}

.solo-stage__balance span {
  display: block;
  width: 73%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hero-green), var(--hero-amber));
}

.solo-stage__balance i {
  position: absolute;
  top: 50%;
  left: 73%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--hero-cream);
  box-shadow: 0 5px 16px rgb(0 0 0 / 44%);
  transform: translate(-50%, -50%);
}

.solo-console__ranking { padding: clamp(20px, 2.8vw, 34px); }

.solo-tabs {
  width: fit-content;
  min-width: min(100%, 274px);
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgb(255 211 107 / 24%);
  border-radius: 999px;
  background: rgb(40 25 13 / 68%);
}

.solo-tab {
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--hero-muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  line-height: 1.2;
  transition: color 180ms var(--hero-ease-out), background-color 180ms var(--hero-ease-out), box-shadow 180ms var(--hero-ease-out);
}

.solo-tab[aria-selected="true"] {
  color: #211307;
  background: var(--hero-gold);
  box-shadow: 0 7px 20px rgb(255 178 26 / 18%);
}

.solo-tab:hover:not([aria-selected="true"]) { color: var(--hero-cream); }
.solo-panel[hidden] { display: none; }

.solo-panel__heading {
  margin-top: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.solo-panel__heading p {
  margin: 0 0 5px;
  color: var(--hero-green);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.solo-panel__heading h3 {
  max-width: 27ch;
  margin: 0;
  font-size: clamp(1.1rem, 1rem + 0.38vw, 1.42rem);
  line-height: 1.3;
  letter-spacing: -0.018em;
}

.solo-rank-badge {
  position: relative;
  flex: 0 0 auto;
  color: var(--hero-gold);
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.solo-stats {
  margin: 23px 0 0;
  padding-block: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--hero-line);
}

.solo-stats > div { min-width: 0; padding-inline: 14px; }
.solo-stats > div:first-child { padding-left: 0; }
.solo-stats > div + div { border-left: 1px solid var(--hero-line); }

.solo-stats dt {
  color: var(--hero-muted);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.35;
}

.solo-stats dd {
  margin: 4px 0 0;
  color: var(--hero-cream);
  font-size: clamp(1.02rem, 1.5vw, 1.33rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.solo-stats .solo-stats__gap { color: var(--hero-gold); }

.solo-target { margin-top: 18px; }
.solo-target__labels { display: flex; justify-content: space-between; gap: 18px; color: var(--hero-muted); font-size: 0.63rem; font-weight: 700; }
.solo-target__track { position: relative; height: 22px; margin-top: 7px; }
.solo-target__track::before { content: ""; position: absolute; top: 9px; right: 0; left: 0; height: 4px; border-radius: 999px; background: rgb(255 243 220 / 14%); }
.solo-target__fill { position: absolute; top: 9px; left: 0; width: 86%; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--hero-green), var(--hero-amber)); transform-origin: left; }
.solo-target__track--city .solo-target__fill { width: 72%; }
.solo-target__you,
.solo-target__rival { position: absolute; top: 4px; width: 14px; height: 14px; border-radius: 50%; transform: translateX(-50%); }
.solo-target__you { left: 86%; background: var(--hero-gold); box-shadow: 0 5px 16px rgb(0 0 0 / 40%); }
.solo-target__rival { right: 0; background: var(--hero-cream); transform: none; }
.solo-target__track--city .solo-target__you { left: 72%; }

.solo-neighbours {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.solo-neighbour {
  min-height: 57px;
  padding: 9px 2px;
  display: grid;
  grid-template-columns: minmax(66px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid rgb(255 211 107 / 12%);
}

.solo-neighbour__position,
.solo-neighbour time { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
.solo-neighbour__position { color: var(--hero-muted); font-size: 0.76rem; font-weight: 800; }
.solo-neighbour__identity { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.solo-neighbour__identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.solo-neighbour__identity span { color: var(--hero-muted); font-size: 0.65rem; }
.solo-neighbour time { color: var(--hero-cream); font-size: 1.02rem; font-weight: 900; }

.solo-neighbour.is-you {
  margin-inline: -10px;
  padding-inline: 12px;
  border-top-color: transparent;
  border-radius: 12px;
  color: var(--hero-cream);
  background: linear-gradient(90deg, rgb(255 178 26 / 16%), rgb(255 178 26 / 3%));
  box-shadow: inset 0 0 0 1px rgb(255 211 107 / 22%);
}

.solo-neighbour.is-you .solo-neighbour__position,
.solo-neighbour.is-you time { color: var(--hero-gold); }

.solo-city-pending {
  margin: 18px 0 0;
  padding-top: 17px;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--hero-line);
  color: var(--hero-cream);
  line-height: 1.5;
}

.solo-city-pending span { color: var(--hero-muted); font-size: 0.75rem; }
.solo-mode__demo-note { margin: 13px 0 0; color: var(--hero-muted); font-size: 0.72rem; line-height: 1.55; }

.solo-mode__transition {
  max-width: 52ch;
  margin: 0;
  color: var(--hero-muted);
  line-height: 1.7;
}

.solo-mode__message blockquote {
  max-width: 18ch;
  margin: 25px 0 0;
  color: var(--hero-gold);
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(1.65rem, 2.5vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.solo-mode__message h3 { margin: 29px 0 0; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.45rem); line-height: 1.35; }
.solo-mode__message > p:last-child { max-width: 55ch; margin: 10px 0 0; color: var(--hero-muted); line-height: 1.7; }

.solo-mode__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.solo-mode__primary { min-height: 54px; }
.solo-mode__secondary { min-height: 44px; display: inline-flex; align-items: center; color: var(--hero-cream); font-weight: 900; }
.solo-mode__status { flex-basis: 100%; max-width: 58ch; margin: 0; color: var(--hero-muted); font-size: 0.75rem; line-height: 1.55; }

.solo-console.is-complete .solo-rank-badge::after {
  content: "";
  position: absolute;
  inset: -11px -14px;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 8px 28px rgb(255 178 26 / 34%);
  animation: solo-rank-glow 760ms var(--hero-ease-out) both;
}

@keyframes solo-rank-glow { 0%, 100% { opacity: 0; } 34% { opacity: 1; } }

@container (max-width: 980px) {
  .solo-mode__inner {
    max-width: 760px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "demo" "message" "actions";
  }

  .solo-mode__intro { padding-top: 0; }
  .solo-mode__title { max-width: 13ch; font-size: clamp(2.45rem, 7.3cqw, 4.3rem); }
  .solo-mode__demo { margin-top: 38px; }
  .solo-mode__message { margin-top: 38px; }
}

@container (max-width: 520px) {
  .solo-mode__inner { padding-block: 74px; }
  .solo-mode__title { font-size: clamp(2.05rem, 10.5cqw, 3rem); }
  .solo-mode__lead { margin-top: 20px; }
  .solo-mode__demo { margin-top: 30px; }
  .solo-mode__demo-label { text-align: right; }
  .solo-stage { min-height: clamp(248px, 78vw, 310px); }
  .solo-stage__source { top: 12px; left: 12px; max-width: calc(100% - 24px); font-size: 0.55rem; }
  .solo-stage__score { left: 16px; bottom: 38px; }
  .solo-stage__time { font-size: clamp(2.8rem, 15.5vw, 4.4rem); }
  .solo-stage__character { right: -28%; width: 96%; opacity: 0.4; }
  .solo-stage__balance { right: 16px; bottom: 18px; left: 16px; }
  .solo-console__ranking { padding: 17px 15px 21px; }
  .solo-tabs { width: 100%; }
  .solo-tab { padding-inline: 12px; }
  .solo-panel__heading { margin-top: 20px; align-items: center; gap: 12px; }
  .solo-panel__heading h3 { font-size: 1.08rem; }
  .solo-rank-badge { font-size: clamp(1.55rem, 8.2vw, 2rem); }
  .solo-stats > div { padding-inline: 8px; }
  .solo-stats dt { font-size: 0.58rem; }
  .solo-stats dd { font-size: 0.95rem; }
  .solo-neighbour { grid-template-columns: minmax(54px, auto) minmax(0, 1fr) auto; gap: 8px; }
  .solo-neighbour__position { font-size: 0.68rem; }
  .solo-neighbour__identity strong { font-size: 0.83rem; }
  .solo-neighbour time { font-size: 0.9rem; }
  .solo-mode__message blockquote { font-size: clamp(1.55rem, 8cqw, 2.05rem); }
  .solo-mode__actions { align-items: stretch; }
  .solo-mode__primary { width: 100%; }
  .solo-mode__secondary { justify-content: center; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .solo-mode *,
  .solo-mode *::before,
  .solo-mode *::after { animation: none !important; transition: none !important; }
  .solo-stage__character { transform: rotate(2.4deg); }
  .solo-mode__primary:hover,
  .solo-mode__primary:active { transform: none; }
}
