/* Slope 26: a living shell round every menu page (alive50.js).
   Each page has a colour (--page, set on the panel) and a picture that drifts behind its title with snow falling
   through it; the tab rail shows every page with its own symbol; cards answer the pointer. All movement stops with
   the game's Reduce motion setting and the system one. Linked before legible50.css, which stays last. */
#gamePanel{--page:var(--brand-blue)}

/* The sheet itself takes a wash of the page's colour from the top left. */
#gamePanel[data-panel]:not([data-panel="results"]) .game-panel-dialog{background:var(--brand-panel)}

/* Header: the page's scene on the right, its colour on the left, the title over both. */
#gamePanel[data-panel]:not([data-panel="results"]) .panel-header{position:relative;overflow:hidden;isolation:isolate;min-height:clamp(84px,13vh,128px);border-bottom:0;background:linear-gradient(98deg,color-mix(in srgb,var(--page) 34%,#111c2b) 0%,color-mix(in srgb,var(--page) 12%,#131f2f) 34%,#101a28 100%)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-header>:not(.panel-scene){position:relative;z-index:2}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-header::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;z-index:3;background:linear-gradient(90deg,var(--page),color-mix(in srgb,var(--page) 20%,transparent) 62%,transparent)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-header h2{font-size:clamp(30px,4.6vw,56px);letter-spacing:-.005em;text-shadow:0 3px 18px rgba(4,10,18,.62),0 1px 0 rgba(4,10,18,.5)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-header .eyebrow{display:inline-flex;align-items:center;gap:8px;color:var(--page);letter-spacing:.2em;text-shadow:0 1px 8px rgba(4,10,18,.7)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-header #panelClose{background:var(--brand-navy);border-color:var(--brand-stroke);color:var(--brand-snow);box-shadow:none}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-header .eyebrow::before{content:"";width:22px;height:3px;border-radius:2px;background:var(--page)}
.panel-scene{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.panel-scene .panel-scene-art{position:absolute;left:26%;top:-16%;width:76%;height:132%;-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 30%,#000 100%);mask-image:linear-gradient(90deg,transparent 0,#000 30%,#000 100%);animation:panel-scene-drift 24s ease-in-out infinite alternate;will-change:transform}
@keyframes panel-scene-drift{from{transform:translate3d(-1.8%,1.5%,0) scale(1.05)}to{transform:translate3d(1.8%,-2.5%,0) scale(1.1)}}
.panel-scene .mode-art .ma-snow{animation:ma-snow 3s linear infinite}
.panel-scene .mode-art .ma-twinkle{animation:ma-twinkle 2.6s ease-in-out infinite}
.panel-scene .mode-art .ma-beam{animation:ma-beam 3.4s ease-in-out infinite}
.panel-scene .mode-art .ma-rider{animation:ma-rider 2.8s ease-in-out infinite}
.panel-scene .mode-art .ma-speed{animation:ma-speed 1.5s linear infinite}
.panel-scene .mode-art .ma-steam{animation:ma-steam 3s ease-out infinite}
/* Snow through the whole header, two depths. Each layer is one tile taller than the header and slides one tile. */
/* The snow is held in a frame that fades out toward the title, so no flake sits on a letter. */
.panel-snowfall{position:absolute;inset:0;z-index:1;overflow:hidden;-webkit-mask-image:linear-gradient(90deg,transparent 22%,#000 46%);mask-image:linear-gradient(90deg,transparent 22%,#000 46%)}
.panel-snow{position:absolute;left:0;right:0;z-index:1;opacity:.55;background-repeat:repeat;will-change:transform}
.panel-snow.far{top:-110px;bottom:0;background-image:radial-gradient(circle at 22px 30px,#fff 0 1.1px,transparent 1.7px),radial-gradient(circle at 78px 84px,#fff 0 .9px,transparent 1.5px);background-size:110px 110px;animation:panel-snow-far 9s linear infinite}
.panel-snow.near{top:-170px;bottom:0;opacity:.8;background-image:radial-gradient(circle at 40px 50px,#fff 0 1.8px,transparent 2.5px),radial-gradient(circle at 128px 132px,#fff 0 1.5px,transparent 2.2px);background-size:170px 170px;animation:panel-snow-near 6s linear infinite}
@keyframes panel-snow-far{to{transform:translate3d(0,110px,0)}}
@keyframes panel-snow-near{to{transform:translate3d(0,170px,0)}}

/* The rail: every page, each with its symbol, on one row that scrolls sideways when it must. */
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;gap:4px;align-items:center;background:var(--brand-navy);border-bottom:1px solid var(--brand-edge)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation::-webkit-scrollbar{display:none}
.panel-rail-more{display:flex;flex:0 0 auto;align-items:center;gap:2px;margin-left:6px;padding-left:10px;border-left:1px solid rgba(255,255,255,.14)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation button{display:inline-flex;align-items:center;gap:7px;position:relative;color:#aebccb;border-radius:9px}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation button::before{content:"";flex:none;width:17px;height:17px;background:currentColor;opacity:.85;-webkit-mask:var(--ico) center/contain no-repeat;mask:var(--ico) center/contain no-repeat;transition:transform .2s cubic-bezier(.2,.8,.2,1)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation button:hover{background:rgba(255,255,255,.07);color:#fff}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation button:hover::before{transform:translateY(-2px) scale(1.12)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation button.selected{background:color-mix(in srgb,var(--page) 22%,#111c2b);color:#fff;box-shadow:inset 0 -3px var(--page),0 0 0 1px color-mix(in srgb,var(--page) 45%,transparent)}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation button.selected::before{background:var(--page);opacity:1}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-rail-more button{padding-inline:10px;font-size:12px;letter-spacing:.07em}
[data-panel-nav="modes"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 20 9 8l4 6 2-3 7 9z'/%3E%3Cpath d='M8.4 8V2.5l4.6 2-3.4 1.6V8z'/%3E%3C/svg%3E")}
[data-panel-nav="runs"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2.5c9 2 9 6 3 9.5s-6 7 4 9.5' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E")}
[data-panel-nav="journey"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a6.5 6.5 0 0 0-6.5 6.5C5.5 13.5 12 22 12 22s6.5-8.5 6.5-13.5A6.5 6.5 0 0 0 12 2zm0 9a2.6 2.6 0 1 1 0-5.2 2.6 2.6 0 0 1 0 5.2z'/%3E%3C/svg%3E")}
[data-panel-nav="garage"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 3 3 6l2 5 2.2-1V21h9.6V10L19 11l2-5-5.5-3-1.5 2.5h-4z'/%3E%3C/svg%3E")}
[data-panel-nav="store"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M4.5 8.5H8V6.5a4 4 0 0 1 8 0v2h3.5l-1 12.5h-13zm5.5 0h4V6.5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E")}
[data-panel-nav="events"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M4 5h3V2.8h2.2V5h5.6V2.8H17V5h3v16H4zm2.2 6v7.8h11.6V11z'/%3E%3Cpath d='M8.5 13h3v3h-3z'/%3E%3C/svg%3E")}
[data-panel-nav="pass"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M3 6.5h18V11a1.8 1.8 0 0 0 0 3.6v4.4H3v-4.4A1.8 1.8 0 0 0 3 11zm10 2.5v2h1.6V9zm0 3.5v2h1.6v-2zm0 3.5v1h1.6v-1z'/%3E%3C/svg%3E")}
[data-panel-nav="crew"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 11.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4zm8.5 0a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4zM1.5 20c0-4.2 3.2-6.4 6.5-6.4s6.5 2.2 6.5 6.4zm14.8 0c0-2.1-.6-3.8-1.7-5.1.6-.9 1.3-1.3 1.900-1.3 3 0 6 2.2 6 6.4z'/%3E%3C/svg%3E")}[data-panel-nav="records"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 21v-6.5h6V21zm7 0V11h6v10zm7 0v-4.5h6V21zM12 2.6l1.3 2.6 2.8.4-2 2 .5 2.8-2.6-1.4-2.6 1.4.5-2.8-2-2 2.8-.4z'/%3E%3C/svg%3E")}
[data-panel-nav="profile"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 11.8a4.3 4.3 0 1 0 0-8.6 4.3 4.3 0 0 0 0 8.6zM3.5 21c0-5.2 4.2-7.4 8.5-7.4s8.5 2.2 8.5 7.4z'/%3E%3C/svg%3E")}
[data-panel-nav="career"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M7 3h10v2h3.5v3.2a4 4 0 0 1-4.3 4 5 5 0 0 1-2.900 2V17h3v3.5H7.7V17h3v-2.8a5 5 0 0 1-2.900-2 4 4 0 0 1-4.3-4V5H7zm-1.6 4v1.2A2 2 0 0 0 7 10V7zm13.2 0H17v3a2 2 0 0 0 1.6-1.8z'/%3E%3C/svg%3E")}
[data-panel-nav="challenges"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 3.6a6.4 6.4 0 1 1 0 12.8 6.4 6.4 0 0 1 0-12.8zm0 3.6a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6z'/%3E%3C/svg%3E")}
[data-panel-nav="tricks"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4.5V1l6 5-6 5V7.8A4.7 4.7 0 1 0 16.7 12.5h3.3A8 8 0 1 1 12 4.5z'/%3E%3C/svg%3E")}
[data-panel-nav="settings"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 5.8h9V3.8h3.2v2h4.8v2.4h-4.8v2h-3.2v-2h-9zm0 10h3.3v-2H10v2h10.5v2.4H10v2H6.8v-2H3.5z'/%3E%3C/svg%3E")}
[data-panel-nav="updates"]{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5l2.5 7.5 7.5 2.5-7.5 2.5L12 21.5 9.5 14 2 11.5 9.5 9z'/%3E%3C/svg%3E")}
/* Narrower than the whole rail: the far tabs keep their symbol and show their word only when chosen. */
@media(max-width:1380px){
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-rail-more button{font-size:0;gap:0;padding-inline:11px;letter-spacing:0}
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-rail-more button::before{width:19px;height:19px}
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-rail-more button.selected{font-size:12px;gap:7px;letter-spacing:.07em}
}
@media(max-width:650px){
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-navigation button::before{display:none}
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-rail-more button::before{display:block}
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-header{min-height:64px}
  .panel-scene .panel-scene-art{left:38%;width:66%}
}
/* A phone held sideways folds the title row away (design50.css); the scene goes with it. */
@media(max-height:480px) and (orientation:landscape){
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-header{position:absolute;min-height:0;overflow:visible;background:none}
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-header>div:not(.panel-scene){position:absolute}
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-header::after,.panel-scene{display:none}
}

/* What is on a page answers the pointer and wears the page's colour. */
#gamePanel[data-panel]:not([data-panel="results"]) .panel-content :is(.challenge-card,.trick-card,.stat-card,.profile-card,.park-career-card,.update-grid>*,.event-goal){transition:transform .18s cubic-bezier(.2,.8,.2,1),border-color .18s,box-shadow .18s}
@media(hover:hover){
  #gamePanel[data-panel]:not([data-panel="results"]) .panel-content :is(.challenge-card,.trick-card,.stat-card,.profile-card,.park-career-card,.update-grid>*,.event-goal):hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--page) 55%,transparent);box-shadow:0 14px 30px rgba(3,8,15,.45)}
}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-content .progress-track{overflow:hidden}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-content .progress-fill{position:relative;overflow:hidden;background:linear-gradient(90deg,color-mix(in srgb,var(--page) 70%,#fff 0%),var(--page))}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-content .progress-fill::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.55) 50%,transparent 70%);transform:translateX(-100%);animation:panel-sheen 2.8s ease-in-out infinite}
@keyframes panel-sheen{55%,100%{transform:translateX(100%)}}
#gamePanel[data-panel]:not([data-panel="results"]) .panel-content .panel-tabs button.selected{background:var(--page);color:#101a28;box-shadow:0 6px 18px color-mix(in srgb,var(--page) 35%,transparent)}

@media(prefers-reduced-motion:reduce){.panel-scene .panel-scene-art,.panel-scene .mode-art *,.panel-snow,#gamePanel .panel-content .progress-fill::after{animation:none}}
body.reduced-motion .panel-scene .panel-scene-art,body.reduced-motion .panel-scene .mode-art *,body.reduced-motion .panel-snow,body.reduced-motion #gamePanel .panel-content .progress-fill::after{animation:none}
body.reduced-motion .panel-snow{display:none}
