/* AnySlope web: loading screen, how to ski, practice run and the support details screen. */
@font-face { font-family: "MP Jakarta"; src: url("jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

html, body { background: #07111d; touch-action: manipulation; } /* quick taps never zoom the page */
#unity-canvas { touch-action: none; }
#unity-canvas { background: #07111d !important; }
/* The page draws its own loading screen; Unity's logo, bar, footer logo and performance button stay out. */
/* .mp-on is set by motion-page.js: if that file never arrives, Unity's own bar still shows. */
.mp-on #unity-loading-container, #unity-logo-title-footer, #diagnostics-icon { display: none !important; }

#mp, #mp-game, #mp-diag, #mp-toast {
  --ink: #07111d; --ice: #62e0f0; --snow: #f2f8fb; --soft: #a9c1cc; --amber: #ffc35c; --mint: #8fe3c4;
  --card: rgba(15, 33, 49, .72); --line: rgba(160, 214, 232, .18);
  font-family: "MP Jakarta", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--snow); box-sizing: border-box; -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
#mp *, #mp-game *, #mp-diag *, #mp-toast * { box-sizing: border-box; }
#mp [hidden], #mp-game [hidden], #mp-diag [hidden], #mp-toast[hidden] { display: none !important; }

/* ------------------------------------------------------------ full screen */
/* A computer's game fills the window (Unity's page has a fixed 960 x 600 box and its own footer). */
.mp-on #unity-container.unity-desktop { position: fixed; left: 0; top: 0; width: 100%; height: 100%; transform: none; }
.mp-on .unity-desktop #unity-fullscreen-container { width: 100% !important; height: 100% !important; }
.mp-on #unity-footer { display: none; }
#mp-full { position: fixed; z-index: 2020; left: 50%; top: calc(5px + env(safe-area-inset-top)); transform: translateX(-50%);
  width: 40px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 11px;
  border: 1px solid rgba(255,255,255,.4); background: rgba(7,17,29,.62); color: #fff; cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; appearance: none; -webkit-appearance: none; transition: opacity .4s ease; }
#mp-full[hidden] { display: none; }
#mp-full.mp-faded { opacity: 0; pointer-events: none; }
#mp-full:hover { background: rgba(7,17,29,.9); }
/* On the loading screen it takes the corner (the mark is at the top middle); the practice run has its own chips. */
body:has(#mp) #mp-full { left: auto; right: calc(8px + env(safe-area-inset-right)); transform: none; }
body:has(#mp-game) #mp-full { display: none; }

/* ------------------------------------------------------------ the loading screen */
#mp { position: fixed; inset: 0; z-index: 2000; overflow: hidden; background: linear-gradient(180deg, #0a1a2b 0%, #07111d 70%);
  opacity: 1; transition: opacity .38s ease; }
#mp.mp-out { opacity: 0; }
.mp-ridge { position: absolute; left: 0; right: 0; bottom: 0; height: 56%; background: url("ridge.jpg") center bottom / cover no-repeat;
  opacity: .5; -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 62%); mask-image: linear-gradient(180deg, transparent 0%, #000 62%); pointer-events: none; }
.mp-snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mp-snow i { position: absolute; top: -12px; width: 4px; height: 4px; border-radius: 50%; background: #fff; opacity: .5;
  animation: mp-fall linear infinite; will-change: transform; }
@keyframes mp-fall { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(28px, 110vh, 0); } }

.mp-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.mp-main { min-height: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left)); }

.mp-head { display: flex; align-items: center; justify-content: center; gap: 10px; }
.mp-head svg { width: 34px; height: 34px; flex: none; }
.mp-word { font-weight: 800; letter-spacing: .26em; font-size: 17px; }

.mp-status { width: 100%; max-width: 440px; align-self: center; text-align: center; }
.mp-line { font-weight: 700; font-size: 15px; min-height: 20px; font-variant-numeric: tabular-nums; }
.mp-bar { height: 7px; margin-top: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; position: relative; }
.mp-bar b { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #39b8d6, var(--ice)); transition: width .3s ease; }
.mp-bar.mp-busy b { width: 100% !important; transform-origin: left; background: linear-gradient(90deg, rgba(98,224,240,.25), var(--ice), rgba(98,224,240,.25));
  width: 40% !important; animation: mp-sweep 1.1s ease-in-out infinite; }
@keyframes mp-sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.mp-note { margin-top: 7px; font-size: 12.5px; line-height: 1.4; color: var(--soft); }

.mp-h2 { margin: 2px 0 -4px; text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ice); }
.mp-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mp-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 12px; text-align: center;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.mp-card svg { display: block; width: 100%; height: 74px; }
.mp-card h3 { margin: 6px 0 3px; font-size: 15px; font-weight: 800; }
.mp-card p { margin: 0; font-size: 12.5px; line-height: 1.42; color: var(--soft); }
.mp-tips { margin: 0 auto; max-width: 640px; text-align: center; font-size: 12.5px; line-height: 1.45; color: var(--soft); }
.mp-tips b { color: var(--snow); font-weight: 700; }

.mp-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mp-btn { appearance: none; -webkit-appearance: none; font: 800 15px/1 "MP Jakarta", -apple-system, sans-serif; color: var(--snow);
  min-height: 48px; padding: 0 22px; border-radius: 99px; border: 1px solid var(--line); background: rgba(20, 44, 64, .9); cursor: pointer; touch-action: manipulation; }
.mp-btn:active { transform: scale(.97); }
.mp-btn:focus-visible { outline: 3px solid var(--ice); outline-offset: 2px; }
.mp-primary { background: var(--ice); color: var(--ink); border-color: transparent; min-width: 230px; }
.mp-primary[disabled] { background: rgba(98,224,240,.16); color: var(--soft); cursor: default; transform: none; }
.mp-primary.mp-pulse { animation: mp-pulse 1.8s ease-in-out infinite; }
@keyframes mp-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(98,224,240,.55); } 50% { box-shadow: 0 0 0 10px rgba(98,224,240,0); } }
.mp-hint { margin: -6px auto 0; max-width: 560px; text-align: center; font-size: 12.5px; line-height: 1.4; color: var(--amber); }

