/* Formula Crown 0.22.x — mobile no-horizontal-scroll pass */
.mobile-race-mode-shortcut {
  display: none;
}

@media (max-width: 760px) {
  html,
  body,
  #app {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body {
    position: relative;
    overscroll-behavior-x: none;
  }

  .shell,
  .layout,
  .game-column,
  .card,
  .card-hero,
  .card-body,
  .pending-card,
  .race-card,
  .outcome-card,
  .setup,
  .setup-topbar,
  .mobile-dashboard,
  .mobile-race-mode-shortcut,
  .table-wrap,
  .view-tabs,
  .view-panels,
  .view-panel {
    min-width: 0;
    max-width: 100%;
  }

  img,
  svg,
  video,
  canvas {
    max-width: 100%;
    height: auto;
  }

  button,
  input,
  select {
    max-width: 100%;
  }

  .field input,
  .field select {
    width: 100%;
    min-width: 0;
  }

  .mobile-menu-popover {
    max-width: calc(100vw - 20px);
  }

  /* Keep the animated/static race setting visible without opening the menu. */
  .mobile-race-mode-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0 0 10px;
    padding: 9px 10px 9px 12px;
    background: #15151b;
    border: 1px solid #35353f;
    border-left: 3px solid var(--accent);
    border-radius: 0 9px 0 9px;
    overflow: hidden;
  }

  .mobile-race-mode-shortcut > span {
    min-width: 0;
    color: #a9a9b3;
    font-family: var(--font-display);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .12em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .mobile-race-mode-button {
    flex: 0 1 auto;
    min-width: 0;
    padding: 8px 12px;
    background: rgba(242, 13, 47, .12);
    border-color: rgba(242, 13, 47, .48);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
  }

  /* Status information fits in two rows instead of a horizontal strip. */
  .statusbar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    scroll-snap-type: none;
    overscroll-behavior-inline: auto;
  }

  .statuscell {
    width: auto !important;
    min-width: 0;
    grid-column: span 2;
    flex: none;
    padding: 8px 7px;
    scroll-snap-align: none;
    border-bottom: 1px solid var(--line);
  }

  .statuscell:nth-child(3) {
    border-right: 0;
  }

  .statuscell:nth-child(4),
  .statuscell:nth-child(5) {
    grid-column: span 3;
    border-bottom: 0;
  }

  .statuscell:nth-child(5) {
    width: auto !important;
    border-right: 0;
  }

  .statuscell strong {
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Mobile card carousels reflow into the page so there is no sideways gesture. */
  .details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    gap: 7px;
    margin: 0 0 14px;
    padding: 0;
    scroll-snap-type: none;
  }

  .details-grid > .detail {
    min-width: 0;
    flex: none;
    scroll-snap-align: none;
  }

  .details-grid > .detail:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .context-grid {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    gap: 8px;
    margin: 0 0 15px;
    padding: 0;
    scroll-snap-type: none;
  }

  .context-card {
    width: 100%;
    min-width: 0;
    flex: none;
    scroll-snap-align: none;
  }

  .offer-grid {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    gap: 9px;
    margin: 0;
    padding: 0 0 5px;
    scroll-snap-type: none;
  }

  .offer {
    width: 100%;
    min-width: 0;
    flex: none;
    scroll-snap-align: none;
  }

  .news {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    gap: 7px;
    margin: 9px 0 13px;
    padding: 0;
  }

  .news-item {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    gap: 8px;
    margin: 0;
    padding: 0 0 5px;
    scroll-snap-type: none;
  }

  .profile-option {
    width: 100%;
    min-width: 0;
    flex: none;
    scroll-snap-align: none;
  }

  /* Four-column standings/results stay fully inside the available width. */
  .table-wrap,
  .race-card .table-wrap,
  .pending-season_recap .table-wrap,
  .pending-career_end .table-wrap {
    max-width: 100%;
    overflow-x: hidden !important;
  }

  table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
  }

  th,
  td {
    min-width: 0;
    padding: 7px 5px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  table th:nth-child(1),
  table td:nth-child(1) {
    width: 12%;
  }

  table th:nth-child(2),
  table td:nth-child(2) {
    width: 43%;
  }

  table th:nth-child(3),
  table td:nth-child(3) {
    width: 30%;
  }

  table th:last-child,
  table td:last-child {
    width: 15%;
  }

  /* Six-column career history becomes compact cards while retaining every value. */
  .pending-career_end .table-wrap {
    border: 0;
    background: transparent;
  }

  .pending-career_end .table-wrap table {
    display: block;
  }

  .pending-career_end .table-wrap thead {
    display: none;
  }

  .pending-career_end .table-wrap tbody {
    display: grid;
    gap: 7px;
  }

  .pending-career_end .table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
    padding: 10px;
    background: #101015;
    border: 1px solid #31313a;
    border-radius: 0 8px 0 8px;
  }

  .pending-career_end .table-wrap td {
    display: block;
    width: auto !important;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left !important;
    font-size: 10px;
    overflow-wrap: anywhere;
  }

  .pending-career_end .table-wrap td::before {
    display: block;
    margin-bottom: 2px;
    color: #8d8d98;
    font-family: var(--font-display);
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .pending-career_end .table-wrap td:nth-child(1)::before { content: "Année"; }
  .pending-career_end .table-wrap td:nth-child(2)::before { content: "Catégorie"; }
  .pending-career_end .table-wrap td:nth-child(3)::before { content: "Écurie"; }
  .pending-career_end .table-wrap td:nth-child(4)::before { content: "Classement"; }
  .pending-career_end .table-wrap td:nth-child(5)::before { content: "Victoires"; }
  .pending-career_end .table-wrap td:nth-child(6)::before { content: "Pts"; }

  .card-body,
  .setup .card-body,
  .pending-team_offer .card-body,
  .pending-contract_offers .card-body,
  .pending-season_start .card-body,
  .pending-world_update .card-body,
  .pending-promotion .card-body,
  .pending-race_transition .card-body,
  .race-live-table {
    overflow-x: hidden !important;
  }

  .race-live-head,
  .race-live-row,
  .event-race-context,
  .race-live-banner,
  .context-rows > div {
    min-width: 0;
    max-width: 100%;
  }

  .context-rows span,
  .context-rows b,
  .event-race-context span,
  .event-race-context strong,
  .race-live-banner span,
  .race-live-banner strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .view-tab {
    min-width: 0;
    white-space: normal;
  }

  .feedback-pill,
  .market-note,
  .next-race-panel {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

/* Global visual cleanup — remove decorative left accent bars and excessive uppercase tracking. */
.card-hero::before {
  display: none;
}

.choice {
  border-left-width: 1px;
}
.choice:hover {
  border-left-color: #62626e;
}

.offer {
  border-left-width: 1px;
  border-left-color: #363640;
}
.offer:hover {
  border-left-color: #62626e;
}

.market-note {
  border-left-width: 1px;
  border-left-color: #494953;
}
.event-race-context {
  border-left-width: 1px;
  border-left-color: #373741;
}
.race-choice-impact {
  border-left-width: 1px;
  border-left-color: rgba(255,176,0,.28);
}
.next-race-panel {
  border-left-width: 1px;
  border-left-color: #43434d;
}
.setup-recap {
  border-left-width: 1px;
  border-left-color: #3b3b46;
}
.creation-profile-banner {
  border-left-width: 1px;
  border-left-color: #41414c;
}
.mobile-race-mode-shortcut {
  border-left-width: 1px;
  border-left-color: #35353f;
}
.news-item,
.mobile-profile-line {
  border-left: 0;
}

.brand-copy small,
.statuscell span,
.kicker,
.detail span,
.metric span,
.mini-stat span,
.section-title,
th,
.side-head strong,
.pill,
.field label,
.offer-kind,
.event-race-context span,
.feedback-title,
.legacy-label,
.race-live-banner > span,
.race-live-head,
.next-race-panel > span,
.mobile-overview span,
.profile-section-head > div > span,
.creation-profile-banner > span,
.access-pill,
.paywall-price small,
.account-line span,
.mobile-race-mode-shortcut > span,
.pending-career_end .table-wrap td::before,
.view-tab {
  letter-spacing: 0 !important;
}

/* Touch devices must not retain the desktop hover style on decision choices. */
@media (hover: none), (pointer: coarse) {
  .choice:hover {
    transform: none;
    border-color: #454550;
    background: #1c1c24;
  }

  .choice:hover .choice-letter {
    background: #2a2a34;
  }

  .choice:hover .choice-hint {
    color: #c3c3cb;
  }
}
