/* Boop Moto's colours and its own parts; everything else is shared/game/game-ui.css (loaded first). */
:root{
    --bg: #7fd3ff;
    --title: #ffd23f;
    --panel: rgba(20, 30, 60, .82);
    --panel-center: rgba(20, 30, 60, .86);
    --panel-edge: rgba(20, 30, 60, .35);
    --dialog: #1d2647;
}

/*
 * No zoom of any kind (iPhone Safari ignores the viewport's user-scalable=no): the page takes no touch
 * gestures at all, only the lists scroll (the same as Neon Arrow and Boop Blocks).
 */
html,
body{
    touch-action: none;
}

.panel--levels,
.ranks__list,
.whats-new__list{
    touch-action: pan-y;
}

/* Turned a quarter (a phone held upright), a list scrolls with a finger moving across the phone. */
html.turned .panel--levels,
html.turned .ranks__list,
html.turned .whats-new__list{
    touch-action: pan-x pan-y;
}

.screen{
    -webkit-touch-callout: none;
}

/* ---------- Played on its side ----------
   A phone held upright: the whole game turned a quarter, to be played on its side (src/main.js turnForPhone,
   the same as Farm). --turn-w / --turn-h are the window's height and width. */
html.turned .app{
    inset: auto;
    top: 0;
    left: 0;
    width: var(--turn-w);
    height: var(--turn-h);
    transform-origin: 0 0;
    transform: translateX(var(--turn-h)) rotate(90deg);
}