/* A return visit: just the mark and the bar, unless it takes a while. */
#mp.mp-quick .mp-extra { display: none; }

/* animated pictures */
.mp-a-tilt { transform-origin: 80px 38px; animation: mp-tilt 3.2s ease-in-out infinite; }
@keyframes mp-tilt { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 75% { transform: rotate(18deg); } }
.mp-a-slide { animation: mp-slide 2.6s ease-in-out infinite; }
@keyframes mp-slide { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-15px); } 70% { transform: translateY(12px); } }
.mp-a-hop { animation: mp-hop 1.8s ease-in-out infinite; }
@keyframes mp-hop { 0%, 55%, 100% { transform: translateY(0); } 72% { transform: translateY(-11px); } }
.mp-a-press { transform-box: fill-box; transform-origin: center; animation: mp-press 1.8s ease-in-out infinite; }
@keyframes mp-press { 0%, 100% { transform: scale(1); } 50% { transform: scale(.86); } }

/* short, wide screens: a phone held sideways with Safari's bars */
@media (orientation: landscape) and (max-height: 500px) {
  .mp-main { gap: 8px; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .mp-head svg { width: 24px; height: 24px; }
  .mp-word { font-size: 13px; }
  .mp-h2 { display: none; }
  .mp-line { font-size: 13.5px; }
  .mp-bar { height: 6px; margin-top: 5px; }
  .mp-note { font-size: 11.5px; margin-top: 4px; }
  .mp-card { padding: 6px 9px 8px; border-radius: 13px; }
  .mp-card svg { height: 52px; }
  .mp-card h3 { margin: 3px 0 2px; font-size: 13.5px; }
  .mp-card p { font-size: 11.5px; line-height: 1.32; }
  .mp-tips { font-size: 11.5px; line-height: 1.35; max-width: none; }
  .mp-btn { min-height: 42px; font-size: 14px; }
  .mp-hint { font-size: 11.5px; }
}
/* upright phones: the cards become rows */
@media (orientation: portrait) and (max-width: 600px) {
  .mp-cards { grid-template-columns: 1fr; gap: 8px; }
  .mp-card { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto 1fr; column-gap: 12px; text-align: left; align-items: center; padding: 10px 14px 10px 8px; }
  .mp-card svg { grid-row: 1 / span 2; height: 70px; }
  .mp-card h3 { margin: 0 0 2px; align-self: end; }
  .mp-card p { align-self: start; }
  .mp-main { justify-content: flex-start; gap: 11px; }
  /* the two buttons stay in reach while the cards scroll */
  .mp-actions { position: sticky; bottom: 0; flex-wrap: nowrap; gap: 8px; margin: auto -18px calc(-18px - env(safe-area-inset-bottom));
    padding: 22px 14px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(7,17,29,0), #07111d 42%); }
  .mp-actions .mp-btn { flex: 1 1 0; min-width: 0; padding: 0 10px; line-height: 1.2; }
  .mp-card p { font-size: 12px; line-height: 1.36; }
  .mp-card { padding-top: 8px; padding-bottom: 8px; }
  .mp-tips { font-size: 12px; }
}
@media (min-width: 900px) and (min-height: 560px) {
  .mp-main { gap: 20px; }
  .mp-word { font-size: 22px; }
  .mp-head svg { width: 44px; height: 44px; }
  .mp-card svg { height: 96px; }
  .mp-card h3 { font-size: 17px; }
  .mp-card p, .mp-tips { font-size: 14px; }
}

/* ------------------------------------------------------------ the practice run */
#mp-game { position: fixed; inset: 0; z-index: 2010; background: #dcebf3; overflow: hidden; touch-action: none; }
#mp-game canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.mp-top { position: absolute; left: calc(10px + env(safe-area-inset-left)); right: calc(10px + env(safe-area-inset-right)); top: calc(8px + env(safe-area-inset-top));
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.mp-top > *, .mp-lead > * { pointer-events: auto; }
.mp-lead { display: flex; gap: 8px; pointer-events: none; }
.mp-chip { appearance: none; -webkit-appearance: none; border: 0; min-height: 40px; padding: 0 15px; border-radius: 99px; background: rgba(7,17,29,.84); color: var(--snow);
  font: 700 13.5px/1.2 "MP Jakarta", -apple-system, sans-serif; display: inline-flex; align-items: center; white-space: nowrap; cursor: pointer; font-variant-numeric: tabular-nums; }
.mp-chip.mp-ready { background: var(--ice); color: var(--ink); animation: mp-pulse 1.8s ease-in-out infinite; }
.mp-chip:focus-visible { outline: 3px solid var(--ice); outline-offset: 2px; }
.mp-coach { position: absolute; left: 50%; top: calc(56px + env(safe-area-inset-top)); transform: translateX(-50%); width: max-content; max-width: min(520px, calc(100% - 24px));
  background: rgba(7,17,29,.86); border-radius: 16px; padding: 9px 18px 10px; text-align: center; pointer-events: none; }
.mp-coach strong { display: block; font-size: 17px; font-weight: 800; line-height: 1.25; }
.mp-coach span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--soft); line-height: 1.35; }
.mp-coach.mp-yes { background: #0f4a3d; }
.mp-dots { display: flex; justify-content: center; gap: 5px; margin-top: 7px; }
.mp-dots i { width: 18px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); }
.mp-dots i.on { background: var(--mint); }
@media (orientation: landscape) and (max-height: 500px) {
  .mp-coach { top: calc(54px + env(safe-area-inset-top)); padding: 6px 14px 7px; }
  .mp-coach strong { font-size: 14.5px; }
  .mp-coach span { font-size: 11.5px; }
}
.mp-pad { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.65); background: rgba(7,17,29,.72); color: var(--snow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: "MP Jakarta", -apple-system, sans-serif; touch-action: none; cursor: pointer;
  padding: 0; appearance: none; -webkit-appearance: none; }
.mp-pad b { font-size: 21px; font-weight: 800; letter-spacing: .03em; }
.mp-pad small { font-size: 10px; color: var(--soft); margin-top: 1px; }
.mp-pad.on { background: rgba(98,224,240,.92); color: var(--ink); transform: scale(.95); }
.mp-pad.on small { color: var(--ink); }
.mp-pad.mp-want { animation: mp-pulse 1.2s ease-in-out infinite; border-color: var(--ice); }
