.runner-hero { padding-block: clamp(2rem,5vw,4rem) 2rem; }.runner-hero h1 { font-size: clamp(2.7rem,5vw,4.5rem); }
.runner-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }.runner-heading h2 { font: clamp(1.8rem,3vw,2.5rem)/1.2 var(--serif); margin: .5rem 0; }.runner-heading > a { font-size: .8rem; text-underline-offset: 4px; }
.runner-play { max-width: 640px; margin-inline: auto; }.runner-view { position: relative; background: #e6edcc; }
/* Keep held touch controls from opening selection handles or image callouts. */
.runner-play, .runner-play * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.runner-play button { touch-action: manipulation; }
.runner-play img { -webkit-user-drag: none; }
#runner-canvas { display: block; width: 100%; height: auto; max-height: 75svh; object-fit: contain; touch-action: none; background: #e8efdc; }
#runner-canvas:focus-visible { outline: 4px solid #bd8b35; outline-offset: -4px; }
.runner-stats { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }.runner-stats > div { display: flex; flex-direction: column; text-align: center; min-width: 34px; }.runner-stats strong { color: #f6d68b; font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }.runner-stats span { color: #dce7d1; font-size: .6rem; }
.runner-characters { display: flex; justify-content: center; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .65rem; background: #f3efdf; border-bottom: 1px solid #d9ddca; }.runner-characters > span { font-size: .75rem; color: #6a775d; margin-right: .2rem; }
.runner-characters button { display: flex; align-items: center; gap: .45rem; border-radius: 9px; font-size: .8rem; padding: .25rem .65rem .25rem .3rem; background: #fffcf1; border-color: #c8d1bc; min-height: 44px; }.runner-characters button[aria-pressed=true] { background: #315743; color: #fff4d7; border-color: #315743; box-shadow: 0 2px 0 #203f31; }
.runner-portrait { display: block; width: 36px; height: 36px; border-radius: 50%; background-image: url('Book/Memory%20Match/storybook-cards.jpg'); background-size: 400% 300%; }.bailey-portrait { background-position: 0 0; }.moose-portrait { background-position: 33.3333% 0; }
.runner-overlay { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%); width: min(86%,420px); padding: clamp(1rem,4vw,2rem); text-align: center; border: 2px solid #d5b365; border-radius: 18px; background: #fff9eaf5; box-shadow: 0 12px 50px #244b4040; }.runner-overlay[hidden] { display: none; }.runner-overlay .eyebrow { font-size: .62rem; }.runner-overlay h3 { font: clamp(1.8rem,5vw,2.5rem)/1.1 var(--serif); margin: .6rem 0; }.runner-overlay p { color: #6c745f; font-size: .9rem; line-height: 1.6; }
.runner-overlay-actions { display: flex; flex-direction: column; gap: .6rem; }.runner-overlay #start-game { background: #315743; color: #fff4d7; font-weight: 700; border-color: #315743; border-radius: 9px; min-height: 48px; }.runner-overlay #enter-score { background: #edcc7c; border-color: #d3b168; font-size: .85rem; border-radius: 9px; }
.runner-steering { display: flex; justify-content: center; align-items: center; gap: 1.3rem; margin-top: .8rem; }.runner-steering button { width: 80px; min-height: 48px; border-radius: 12px; background: #fff9e8; font-size: 1.5rem; touch-action: none; user-select: none; }.runner-steering span { color: #788366; font-size: .7rem; }.runner-save-note { margin: 1.3rem 0 2.5rem; color: #68745b; font-size: .8rem; }
.runner-page .leaderboard-table th { white-space: nowrap; overflow-wrap: normal; word-break: normal; }.runner-page .leaderboard-table th:first-child { width: 64px; }.runner-page .leaderboard-table th:nth-child(3), .runner-page .leaderboard-table th:last-child { width: 85px; }.runner-page .leaderboard-table td:nth-child(3), .runner-page .leaderboard-table th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
#retry-score { margin: .75rem 1.25rem; font-size: .8rem; }#retry-score[hidden],#enter-score[hidden] { display: none; }
.runner-play.is-expanded { max-width: none; }.runner-play.is-expanded .runner-view { flex: 1; min-height: 0; }.runner-play.is-expanded #runner-canvas { width: 100%; height: 100%; max-height: none; object-fit: contain; }.runner-play.is-expanded .runner-steering { margin: .2rem 0; flex-shrink: 0; }.runner-play.is-expanded[data-phase=running] .runner-characters,.runner-play.is-expanded[data-phase=paused] .runner-characters { display: none; }
@media(max-width:650px) { .runner-studio { padding-inline: .75rem; }.runner-stats { gap: 1rem; }.runner-stats strong { font-size: 1.1rem; }.runner-characters > span { font-size: .65rem; }.runner-steering { gap: .8rem; }.runner-steering button { width: 68px; }.runner-page .leaderboard-table th,.runner-page .leaderboard-table td { padding-inline: .55rem; }.runner-page .leaderboard-table th:first-child { width: 50px; }.runner-page .leaderboard-table th:nth-child(3) { width: 60px; }.runner-page .leaderboard-table th:last-child { width: 65px; } }
@media(orientation:landscape) and (max-height:600px) { .runner-play.is-expanded { display: flex; }.runner-play.is-expanded .maze-gamebar { flex-wrap: nowrap; padding-block: .35rem; }.runner-play.is-expanded .runner-characters { padding: .3rem; }.runner-play.is-expanded .runner-characters button { min-height: 32px; }.runner-play.is-expanded .runner-portrait { width: 24px; height: 24px; }.runner-play.is-expanded .runner-steering button { min-height: 36px; font-size: 1rem; }.runner-play.is-expanded .runner-overlay { top: 50%; padding: .6rem 1rem; max-width: 480px; }.runner-play.is-expanded .runner-overlay .eyebrow { display: none; }.runner-play.is-expanded .runner-overlay h3 { font-size: 1.4rem; margin: .2rem 0; }.runner-play.is-expanded .runner-overlay p { font-size: .75rem; margin: .4rem 0; }.runner-play.is-expanded .runner-overlay-actions { flex-direction: row; justify-content: center; }.runner-play.is-expanded .runner-overlay button { min-height: 36px !important; padding: .4rem .8rem; } }

.runner-stats .runner-lives { display: flex; gap: .2rem; align-items: center; justify-content: center; min-height: 1.6rem; }
.runner-stats .runner-lives span { color: #ffb0a1; font-size: 1.35rem; line-height: 1.2; text-shadow: 0 2px 0 #572e2950; }
.runner-stats .runner-lives span.is-lost { color: #91a293; opacity: .35; text-shadow: none; animation: runner-life-lost .4s ease-out; }
#lives-count { white-space: nowrap; }
@keyframes runner-life-lost { from { color: #fff2d4; opacity: 1; transform: scale(1.25); } to { color: #91a293; opacity: .35; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .runner-stats .runner-lives span.is-lost { animation: none; } }
.runner-play { max-width: 1100px; }
#runner-canvas { max-height: 70svh; aspect-ratio: 1000 / 560; }
.runner-play.is-expanded #runner-canvas { aspect-ratio: auto; }
.runner-steering .runner-jump { width: 150px; background: #e8c876; color: #294b38; font-weight: 750; font-size: 1rem; }
.runner-steering { gap: .8rem; }
#runner-joystick { display: none; }
@media(max-width:650px){.runner-view { min-height: 210px; }#runner-canvas { min-height: 210px; object-fit: contain; }.runner-steering .runner-jump { width: 120px; }}

.runner-play.is-expanded #runner-canvas { min-height: 0; }
/* Override the shared maze's landscape grid and full-height board. */
.runner-play.is-expanded { display: flex; flex-direction: column; align-items: stretch; overflow: hidden; }
.runner-play.is-expanded .maze-board { flex: 1 1 0; height: auto; min-height: 0; width: 100%; }
.runner-play.is-expanded .maze-gamebar, .runner-play.is-expanded .runner-levelbar, .runner-play.is-expanded .runner-characters { flex-shrink: 0; }
.runner-play.is-expanded .maze-gamebar { flex-wrap: wrap; gap: .4rem; }
.runner-play.is-expanded .runner-view { flex: 1 1 0; min-height: 0; overflow: hidden; background: var(--runner-outside,#89a95a); }
.runner-play.is-expanded #runner-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.runner-play.is-expanded #game-status { flex: 0 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media(max-width:650px) {
  .runner-play .maze-gamebar { flex-direction: column; align-items: stretch; }
  .runner-play .maze-gamebar .maze-options { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .runner-play .maze-gamebar button { padding-inline: .2rem; font-size: .68rem; }
  .runner-play .runner-stats { margin: 0; justify-content: space-around; gap: .5rem; }
}
@media(orientation:landscape) and (max-height:600px) {
  .runner-play.is-expanded .maze-gamebar .maze-options { flex: 0 1 auto; }
  .runner-play.is-expanded .runner-stats { gap: .7rem; }
  .runner-play.is-expanded .runner-levelbar { padding-block: .2rem; }
}

/* Landscape phones get thumb controls on the game rather than another row. */
@media(orientation:landscape) and (max-height:600px) {
  .runner-play.is-expanded { gap: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .runner-play.is-expanded .maze-board { border-radius: 0; }
  .runner-play.is-expanded .maze-gamebar { flex-direction: row; flex-wrap: nowrap; align-items: center; padding: .15rem .4rem; min-height: 44px; }
  .runner-play.is-expanded .maze-gamebar .maze-options { display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: .2rem; }
  .runner-play.is-expanded .maze-gamebar button { width: 44px; min-height: 40px; padding: .2rem; font-size: 0; box-shadow: none; }
  .runner-play.is-expanded #sound::after { content: 'SFX'; font-size: .65rem; }
  .runner-play.is-expanded #music::after { content: '♫'; font-size: 1.2rem; }
  .runner-play.is-expanded #pause::after { content: 'Ⅱ / ▶'; font-size: .7rem; }
  .runner-play.is-expanded #fullscreen::after { content: '⤢'; font-size: 1.3rem; }
  .runner-play.is-expanded .maze-gamebar button[aria-pressed=false] { opacity: .6; }
  .runner-play.is-expanded .runner-stats { flex: 1; margin: 0; justify-content: space-around; gap: .3rem; }
  .runner-play.is-expanded .runner-stats strong { font-size: 1rem; }
  .runner-play.is-expanded .runner-stats .runner-lives { min-height: 1.2rem; }
  .runner-play.is-expanded .runner-stats .runner-lives span { font-size: 1.05rem; }
  .runner-play.is-expanded .runner-steering { position: absolute; z-index: 4; inset: auto max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: 0; pointer-events: none; }
  .runner-play.is-expanded .runner-steering button { pointer-events: auto; width: 60px; min-height: 52px; background: #fff9e8d9; border: 2px solid #31574388; font-size: 1.4rem; }
  .runner-play.is-expanded .runner-steering [data-move=left], .runner-play.is-expanded .runner-steering [data-move=right] { display: none; }
  .runner-play.is-expanded #runner-joystick { display: block; position: relative; width: 64px; height: 64px; min-height: 64px; padding: 0; border-radius: 50%; background: #fff9e866; touch-action: none; }
  .joystick-thumb { position: absolute; width: 30px; height: 30px; left: calc(50% - 15px); top: calc(50% - 15px); border-radius: 50%; background: #315743dd; border: 2px solid #fff4d7; box-shadow: 0 2px 5px #173b2e55; transform: translate(var(--stick-x,0px),var(--stick-y,0px)); pointer-events: none; }
  .runner-play.is-expanded .runner-steering .runner-jump { width: 56px; height: 56px; min-height: 56px; padding: .2rem; border-radius: 50%; font-size: .75rem; background: #e8c876dd; }
  .runner-play.is-expanded:not([data-phase=running]) .runner-steering { display: none; }
  .runner-play.is-expanded .runner-levelbar, .runner-play.is-expanded #game-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
.runner-levelbar { display:flex; align-items:center; gap:.8rem; padding:.6rem 1rem; background:#e9efdc; color:#4c6340; font-size:.72rem; }
.runner-levelbar strong { min-width:130px; }.runner-levelbar progress { flex:1; width:80px; height:8px; accent-color:#9a7931; }.runner-levelbar span { font-variant-numeric:tabular-nums; }
.runner-secret { position:absolute; z-index:5; inset:0; overflow:auto; background:#173b2e; color:#fff7df; display:flex; align-items:flex-end; }
.runner-secret[hidden] { display:none; }.runner-secret img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.secret-copy { position:relative; width:100%; padding:clamp(1rem,3vw,2rem); text-align:center; background:linear-gradient(transparent,#12372de8 22%); }
.runner-page .secret-copy .eyebrow { color:#f8dc83; font-size:.65rem; margin:.5rem 0; }.secret-copy h3 { font:clamp(1.4rem,3vw,2.5rem)/1.1 var(--serif); margin:.3rem 0; }.secret-copy p { font-size:.85rem; margin:.6rem 0; color:#e0ebd6; }.secret-copy button { background:#f0cb74; color:#254330; border:0; border-radius:8px; font-weight:700; min-height:44px; }
.runner-play.is-expanded[data-phase=secret] .runner-characters { display:none; }
.runner-levelbar strong { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-secret { display: grid; grid-template-columns: minmax(0,2fr) minmax(175px,1fr); align-items: center; gap: .5rem; padding: .75rem; background: radial-gradient(ellipse at top,#245a79,#102d45 80%); }
.runner-secret img { position: static; width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 8px 20px #0006); }
.runner-secret .secret-copy { margin: 0; width: 100%; padding: .5rem; background: transparent; }
.runner-secret #secret-subtitle { font: italic clamp(1rem,2vw,1.5rem) Georgia,serif; color: #f0d795; }
.runner-secret #secret-description { line-height: 1.5; }
@media(max-width:650px) and (orientation:portrait){.runner-secret { grid-template-columns: 1fr;grid-template-rows: minmax(0,1fr) auto;padding:.4rem;gap:.2rem; }.runner-secret .secret-copy { padding:.2rem; }.runner-secret .secret-copy h3 { font-size:1.1rem; }.runner-secret #secret-subtitle,.runner-secret #secret-description { display:none; }.runner-secret .eyebrow { margin:.1rem; }}
@media(orientation:landscape) and (max-height:600px){.runner-secret { padding:.5rem; }.runner-secret .secret-copy h3 { font-size:1.25rem; }.runner-secret #secret-subtitle { font-size:.9rem; }.runner-secret #secret-description { font-size:.7rem; }.runner-secret .secret-copy button { min-height:36px;font-size:.75rem;padding:.4rem .6rem; }}
@media(max-width:650px){.runner-levelbar { padding:.4rem .6rem;gap:.4rem;font-size:.63rem;}.runner-levelbar strong { min-width:0;max-width:145px; }.secret-copy { padding:.5rem .75rem; }.secret-copy p { font-size:.7rem;margin:.35rem 0; }.secret-copy button { padding:.45rem .75rem;min-height:36px;font-size:.75rem; }}