html.turned .whats-new[open]{
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(460px, calc(var(--turn-w) - 32px));
    max-height: min(620px, calc(var(--turn-h) - 32px));
    margin: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

html.turned .cheat-console[open],
html.turned .sheet{
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(480px, calc(var(--turn-w) - 24px));
    max-height: min(680px, calc(var(--turn-h) - 24px));
    margin: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

/* ---------- The pedals ---------- */

.pads{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    /* Both pedals on the bottom edge (the right side is taller with the turbo pedal). */
    align-items: flex-end;
    padding: 0 max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    pointer-events: none;
}

.pads[hidden]{
    display: none;
}

.pad{
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    width: clamp(84px, 24cqmin, 120px);
    height: clamp(84px, 24cqmin, 120px);
    font-size: clamp(34px, 10cqmin, 48px);
    color: #fff;
    background: rgba(20, 30, 60, .38);
    border: 3px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    pointer-events: auto;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.pad--gas{
    background: rgba(94, 212, 106, .42);
}

.pad--brake{
    background: rgba(255, 77, 94, .38);
}

.pad.is-down{
    transform: scale(.92);
    background: rgba(255, 255, 255, .45);
}

/* ---------- Levels ---------- */

.panel--levels{
    justify-content: flex-start;
    overflow-y: auto;
    gap: 10px;
}

.levels__head{
    display: flex;
    align-items: baseline;
    gap: 14px;
    font-weight: bold;
}

.levels__title{
    font-size: 32px;
    color: var(--title);
    text-transform: uppercase;
    text-shadow: -2px -2px 0 var(--outline), 2px -2px 0 var(--outline), -2px 2px 0 var(--outline), 2px 2px 0 var(--outline);
}

.levels__stars{
    font-size: 20px;
}

.levels{
    width: min(100%, 560px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.world{
    padding: 8px 10px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
}

.world__name{
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    opacity: .85;
}

.world__grid{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.level{
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font: bold 22px "Trebuchet MS", Arial, sans-serif;
    color: var(--accent-text);
    background: var(--accent);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
    cursor: pointer;
}

.level small{
    font-size: 11px;
    letter-spacing: .02em;
}

.level:disabled{
    color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .14);
    box-shadow: none;
    cursor: default;
}

.looks{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.look{
    width: 40px;
    height: 40px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
}

.look[aria-pressed="true"]{
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}

.look:disabled{
    opacity: .45;
    cursor: default;
}

.panel[data-panel="over"] [data-show="record"]{
    white-space: pre-line;
}

.screen[data-phase="title"] .hud__score,
.screen[data-phase="levels"] .hud__score{
    visibility: hidden;
}

.star--off{
    opacity: .3;
    filter: grayscale(1);
}

/* ---------- Coins, turbo and the garage ---------- */

.hud__coins{
    color: #ffd23f;
}

.hud__coins[hidden]{
    display: none;
}

.pads__right{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pad--turbo{
    position: relative;
    width: clamp(60px, 16cqmin, 78px);
    height: clamp(60px, 16cqmin, 78px);
    font-size: clamp(26px, 7cqmin, 34px);
    background: rgba(255, 140, 66, .5);
}

.pad--turbo[hidden]{
    display: none;
}

.pad--turbo:disabled{
    opacity: .4;
}

.pad__count{
    position: absolute;
    right: -4px;
    top: -4px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    font-size: 14px;
    font-weight: bold;
    line-height: 24px;
    color: #3a2a10;
    background: #ffd23f;
    border-radius: 12px;
}

.panel__wallet{
    font-size: 20px;
    font-weight: bold;
    color: #ffd23f;
}

.panel__wallet:empty{
    display: none;
}

.panel--garage{
    justify-content: flex-start;
    overflow-y: auto;
    gap: 10px;
    touch-action: pan-y;
}

html.turned .panel--garage{
    touch-action: pan-x pan-y;
}

.garage{
    width: min(100%, 560px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.part{
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
}

.part__icon{
    font-size: 30px;
}

.part__name{
    margin: 0;
    font-size: 17px;
    font-weight: bold;
}

.part__text{
    margin: 2px 0 4px;
    font-size: 13px;
    opacity: .8;
}

.part__pips{
    display: flex;
    gap: 4px;
}

.part__pip{
    width: 18px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .2);
}

.part__pip--on{
    background: #5ed46a;
}

.part__buy{
    min-width: 96px;
}

/* ---------- Bike models (the garage) ---------- */

.garage__head{
    width: min(100%, 560px);
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: bold;
    text-align: left;
    opacity: .85;
}

.bikes{
    width: min(100%, 560px);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.bike{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: 3px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
}

.bike--chosen{
    border-color: #ffd23f;
    background: rgba(255, 210, 63, .14);
}

.bike__picture{
    width: 130px;
    height: 72px;
}

.bike__name{
    margin: 0;
    font-size: 15px;
    font-weight: bold;
}

.bike__stats{
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2px 6px;
    font-size: 11px;
    text-align: left;
}

.bike__bar{
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .15);
}

.bike__fill{
    height: 100%;
    border-radius: 3px;
    background: #5ed46a;
}

.bike .button{
    width: 100%;
    min-height: 36px;
    font-size: 14px;
}

/* ---------- Goals (stars), parts in use, handling ---------- */

.stars .goal{
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
    font-size: 40px;
    line-height: 1;
}

.stars .goal small{
    margin-top: 4px;
    font-size: 13px;
    letter-spacing: 0;
    color: #fff;
    text-shadow: none;
}

.stars .goal--off .goal__icon{
    opacity: .3;
    filter: grayscale(1);
}

.part__pip--off{
    background: rgba(94, 212, 106, .35);
}

.part__use{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 13px;
}

.part__step{
    width: 30px;
    height: 30px;
    font-size: 18px;
}

.part__step:disabled{
    opacity: .35;
}

.bike__handling{
    margin: 2px 0 4px;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    opacity: .85;
}

/* The music button switched off: faded, with a line through. */
.round[data-action="music"]{
    position: relative;
}

.round[data-action="music"].is-off{
    opacity: .55;
}

.round[data-action="music"].is-off::after{
    content: '';
    position: absolute;
    left: 9px;
    right: 9px;
    top: 50%;
    height: 4px;
    border-radius: 2px;
    background: #ff5a5f;
    transform: rotate(-45deg);
}
