/* Stage controls share the existing game shell; no extra assets to download. */
.run-selection{margin:10px 0}.run-selection select{margin:5px 0 10px;padding:10px 12px;font-size:16px}#stage-picker[hidden],#stage-hud[hidden],#stage-next[hidden],#stage-result[hidden]{display:none}#stage-description{margin:0 0 10px;color:#c9e6f3;font-size:12px;line-height:1.45}#stage-next{margin:10px 0}.runner-links{display:flex;justify-content:space-between;gap:12px;margin-top:12px}.runner-links .credits{font-size:10px;letter-spacing:.2px;color:#c0e5f6}.route-options{display:grid;grid-template-columns:1fr 1fr;gap:16px}.route-options button{display:flex;flex-direction:column;align-items:flex-start;gap:12px;text-align:left;padding:22px;border:2px solid #75beee;border-radius:14px;background:#164b67;color:white;font:inherit;min-height:200px}.route-options button[data-route=daring]{border-color:#ffce63;background:#424331}.route-options button:hover{background:#216588}.route-options button[data-route=daring]:hover{background:#605b35}.route-options strong{font-size:18px}.route-options span:not(.route-icon){font-size:14px;line-height:1.5;color:#dceef8}.route-options small{margin-top:auto;font-size:12px;color:#d4edf8}.route-icon{font-size:32px;color:#75beee}.route-options [data-route=daring] .route-icon{color:#ffce63}.route-note,#route-intro{font-size:14px;line-height:1.6;color:#d0e8f5}#stage-hud{position:fixed;z-index:5;right:16px;top:150px;width:190px;padding:10px 12px;background:#072d44ed;border:1px solid #75beee80;border-radius:10px;pointer-events:none}#stage-hud span{display:block;font-size:11px;font-weight:900}#stage-hud progress{display:block;width:100%;height:6px;margin:8px 0;accent-color:#75beee}#stage-hud small{font-size:10px;color:#d1e9f6}body:not([data-playing=true]) #stage-hud{display:none}#stage-result{font-size:14px;font-weight:800;line-height:1.5;color:#ffdf79;border:1px solid #75beee70;border-radius:10px;padding:12px}.run-selection[aria-disabled=true]{opacity:.6;pointer-events:none}#overlay .card{max-height:100%;overflow-y:auto}.run-selection label{font-size:10px}
@media(max-width:650px){#stage-hud{width:155px;top:145px;right:12px;padding:8px 10px}.route-options{gap:10px}.route-options button{min-height:195px;padding:16px 12px}.route-options strong{font-size:16px}.route-options span:not(.route-icon){font-size:12px}.route-options small{font-size:11px}}
@media(max-height:500px) and (min-width:650px){#overlay .card .run-selection{grid-column:1;grid-row:auto}#stage-hud{top:auto;bottom:20px;left:18px;right:auto;width:210px}.route-options button{min-height:160px;padding:12px}.route-options .route-icon{font-size:22px}.route-note{margin:10px 0}#route-dialog h2{margin:4px 0 10px}}

body[data-arrived=true]:has(#results:not([hidden])) #title::before{content:"★";width:52px;height:52px;display:grid;place-items:center;border-radius:50%;background:#ffdf79;border:4px solid #fff2bd;color:#795520;box-shadow:0 0 0 3px #75beee;font-size:30px;text-shadow:none;transform:none;animation:none}

body:not([data-playing=true]) #controls{display:none}
@media(max-width:650px) and (max-height:720px){#overlay .card{padding-bottom:6px;gap:6px 10px}#overlay .game-brand{width:135px;margin:0 auto 3px}#overlay #title{margin:2px 0 5px}#overlay #title .title-game-logo{width:180px;margin:auto}#overlay .card .choice canvas{width:40px;height:40px}#overlay .card .choice button{padding:5px}#overlay .card #start{position:sticky;bottom:0;z-index:3;box-shadow:0 -5px 14px #092a40}#overlay .card:has(#results:not([hidden])) .game-brand{display:none}}

#overlay .card:has(#results:not([hidden]))>.choice,#overlay .card:has(#results:not([hidden]))>.run-selection,#overlay .card:has(#results:not([hidden]))>label[for=difficulty],#overlay .card:has(#results:not([hidden]))>#difficulty,#overlay .card:has(#results:not([hidden]))>#survival-open,#overlay .card:has(#results:not([hidden]))>#training-start,#overlay .card:has(#results:not([hidden]))>#help-open,#overlay .card:has(#results:not([hidden]))>.controls-option,#overlay .card:has(#results:not([hidden]))>.menu-tools{display:none}
#overlay .card #result-menu{margin-top:8px;border:1px solid #75beee60;border-radius:5px;padding:10px;font-size:11px}#overlay .card:has(#results:not([hidden])) #start{grid-row:auto;grid-column:1/-1}
@media(max-height:500px) and (min-width:650px){#overlay .card:has(#results:not([hidden])) #results{grid-row:auto;grid-column:1/-1}#overlay .card:has(#results:not([hidden]))>.game-brand{width:150px}#overlay .card:has(#results:not([hidden])) #title{grid-row:auto;grid-column:1/-1}}

/* Keep the current run and its two next actions together in the pause menu. */
#overlay.is-paused .card > :is(.game-brand,.choice,.run-selection,label[for=difficulty],#difficulty,#training-start,#survival-open,.runner-links) { display: none }
#overlay.is-paused .card { padding: 22px; width: min(375px,100%); border: 1px solid #83c4e66b; border-radius: 16px; background: #0b2d43f5; gap: 12px }
#overlay.is-paused .card > * { grid-column: 1 / -1; grid-row: auto }
#overlay.is-paused .card h1 { margin: 0; font-size: 38px; letter-spacing: .015em; color: #fff; text-shadow: none }
#overlay.is-paused #pause-stats { color: #a8dcff; margin: 0; padding-bottom: 10px; border-bottom: 1px solid #95cfe83b; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums }
#overlay.is-paused #start { position: static; box-shadow: none }
#overlay.is-paused .card #help-open { grid-column: 1 / -1 }
#overlay.is-paused .card :is(#help-open,#restart,#leave-friend) { min-height: 44px; border: 1px solid #75beee60; border-radius: 7px }
#overlay.is-paused .card #message:empty { display: none }
#overlay .card { overscroll-behavior: contain; scrollbar-gutter: auto }
#hud b, #result-score { font-variant-numeric: tabular-nums }
@media (pointer:coarse) {
  #overlay .card .menu-tools button, #overlay .card :is(#training-start,#help-open,#share-result,#save-result) { min-height: 42px }
}

body:has(#overlay:not([hidden])) > header { visibility: hidden }
#overlay .card select:focus-visible, #overlay .card button:focus-visible { outline-offset: 1px }
@media (min-height:501px) {
  #overlay { padding-block: max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-bottom)) }
  #overlay:not(.is-paused) .card:has(#title.is-game-logo) {
    width: min(410px,100%); border: 1px solid #80bcd55c; border-radius: 18px;
    padding: clamp(13px,2.5vw,24px); gap: 8px 10px;
    background: linear-gradient(150deg,#143e56f5,#0b2c3ff2); box-shadow: 0 14px 36px #03263c44;
  }
  #overlay .card:has(#title.is-game-logo) > .game-brand {
    grid-row: 1; grid-column: 1; align-self: center; margin: 0; width: 100%; max-width: 134px;
  }
  #overlay .card #title.is-game-logo { grid-row: 1; grid-column: 2; align-self: center; margin: 0; padding: 0 0 0 10px; border-left: 1px solid #8dbfd050 }
  #overlay #title.is-game-logo .title-game-logo { width: 100%; height: auto }
  #overlay .card:has(#title.is-game-logo) > .choice { margin-top: 6px }
  #overlay .card .run-selection select { margin: 4px 0 0 }
  #overlay .card .run-selection label, #overlay .card label[for=difficulty] { display: block; font-size: 11px; letter-spacing: .08em }
  #overlay .card :is(#start,#difficulty) { min-height: 44px }
  #overlay .card .menu-tools button { font-size: 11px }
  #overlay .card .runner-links a { font-size: 11px }
}

#practice-options { border-top: 1px solid #75beee66; padding: 9px 0 5px }
#practice-label { margin: 0 0 7px; font-size: 15px; color: #fff }
#practice-choices { display: flex; gap: 6px; flex-wrap: wrap }
#overlay .card #practice-choices button { width: auto; flex: 1 1 110px; min-height: 44px; padding: 8px; border: 1px solid #75beee; border-radius: 6px; background: #13435c; color: #eefaff; font-size: 13px }
#practice-hud { position: fixed; z-index: 5; bottom: max(82px, calc(env(safe-area-inset-bottom) + 76px)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 8px 15px; background: #092f46ef; border-left: 3px solid #75beee; border-radius: 6px; text-align: center; pointer-events: none }
#practice-obstacle, #practice-tip { display: block }
#practice-obstacle { font-size: 14px }
#practice-tip { margin-top: 2px; color: #d2eaf6; font-size: 12px }
#practice-echo-live:not(:empty):not([hidden]) { display:block; margin-top:3px; color:#94e8ff; font-size:12px }
.echo-option, #overlay .card .echo-option { display:flex; align-items:center; gap:8px; min-height:44px; color:#d2eaf6; text-align:left; font-size:13px; letter-spacing:normal; cursor:pointer }
.echo-option input { width:18px; height:18px; margin:0; accent-color:#75beee }
#echo-summary { color:#99e5ff; line-height:1.45; font-size:14px }
#friend-dialog { width:min(380px,calc(100% - 28px)) }
#friend-dialog h2 { margin:8px 0; font-size:29px }
#friend-detail { line-height:1.5 }
#friend-dialog button { display:block; width:100%; min-height:44px; margin:5px 0 }
#friend-stand[hidden] { display:none }
#overlay .card #leave-friend[hidden] { display:none }
#friend-dismiss { border:1px solid #75beee88; border-radius:5px; background:#153b51; color:white }
#friend-target:not([hidden]) { display:block; margin-bottom:2px; color:#ffdf79; font-weight:900 }
body[data-practicing=true] #friend-target, body[data-friend=true] #hud .record { display:none }
#share-status { overflow-wrap:anywhere; user-select:text }
#share-status input { display:block; width:100%; margin-top:6px; padding:10px; border:1px solid #75beee; border-radius:5px; background:#082c40; color:white; font:inherit }
#practice-dialog { width: min(390px, calc(100% - 28px)) }
#practice-dialog h2 { margin: 8px 0; font-size: 29px }
#practice-dialog #practice-detail { margin: 8px 0 16px; line-height: 1.45 }
#practice-dialog button { min-height: 44px; font-size: 14px; margin: 3px 0; width: 100% }
#practice-dialog #practice-exit { border: 1px solid #75beee88; border-radius: 5px; background: #153b51; color: white }
body[data-practicing=true] #hud :is(.score,.coins,.record),
body:not([data-playing=true]) #practice-hud, #practice-hud[hidden],
#practice-options[hidden], #practice-resume[hidden] { display: none }
@media (orientation:landscape) and (max-height:500px) {
 #practice-hud { left: 12px; bottom: 12px; transform: none; max-width: 45%; text-align: left }
}

#stand-choice:not([hidden]){display:flex;align-items:center;gap:.65rem;margin:.8rem auto;justify-content:center;font-size:.95rem}
#stand-choice input{width:1.15rem;height:1.15rem}
.stadium-stand{position:fixed;right:max(8px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top));width:clamp(200px,25vw,355px);z-index:20;background:#10364c;color:white;border-radius:8px;overflow:hidden;box-shadow:0 3px 14px #08233c88}
.stadium-stand>div:first-child{display:flex;justify-content:space-between;align-items:center;padding:.2rem .5rem;min-height:32px}
.stadium-stand a,.stadium-stand button{color:white;font:600 .85rem system-ui}
.stadium-stand button{border:0;background:transparent;padding:.3rem;cursor:pointer}
.stadium-stand iframe{display:block;min-width:200px;border:0}
@media(max-width:600px){.stadium-stand{top:max(65px,env(safe-area-inset-top));width:200px}}
.stadium-stand p:not([hidden]){margin:0;padding:.3rem .55rem;font:500 .85rem/1.25 system-ui;color:white}

@media(max-width:650px){
 body.stadium-stand-open #stage-hud{left:max(8px,env(safe-area-inset-left));right:auto;max-width:calc(100vw - 225px)}
}
