/* Step on board / Stig ombord. Sits on top of the DSB page stylesheet (../assets/css/style.css),
   so the top bar, type, colours, buttons, cards and footer are the same as on /dsb/.
   Mobile first. Only the ride's own parts are defined here. */

.so-i { width: 20px; height: 20px; flex: none; fill: currentColor; }

/* ---------- Top bar: back to the models + language ---------- */
.so-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.so-models { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px 0 8px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 650; white-space: nowrap; transition: background-color .2s, border-color .2s; }
.so-models .so-i { width: 18px; height: 18px; }
@media (hover: hover) { .so-models:hover { background: rgba(255, 255, 255, .08); } }
.so-lang { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; }
.so-lang button { min-width: 42px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.so-lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
@media (hover: hover) { .so-lang button:not([aria-pressed="true"]):hover { color: var(--text); } }
@media (max-width: 459px) {
  .so-models { position: relative; width: 44px; padding: 0; justify-content: center; }
  .so-models span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 339px) { .brand__text { display: none; } }

/* ---------- Page ---------- */
.so-main { padding: calc(var(--top) + 22px) 0 56px; }
.so-hero { margin-bottom: 18px; }
.so-hero .eyebrow--plate { margin-bottom: 14px; }
.so-title { font-size: clamp(34px, 9vw, 60px); font-weight: 800; }
.so-lead { margin-top: 12px; }

/* ---------- Stage: as big as the screen allows, the view is the point ---------- */
.so-app { display: flex; flex-direction: column; gap: 14px; }
.so-stage { position: relative; height: 66vh; height: 66svh; min-height: 300px; max-height: 640px; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8); isolation: isolate; outline: none; }
.so-canvas { width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.so-canvas:active { cursor: grabbing; }
.so-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--amber); }

.so-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.so-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(0, 0, 0, .58); border: 1px solid rgba(255, 255, 255, .14); color: #fff; font-size: 13px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.so-pill:empty { display: none; }
.so-station { font-family: var(--font); background: rgba(210, 18, 46, .88); border-color: transparent; }

