/* Mini World: the controls slide in from every edge when you take your seat */
#mini { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 4; font-size: 13px;
  --mw-bg: rgba(10, 14, 28, .82); --mw-line: rgba(255, 255, 255, .14); --mw-hot: #ff6fd8; --mw-cool: #19e6ff; }
body.in-mini #mini { display: block; }
html body.in-mini #touch, html body.in-mini #touch.hidden, body.in-mini #scoreboard, body.in-mini #boostWrap, body.in-mini #hubInfo, body.in-mini #hint,
body.in-mini #youBanner, body.in-mini #homeArrow, body.in-mini #title { display: none !important; }
#mini button { font: inherit; color: #fff; cursor: pointer; border: 1px solid var(--mw-line); background: rgba(255, 255, 255, .07);
  border-radius: 10px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#mini button:active { transform: scale(.95); }
#mini button.on { background: var(--mw-hot); border-color: var(--mw-hot); color: #10061a; }
#mini button:disabled { opacity: .45; cursor: default; }
#mini i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

.mw-top, .mw-god, .mw-slip, .mw-slip-pill { pointer-events: auto; transition: transform .55s cubic-bezier(.2, 1.3, .4, 1), opacity .4s; }
#mini:not(.in) .mw-top { transform: translate(-50%, -140%); }
#mini:not(.in) .mw-god { transform: translateX(-130%); }
#mini:not(.in) .mw-slip, #mini:not(.in) .mw-slip-pill { transform: translateX(130%); }
#mini.in .mw-god { transition-delay: .12s; }
#mini.in .mw-slip { transition-delay: .24s; }

/* scoreboard */
.mw-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: stretch; gap: 6px; background: var(--mw-bg); border: 1px solid var(--mw-line);
  border-radius: 14px; padding: 5px; backdrop-filter: blur(6px); }
.mw-team { display: flex; align-items: center; gap: 7px; padding: 4px 10px; font-weight: 800; letter-spacing: .04em; }
.mw-team .mw-s { font-size: 20px; min-width: 18px; text-align: center; }
.mw-team.boosting { box-shadow: 0 0 0 2px #ffd23f, 0 0 18px #ffd23f; }
.mw-mid { text-align: center; padding: 0 6px; min-width: 120px; }
.mw-clock { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mw-phase { font-size: 10px; opacity: .75; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* god mode rail */
.mw-god { position: absolute; left: max(8px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%);
  display: grid; grid-template-columns: repeat(2, 58px); gap: 5px; background: var(--mw-bg); border: 1px solid var(--mw-line);
  border-radius: 14px; padding: 7px; backdrop-filter: blur(6px); }
#mini:not(.in) .mw-god { transform: translate(-130%, -50%); }
.mw-label { grid-column: 1 / -1; text-align: center; font-weight: 900; font-size: 11px; letter-spacing: .14em; color: var(--mw-hot); }
.mw-speed { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.mw-speed button { padding: 5px 0; font-weight: 800; font-size: 12px; }
.mw-god > button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; }
.mw-god > button span { font-size: 20px; line-height: 1.1; }
.mw-god > button small { font-size: 9.5px; opacity: .85; white-space: nowrap; }
.mw-god .mw-leave { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 6px; }
.mw-god .mw-leave span { font-size: 15px; }

/* bet slip */
.mw-slip { position: absolute; right: max(8px, env(safe-area-inset-right)); top: 64px; bottom: 10px; width: 230px;
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto; background: var(--mw-bg); border: 1px solid var(--mw-line);
  border-radius: 14px; padding: 9px; backdrop-filter: blur(6px); max-height: 560px; }
#mini.slip-hidden .mw-slip { transform: translateX(130%); opacity: 0; pointer-events: none; }
.mw-slip-pill { position: absolute; right: max(8px, env(safe-area-inset-right)); top: 64px; padding: 8px 12px; font-weight: 800;
  background: var(--mw-bg) !important; }
#mini:not(.slip-hidden) .mw-slip-pill { opacity: 0; pointer-events: none; }
.mw-slip-head { display: flex; align-items: center; gap: 8px; }
.mw-slip-head b { letter-spacing: .12em; color: var(--mw-cool); }
.mw-coins { margin-left: auto; font-weight: 800; }
.mw-slip-x { padding: 2px 8px; }
.mw-slip-status { font-size: 11px; opacity: .75; }
.mw-stake { display: flex; align-items: center; gap: 4px; }
.mw-stake span { font-size: 11px; opacity: .8; margin-right: 2px; }
.mw-stake button { flex: 1; padding: 4px 0; font-weight: 700; }
.mw-mh { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin: 2px 0 4px; }
.mw-win, .mw-drivers { display: flex; flex-direction: column; gap: 4px; }
.mw-win button, .mw-drivers button { display: flex; align-items: center; gap: 7px; padding: 6px 8px; text-align: left; }
.mw-win button b, .mw-drivers button b { margin-left: auto; color: #ffd23f; font-variant-numeric: tabular-nums; }
#mini .mw-win button.picked, #mini .mw-drivers button.picked { border-color: #5cff7a; background: rgba(92, 255, 122, .16); }
.mw-mine div { font-size: 11.5px; padding: 3px 0; border-top: 1px solid var(--mw-line); }
.mw-mine .won { color: #5cff7a; } .mw-mine .lost { opacity: .55; }
.mw-go { padding: 9px; font-weight: 900; letter-spacing: .05em; background: #2bd94a !important; border-color: #2bd94a !important; color: #062a10 !important; }

/* picked car and the news ticker */
.mw-card { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s;
  background: var(--mw-bg); border: 1px solid var(--mw-line); border-radius: 12px; padding: 7px 12px; text-align: center; white-space: nowrap; }
.mw-card.on { opacity: 1; transform: translateX(-50%); }
.mw-card i { margin-right: 6px; }
.mw-card small { opacity: .8; }
.mw-ticker { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%) translateY(14px); opacity: 0; transition: .3s;
  background: linear-gradient(90deg, #ff6fd8, #19e6ff); color: #0b0618; font-weight: 800; border-radius: 999px; padding: 6px 16px;
  white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.mw-ticker.on { opacity: 1; transform: translateX(-50%); }

/* short landscape phones: tighter rail, slimmer slip */
@media (max-height: 460px) {
  .mw-god { grid-template-columns: repeat(3, 50px); gap: 4px; padding: 5px; }
  .mw-god > button span { font-size: 17px; }
  .mw-god > button small { font-size: 8.5px; }
  .mw-slip { width: 210px; top: 56px; padding: 7px; }
  .mw-slip-pill { top: 56px; }
  .mw-card { bottom: 46px; }
}
/* upright phones: god mode along the bottom, the slip as a sheet */
@media (orientation: portrait) and (max-width: 700px) {
  .mw-top { width: calc(100vw - 16px); justify-content: space-between; }
  .mw-mid { min-width: 0; flex: 1; }
  .mw-god { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; right: 8px; transform: none;
    grid-template-columns: repeat(4, 1fr); }
  #mini:not(.in) .mw-god { transform: translateY(140%); }
  .mw-god .mw-leave { grid-column: auto; flex-direction: column; }
  .mw-label { display: none; }
  .mw-slip { left: 8px; right: 8px; width: auto; top: 70px; bottom: auto; max-height: 52vh; }
  .mw-slip-pill { top: 70px; }
  .mw-card { bottom: auto; top: 70px; }
  .mw-ticker { bottom: auto; top: calc(70px + 52vh + 8px); }
}