.so-caption { position: absolute; left: 14px; bottom: 16px; right: 196px; margin: 0; color: #fff; font-weight: 650; font-size: 14px; line-height: 1.3; text-shadow: 0 1px 2px rgba(0, 0, 0, .7), 0 0 18px rgba(0, 0, 0, .45); pointer-events: none; }
.so-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.so-tool { min-width: 46px; height: 46px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; font-weight: 650; font-size: 14px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .15s var(--ease), background-color .2s; }
.so-tool .so-i { width: 22px; height: 22px; }
.so-tool.is-primary { background: var(--red); border-color: transparent; box-shadow: 0 8px 24px -10px var(--red-glow); }
.so-tool:active { transform: scale(.95); }
.so-tool .so-i-on, .so-tool .so-i-exit { display: none; }
.so-tool[aria-pressed="true"] .so-i-on, .so-stage.is-fs .so-i-exit { display: block; }
.so-tool[aria-pressed="true"] .so-i-off, .so-stage.is-fs .so-i-enter { display: none; }
.so-tool[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: #111; }
@media (hover: hover) {
  .so-tool:not(.is-primary):not([aria-pressed="true"]):hover { background: rgba(0, 0, 0, .78); }
  .so-tool.is-primary:hover { background: var(--red-2); }
}
@media (max-width: 599px) {
  .so-tool-txt { display: none; }
  .so-tool { width: 46px; padding: 0; }
  .so-caption { right: 172px; font-size: 13px; bottom: 14px; }
}
@media (max-width: 379px) { .so-caption { display: none; } }

.so-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; font-weight: 600; pointer-events: none; white-space: nowrap; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: so-hint 6s ease forwards; }
.so-hint.is-gone { opacity: 0; transition: opacity .4s ease; }
@keyframes so-hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.so-toast { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); margin: 0; padding: 9px 16px; border-radius: 999px; background: #fff; color: #111; font-weight: 650; font-size: 14px; white-space: nowrap; }

.so-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 100%, #262a33 0%, #121318 70%); color: var(--text); z-index: 3; }
.so-loading-in { width: min(280px, 80%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.so-loading-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: var(--red); color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .02em; animation: so-pulse 1.6s ease-in-out infinite; }
@keyframes so-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); } 50% { box-shadow: 0 0 0 12px rgba(210, 18, 46, 0); } }
.so-loading-txt { margin: 0; font-weight: 650; font-size: 15px; }
.so-loading-txt.is-error { color: #f6d48e; font-weight: 600; line-height: 1.5; }
.so-loading-bar { width: 100%; height: 3px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.so-loading-bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }

/* Full screen: the real API where there is one, otherwise the stage covers the window */
.so-stage:fullscreen { max-height: none; border-radius: 0; border: 0; }
.so-stage:-webkit-full-screen { max-height: none; border-radius: 0; border: 0; width: 100%; height: 100%; }
.so-stage.is-full { position: fixed; inset: 0; z-index: 120; height: 100%; max-height: none; border-radius: 0; border: 0; }
html.so-lock, html.so-lock body { overflow: hidden; }
.so-stage.is-full .so-tools { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Panel: seat, time of day, a few words ---------- */
.so-panel { display: flex; flex-direction: column; gap: 10px; }
.so-label { margin: 6px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.so-seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.so-seat { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 92px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); color: var(--text); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: border-color .2s, background-color .2s, transform .15s var(--ease); }
.so-seat-i { width: 40px; height: 27px; color: var(--faint); margin-bottom: 6px; transition: color .2s; }
.so-seat-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.so-seat-sub { color: var(--muted); font-size: 13px; line-height: 1.3; }
.so-seat[aria-pressed="true"] { border-color: var(--red); background: linear-gradient(180deg, rgba(210, 18, 46, .14), rgba(210, 18, 46, .04)), var(--bg-3); box-shadow: 0 0 0 1px var(--red) inset; }
.so-seat[aria-pressed="true"] .so-seat-i { color: var(--red-2); }
.so-seat:active { transform: scale(.98); }
@media (hover: hover) { .so-seat:not([aria-pressed="true"]):hover { border-color: var(--line-2); background: #20242c; } }
@media (max-width: 420px) { .so-seat { padding: 10px 9px; min-height: 86px; } .so-seat-sub { font-size: 12px; } .so-seat-name { font-size: 14px; } }

.so-mood { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.so-mood button { min-height: 42px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 650; font-size: 15px; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color .2s, color .2s; }
.so-mood button[aria-pressed="true"] { background: var(--red); color: #fff; box-shadow: 0 8px 24px -12px var(--red-glow); }
@media (hover: hover) { .so-mood button:not([aria-pressed="true"]):hover { color: var(--text); background: rgba(255, 255, 255, .06); } }

.so-plate { margin-top: 14px; }
.so-plate .card__title { margin-bottom: 10px; }
.so-about { color: #d9dce2; font-size: 15px; line-height: 1.55; }

/* Desktop: the stage beside a panel, like the model sections on /dsb/ */
@media (min-width: 960px) {
  .so-main { padding-top: calc(var(--top) + 40px); padding-bottom: 80px; }
  .so-hero { margin-bottom: 26px; }
  /* the stage and the panel share one row: their tops and bottoms line up */
  .so-app { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: stretch; }
  .so-stage { height: auto; aspect-ratio: 16 / 10; max-height: 680px; min-height: 470px; min-width: 0; width: 100%; align-self: start; }
  .so-panel { align-self: stretch; }
  .so-seats { flex: 1 1 auto; grid-auto-rows: 1fr; }
  .so-plate { margin-top: 20px; padding: 22px 28px 24px; }
  .so-about { max-width: 78ch; margin: 0 auto; text-align: center; }
  .so-label:first-child { margin-top: 0; }
  .so-seats { grid-template-columns: 1fr; }
  .so-seat { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: center; min-height: 68px; }
  .so-seat-i { grid-row: span 2; margin: 0; }
}
@supports not (aspect-ratio: 16 / 10) { @media (min-width: 960px) { .so-stage { height: 560px; } } }

/* =====================================================================
   Drive it yourself: mode switch, driver's display, lever, score card
   ===================================================================== */
.so-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.so-mode button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 52px; padding: 8px 10px; line-height: 1.2; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: border-color .2s, background-color .2s, transform .15s var(--ease); }
.so-mode button .so-i { width: 22px; height: 22px; color: var(--faint); transition: color .2s; }
.so-mode button[aria-pressed="true"] { border-color: var(--red); background: linear-gradient(180deg, rgba(210, 18, 46, .14), rgba(210, 18, 46, .04)), var(--bg-3); box-shadow: 0 0 0 1px var(--red) inset; }
.so-mode button[aria-pressed="true"] .so-i { color: var(--red-2); }
.so-mode button:active { transform: scale(.98); }
@media (hover: hover) { .so-mode button:not([aria-pressed="true"]):hover { border-color: var(--line-2); background: #20242c; } }

/* while driving, the ride's own captions make room for the driver's display */
.so-stage.is-driving .so-speed, .so-stage.is-driving .so-caption, .so-stage.is-driving .so-hint { display: none; }
.so-stage.is-driving .so-tools { top: 12px; bottom: auto; }
.so-stage.is-driving .so-top { right: 170px; }
.so-stage.is-driving .so-station { display: none; }

.so-drive { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.so-drive > * { pointer-events: auto; }

.so-dash { position: absolute; left: 12px; top: 12px; display: flex; align-items: stretch; gap: 6px; pointer-events: none; }
.so-speedo, .so-limit, .so-next, .so-status, .so-beat, .so-eb, .so-lever { background: rgba(8, 9, 12, .62); border: 1px solid rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); color: #fff; }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .so-speedo, .so-limit, .so-next, .so-status, .so-beat, .so-lever { background: rgba(8, 9, 12, .86); } }
.so-speedo { display: flex; align-items: baseline; gap: 5px; min-width: 104px; padding: 6px 12px 7px; border-radius: 12px; }
.so-speedo b { font: 700 30px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 2.2ch; text-align: right; }
.so-speedo span { font-size: 12px; font-weight: 700; color: var(--muted); }
.so-limit { display: grid; place-items: center; width: 46px; border-radius: 12px; }
.so-limit b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #111; border: 4px solid #d2122e; font: 800 12px/1 var(--font); letter-spacing: -.02em; }
.so-limit.is-over { animation: so-over 1s ease-in-out infinite; }
@keyframes so-over { 50% { background: rgba(210, 18, 46, .75); } }

.so-next { position: absolute; left: 12px; top: 64px; width: min(280px, calc(100% - 100px)); padding: 9px 12px 10px; border-radius: 12px; display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 2px; pointer-events: none; }
.so-next-l { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.so-next b { font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-next-dist { font: 700 15px/1.4 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.so-next.is-close .so-next-dist { color: var(--amber); }
.so-next-bar { grid-column: 1 / -1; display: block; height: 3px; margin-top: 5px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.so-next-bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .3s linear; }
.so-signal { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 12px; font-weight: 650; color: #e6e8ec; }
.so-signal i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.so-signal.is-y i { background: #ffc21a; box-shadow: 0 0 8px #ffc21a; }
.so-signal.is-g i { background: #4dff9a; box-shadow: 0 0 8px #4dff9a; }

.so-beat { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border-color: rgba(242, 179, 61, .5); color: #f6d48e; pointer-events: none; }

.so-status { position: absolute; left: 12px; right: 108px; bottom: 12px; margin: 0; padding: 9px 13px; border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.35; pointer-events: none; }
.so-status[hidden] { display: none; }
.so-status.is-warn { background: rgba(210, 18, 46, .88); border-color: transparent; }

/* the lever: power above neutral, brake below */
.so-ctl { position: absolute; right: 12px; bottom: 12px; top: 72px; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 86px; pointer-events: none; }
.so-lever { flex: 1; min-height: 150px; max-height: 320px; width: 100%; padding: 8px 0; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: ns-resize; touch-action: none; pointer-events: auto; -webkit-user-select: none; user-select: none; outline: none; }
.so-lever:focus-visible { box-shadow: 0 0 0 2px var(--amber); }
.so-lever-l { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.so-lever-l.is-p { color: #8fe3b0; }
.so-lever-l.is-b { color: #ffb4a6; }
.so-lever-track { position: relative; flex: 1; width: 14px; border-radius: 8px; background: rgba(255, 255, 255, .12); }
.so-lever-fillp, .so-lever-fillb { position: absolute; left: 0; right: 0; border-radius: 8px; }
.so-lever-fillp { bottom: 50%; height: 0; background: linear-gradient(0deg, #2fbf71, #8fe3b0); }
.so-lever-fillb { top: 50%; height: 0; background: linear-gradient(180deg, #f2b33d, #d2122e); }
.so-lever-zero { position: absolute; left: -8px; right: -8px; top: 50%; height: 2px; margin-top: -1px; background: rgba(255, 255, 255, .55); border-radius: 2px; }
.so-lever-knob { position: absolute; left: 50%; top: 65%; width: 58px; height: 30px; transform: translate(-50%, -50%); border-radius: 9px; background: linear-gradient(180deg, #f4f5f7, #c9ccd2); box-shadow: 0 4px 12px rgba(0, 0, 0, .5), inset 0 -2px 0 rgba(0, 0, 0, .15); display: grid; place-items: center; transition: top .08s linear; }
.so-lever-knob em { font: 800 12px/1 var(--mono); font-style: normal; color: #15171c; letter-spacing: -.02em; }
.so-lever.is-eb .so-lever-knob { background: linear-gradient(180deg, #ff5a6b, #d2122e); }
.so-lever.is-eb .so-lever-knob em { color: #fff; }
.so-eb { pointer-events: auto; width: 100%; min-height: 50px; padding: 8px 10px; border-radius: 12px; border-color: rgba(255, 90, 107, .55); background: rgba(150, 10, 28, .78); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .03em; line-height: 1.25; text-align: center; overflow-wrap: normal; hyphens: none; text-transform: uppercase; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.so-eb:active { transform: scale(.96); }
@media (hover: hover) { .so-eb:hover { background: rgba(210, 18, 46, .95); } }

/* score card */
.so-result { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 14px; background: rgba(5, 6, 8, .5); }
.so-result[hidden] { display: none; }
.so-res-in { width: min(360px, 100%); max-height: 100%; overflow: auto; padding: 20px 20px 18px; border-radius: var(--radius); background: rgba(20, 22, 27, .94); border: 1px solid var(--line-2); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8); text-align: center; animation: so-pop .35s var(--ease) both; }
@keyframes so-pop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.so-res-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red-2); }
.so-res-score { margin-top: 6px; display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.so-res-score b { font: 800 56px/1 var(--font); letter-spacing: -.03em; }
.so-res-score span { font-size: 18px; font-weight: 700; color: var(--muted); }
.so-res-verdict { margin-top: 4px; font-size: 18px; font-weight: 750; }
.so-res-off { margin-top: 4px; color: var(--muted); font-size: 14px; }
.so-result.is-overrun .so-res-score b { color: var(--red-2); }
.so-res-bars { margin: 16px 0 0; display: grid; gap: 9px; text-align: left; }
.so-res-bars div { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 10px; }
.so-res-bars dt { font-size: 13px; color: var(--muted); }
.so-res-bars dd { margin: 0; position: relative; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.so-res-bars dd i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; transition: width .7s var(--ease); }
.so-res-bars dd i.is-good { background: #2fbf71; }
.so-res-bars dd i.is-ok { background: #f2b33d; }
.so-res-bars dd i.is-low { background: #d2122e; }
.so-res-bars dd span { position: relative; display: block; padding-right: 8px; text-align: right; font: 700 12px/22px var(--mono); }
.so-res-best { margin-top: 14px; font-size: 13px; color: #f6d48e; }
.so-res-best[hidden] { display: none; }
.so-res-actions { display: flex; gap: 8px; margin-top: 16px; }
.so-res-actions .btn { flex: 1; }

@media (max-width: 599px) {
  .so-speedo b { font-size: 26px; }
  .so-next { top: 60px; width: calc(100% - 116px); }
  .so-beat { top: auto; bottom: 64px; left: 12px; transform: none; right: 100px; white-space: normal; text-align: center; }
  .so-ctl { top: 66px; width: 80px; }
  .so-eb { padding: 8px 8px; font-size: 9.5px; letter-spacing: .02em; }
  .so-status { right: 100px; font-size: 13px; }
}

/* small phones (under 390 px): the dash and the tools share the top row without touching */
@media (max-width: 389px) {
  .so-stage.is-driving .so-tools { gap: 6px; }
  .so-stage.is-driving .so-tool { width: 42px; min-width: 42px; height: 42px; padding: 0; }
  .so-dash { gap: 5px; }
  .so-speedo { min-width: 0; padding: 6px 9px 7px; gap: 4px; }
  .so-speedo b { font-size: 23px; }
  .so-speedo span { font-size: 11px; }
  .so-limit { width: 42px; }
  .so-limit b { width: 31px; height: 31px; border-width: 3px; font-size: 11px; }
}
@media (max-width: 339px) {
  .so-stage.is-driving .so-tools { gap: 5px; }
  .so-stage.is-driving .so-tool { width: 40px; min-width: 40px; height: 40px; padding: 0; }
  .so-stage.is-driving .so-tool .so-i { width: 20px; height: 20px; }
  .so-dash { gap: 4px; }
  .so-speedo { padding: 5px 8px 6px; }
  .so-speedo b { font-size: 21px; }
  .so-limit { width: 38px; }
  .so-limit b { width: 28px; height: 28px; font-size: 10px; }
}
