@import url('https://cdn.jsdelivr.net/npm/galmuri@latest/dist/galmuri.css');
:root{--sky:#a9d9f5;--cream:#fff6e6;--blue:#6f9fc5;--deep:#426f92;--pink:#f5aec5;--ink:#3c617c}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#d6eaf6;color:var(--ink);font-family:'Gowun Dodum',system-ui,sans-serif}body{display:grid;place-items:center}button,input{font:inherit}button{cursor:pointer}.hidden,[hidden]{display:none!important}#app{width:min(100vw,1100px);padding:10px}.page{position:relative;min-height:620px;padding:35px 24px;text-align:center;overflow:hidden;background-color:var(--sky);background-image:radial-gradient(#fff8 1px,transparent 1px);background-size:14px 14px;border:5px solid var(--cream);box-shadow:8px 8px 0 #9bbbd0}.page-kicker{font-size:12px;font-weight:900;letter-spacing:2px;color:var(--deep)}.cover-page{display:flex;flex-direction:column;align-items:center;justify-content:center}.cover-title{margin:28px 0 10px;font-family:'Press Start 2P',monospace;font-size:clamp(32px,6vw,67px);line-height:1.4;color:#fffdf3;text-shadow:4px 4px 0 #79b5de,8px 8px 0 #487da4}.cover-title span{display:block;color:#ffe9bf}.cover-subtitle{font-size:21px;font-weight:900;margin:0 0 14px}.cover-characters{display:flex;align-items:center;justify-content:center;gap:22px;min-height:175px}.cover-characters img{width:145px;height:145px;object-fit:contain;image-rendering:pixelated;animation:bob 2.2s ease-in-out infinite}.cover-characters img:last-child{animation-delay:.5s}.cover-trail{font-size:27px;color:#fff6cb}.sparkle{position:absolute;font-size:34px;color:#fff5bc;animation:bob 2s ease-in-out infinite}.s1{top:18%;left:12%}.s2{top:25%;right:15%;color:var(--pink)}.s3{bottom:19%;right:19%}@keyframes bob{50%{transform:translateY(-12px)}}.pixel-btn{min-width:215px;padding:14px 22px;border:3px solid var(--deep);border-radius:3px;background:var(--cream);color:var(--deep);font-size:19px;font-weight:900;box-shadow:5px 5px 0 #79add1}.pixel-btn:hover{transform:translate(2px,2px);box-shadow:3px 3px 0 #79add1}.pixel-btn:active{transform:translate(5px,5px);box-shadow:none}.cover-footer{margin-top:26px;font-size:12px;font-weight:900;letter-spacing:2px}.panel{width:min(100%,650px);margin:22px auto 28px;padding:25px;background:var(--cream);border:4px solid var(--deep);box-shadow:7px 7px 0 #78b0d3}.panel h2,.card-page-title{font-size:clamp(22px,3vw,32px);color:var(--deep);margin:0 0 14px;font-weight:900}.intro{font-size:16px;line-height:1.7}.control-box{display:grid;gap:5px;background:#dceffa;padding:14px;margin:18px 0}.control-box strong{font-size:16px}.control-box span{font-size:13px}.item-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:18px 0}.item-grid>div{background:#e4f2fa;border:2px solid #a4cce3;padding:12px 4px;display:grid;gap:5px}.item-grid span{font-size:28px}.item-grid b{font-size:13px}.item-grid small{font-size:11px}.guide-note{line-height:1.8;font-size:14px}.account-panel{max-width:460px}.photo-preview{width:115px;height:115px;margin:12px auto 10px;border:3px dashed #80b4d5;background:#e2f3fb;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--deep);overflow:hidden}.photo-preview span{font-size:42px}.photo-preview small{font-size:11px}.photo-preview img,.card-photo img{width:100%;height:100%;object-fit:cover}.photo-select{display:inline-block;background:#d9eefb;border:2px solid var(--blue);padding:8px 15px;cursor:pointer}.field-label{display:block;text-align:left;font-size:12px;font-weight:900;margin:14px 0 5px}.pixel-input{display:block;width:100%;border:2px solid var(--blue);border-radius:0;padding:12px;background:white;color:#2e526d;outline:none}.pixel-input:focus{border-color:var(--deep)}.account-message{min-height:18px;color:#ba5770;font-size:12px}.account-footnote,.card-note{font-size:11px;line-height:1.7;color:#668da8}.runner-card{width:min(100%,490px);margin:35px auto 18px;padding:20px;text-align:left;background:var(--cream);border:4px solid var(--deep);box-shadow:8px 8px 0 #78b0d3}.card-top,.card-bottom{display:flex;justify-content:space-between;color:var(--deep);font-size:12px}.card-body{display:flex;gap:22px;margin:22px 0;align-items:center}.card-photo{width:145px;height:165px;flex-shrink:0;border:3px solid #8bbad7;background:#dceefa;display:grid;place-items:center;overflow:hidden;font-size:42px}.card-stats{display:grid;gap:5px;min-width:0}.card-stats small{color:#789fba;font-size:10px}.card-stats strong{font-size:19px;overflow-wrap:anywhere;margin-bottom:8px}.card-bottom{border-top:2px solid #d1e5ee;padding-top:13px;justify-content:center}.card-note{margin:12px 0 22px}.game-page{padding:10px;min-height:0;background:var(--cream)}#screen{position:relative;width:100%;aspect-ratio:16/9;overflow:hidden;border:4px solid #87b7d7;border-radius:5px;background:#d6f0ff;touch-action:none;user-select:none}canvas{display:block;width:100%;height:100%;image-rendering:pixelated}#hud{position:absolute;inset:12px 14px auto;display:flex;justify-content:space-between;gap:12px;color:#344f68;font-weight:900;font-size:clamp(11px,2vw,19px);pointer-events:none}.hud-pill{padding:6px 10px;background:#fff6e6e8;border:2px solid #85b4d3;box-shadow:3px 3px 0 #6f9fc577}#overlay{position:absolute;inset:0;display:grid;place-items:center;background:#17172b9c}#overlay.hidden{display:none}.modal{width:min(85%,430px);padding:22px;text-align:center;background:var(--cream);color:#373249;border:5px solid var(--deep);box-shadow:8px 8px #25253b;border-radius:6px}.modal h1{font-size:clamp(21px,4vw,36px);margin:0 0 10px}.modal p{line-height:1.6;font-size:clamp(11px,1.8vw,16px)}#start{background:#b3dcf2;color:#345b79;border:3px solid #345b79;padding:10px 30px;font-weight:900;font-size:20px;border-radius:4px}.secondary-btn{display:block;margin:12px auto 0;border:0;background:transparent;color:var(--deep);font-weight:900;text-decoration:underline}.hint{font-size:11px!important;color:#777}#feverBanner{position:absolute;top:16%;left:50%;transform:translateX(-50%);color:#ffdf70;font-weight:1000;font-size:clamp(22px,5vw,48px);text-shadow:3px 4px #81375d;pointer-events:none;white-space:nowrap}#speech{position:absolute;top:32%;left:48%;max-width:45%;background:#fff9f0;border:3px solid #584a70;border-radius:18px;color:#443851;padding:10px 14px;font-size:clamp(12px,2vw,22px);font-weight:800;pointer-events:none}.help{text-align:center;font-size:12px;color:#557a96}@media(max-width:600px){#app{padding:0}.page{min-height:100dvh;padding:25px 14px;border-width:2px;box-shadow:none}.cover-characters{gap:5px}.cover-characters img{width:110px;height:120px}.cover-trail{font-size:17px}.panel{padding:16px}.item-grid{gap:4px}.item-grid>div{padding:8px 2px}.item-grid small{font-size:10px}.card-photo{width:110px;height:135px}.card-body{gap:13px}.card-stats strong{font-size:15px}.game-page{min-height:0;padding:4px}#screen{border-width:2px}.modal{padding:8px;border-width:3px;box-shadow:4px 4px #25253b}.modal h1{margin:0;font-size:18px}.modal p{font-size:10px;line-height:1.3;margin:5px}.modal #start{padding:5px 20px;font-size:13px}.hint{display:none}.help{font-size:11px}.hud-pill{padding:3px 5px;border-width:1px}}

/* Cover: matching running sprites and baseline */
.cover-page{background:#a9d9f5;background-image:radial-gradient(#ffffff70 1px,transparent 1px);background-size:20px 20px;isolation:isolate}
.cover-page .cover-title{z-index:2;margin:15px 0 2px}
.cover-page .cover-subtitle{z-index:2;margin:0 0 3px;font-size:clamp(12px,1.5vw,17px);letter-spacing:2px;color:#477fa7}
.cover-page .page-kicker{z-index:2}
.cover-scene{position:relative;width:min(100%,760px);height:245px;margin:0 auto 5px;overflow:hidden}
.cover-action{position:absolute;inset:8px 0 12px;display:flex;align-items:flex-end;justify-content:space-between;padding:0 10%;z-index:2}
.runner-wonbin,.runner-sohee{width:clamp(120px,18vw,185px);height:205px;display:flex;align-items:flex-end;justify-content:center;flex-shrink:0}
.runner-wonbin{animation:wonbin-arrives 1.45s cubic-bezier(.2,.8,.25,1) both}
.runner-wonbin img,.runner-sohee img{display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated;animation:run-bounce .28s steps(2,end) infinite}
.cover-trail{display:flex;gap:14px;align-self:center;margin-top:35px;color:#fff4bd;font-size:clamp(23px,3vw,38px);text-shadow:2px 3px #7aadd0;white-space:nowrap}
.cover-trail span{animation:trail-glow 1.5s ease-in-out infinite alternate}
.cover-trail span:nth-child(2){color:#ffbfd3;animation-delay:.35s}
.cover-trail span:nth-child(3){animation-delay:.7s}
.cover-ground{position:absolute;bottom:8px;left:9%;width:82%;height:5px;background:#fff8e5;box-shadow:0 5px #78afd2;opacity:.8}
.cover-cloud{position:absolute;width:95px;height:27px;border-radius:25px;background:#eaf8ff;opacity:.75;top:30px;animation:cloud-drift 7s ease-in-out infinite alternate}
.cover-cloud:before,.cover-cloud:after{content:'';position:absolute;background:inherit;border-radius:50%}
.cover-cloud:before{width:44px;height:44px;left:17px;bottom:5px}
.cover-cloud:after{width:36px;height:36px;right:12px;bottom:2px}
.cloud-left{left:3%;top:35px}.cloud-right{right:3%;top:65px;transform:scale(.75);animation-delay:-3s}
.cover-page #coverNext{z-index:2;margin-top:4px}
.cover-page .cover-footer{z-index:2;margin-top:20px}
@keyframes wonbin-arrives{from{transform:translateX(-340px);opacity:0}to{transform:translateX(0);opacity:1}}
@keyframes run-bounce{50%{transform:translateY(-7px)}}
@keyframes trail-glow{to{transform:translateY(-8px) scale(1.12);opacity:.7}}
@keyframes cloud-drift{to{translate:20px 0}}
@media(max-width:600px){.cover-page{justify-content:center}.cover-scene{height:195px}.cover-action{padding:0 2%;inset:5px 0 10px}.runner-wonbin,.runner-sohee{width:34%;height:170px}.cover-trail{gap:4px;font-size:20px;margin-top:10px}.cover-cloud{opacity:.5}.cover-page .cover-title{font-size:clamp(30px,9vw,48px)}.cover-page .cover-footer{font-size:10px;letter-spacing:1px}}
@media(prefers-reduced-motion:reduce){.runner-wonbin,.runner-wonbin img,.runner-sohee img,.cover-trail span,.cover-cloud{animation:none}}
/* ========================================
   SOHEE, WAIT! - PIXEL GAME FONT
======================================== */

:root {
  --game-font: 'Galmuri11', monospace;
}

/* 게임 전체 폰트 */
html,
body,
button,
input,
textarea,
select,
canvas {
  font-family: var(--game-font);
}

/* 모든 화면의 글씨 통일 */
#app,
#app * {
  font-family: var(--game-font);
}

/* 메인 표지 제목 */
.cover-title {
  font-family: var(--game-font);
  font-weight: 700;
  letter-spacing: 1px;
}

/* START / NEXT / RETRY 버튼 */
.pixel-btn,
.secondary-btn,
button {
  font-family: var(--game-font);
  font-weight: 700;
}

/* 설명 및 안내 */
.intro,
.guide-note,
.help,
.hint,
.account-footnote {
  font-family: var(--game-font);
}

/* 러너 카드 */
.runner-card,
.card-stats,
.card-page-title {
  font-family: var(--game-font);
}

/* 점수 및 피버 게이지 */
#hud,
.hud-pill,
#feverBanner,
#speech {
  font-family: var(--game-font);
}

/* Language selector - cover only */
.language-selector{position:absolute;top:18px;right:18px;z-index:100;text-align:right}
.language-button{padding:9px 13px;background:#fff6e6;color:#426f92;border:3px solid #426f92;border-radius:3px;box-shadow:4px 4px 0 #79add1;font-family:'Galmuri11',sans-serif;font-size:12px;font-weight:bold;cursor:pointer}
.language-menu{position:absolute;top:calc(100% + 8px);right:0;width:175px;padding:5px;background:#fff6e6;border:3px solid #426f92;box-shadow:5px 5px 0 #79add1;z-index:101}
.language-menu button{display:block;width:100%;padding:9px 8px;border:0;background:transparent;color:#426f92;text-align:left;font-family:'Galmuri11',sans-serif;font-size:12px;cursor:pointer}
.language-menu button:hover,.language-menu button.active{background:#dceffa}
@media(max-width:600px){.language-selector{top:12px;right:10px}.language-button{font-size:10px;padding:7px}.language-menu{width:160px}}
/* Thai/CJK glyph fallback */
html[lang="th"] #app *,html[lang="th"] button{font-family:'Galmuri11',Tahoma,'Noto Sans Thai',sans-serif}
html[lang="zh"] #app *,html[lang="ja"] #app *{font-family:'Galmuri11','Noto Sans CJK SC','Noto Sans CJK JP',sans-serif}

/* Sound toggle: fixed above all pages, including mobile */
#soundToggle{position:fixed;bottom:14px;right:14px;z-index:1000;border:2px solid #426f92;background:#fff6e6;color:#426f92;padding:8px 10px;font-size:11px;box-shadow:3px 3px #79add1;cursor:pointer}
@media(max-width:600px){#soundToggle{bottom:8px;right:8px;font-size:9px;padding:6px}}

/* Rotation guidance and landscape layout */
#rotateNotice{display:none;position:fixed;inset:0;z-index:9999;background:#1b1232;color:#fff6e6;align-items:center;justify-content:center;text-align:center;padding:24px;font-family:var(--game-font,'Galmuri11',monospace)}
.rotate-panel{width:min(100%,340px);border:3px solid #e8c5ef;background:#34264d;padding:26px 18px;box-shadow:6px 6px 0 #100b1c}
.rotate-icon{font-size:54px;line-height:1.3;margin-bottom:12px;animation:rotate-prompt 2.2s ease-in-out infinite}
.rotate-title{font-size:clamp(16px,5vw,22px);font-weight:900;line-height:1.6}
.rotate-desc{font-size:12px;line-height:1.7;margin-top:10px;color:#d9c5ed}
@keyframes rotate-prompt{50%{transform:rotate(90deg)}}
@media (orientation:portrait) and (max-width:700px){
  #rotateNotice{display:flex}
  body{overflow:hidden}
}









/* Firebase account and leaderboard */
.auth-modes{display:flex;justify-content:center;gap:10px;margin:10px auto}
.auth-modes button{font:inherit;cursor:pointer;border:2px solid #678ba5;background:#fdf5e6;color:#486a86;padding:7px 18px}
.auth-modes .auth-active{background:#cce8ff;box-shadow:3px 3px #648eae}
.leaderboard-panel{width:min(95%,540px);margin:12px auto;padding:10px 15px;border:3px solid #789ab8;background:#fff8e9;color:#425c79;text-align:left}
.leaderboard-panel h3{text-align:center;margin:2px 0 8px;font-size:1em}
.leaderboard-panel ol{margin:0;padding-left:30px;max-height:160px;overflow:auto;font-size:.8em}
.leaderboard-panel li{padding:2px 0;display:list-item}
.leaderboard-panel li span{float:right}
#rankingNotice{font-size:.65em;margin:6px 0 0;text-align:center}

/* Post-game ranking: avatars are opt-in public photos */
.photo-consent{display:flex;align-items:flex-start;gap:8px;text-align:left;font-size:11px;line-height:1.6;margin:12px 0;color:#426f92}
.photo-consent input{margin-top:3px;flex-shrink:0}
.ranking-page{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}
.ranking-page .card-page-title{margin:4px 0}
.ranking-subtitle{font-size:14px;font-weight:bold;margin:0}
.ranking-page .leaderboard-panel{width:min(95%,620px);padding:14px 20px;margin:6px auto}
.ranking-page #leaderboard{list-style:none;margin:0;padding:0;max-height:none;overflow:visible;display:grid;gap:5px;font-size:13px}
.ranking-page #leaderboard li{display:flex;align-items:center;gap:12px;min-height:43px;padding:4px 8px;background:#e9f4fc;border:1px solid #c0d9e9}
.ranking-page #leaderboard li:nth-child(1){background:#fff0c5}
.ranking-page #leaderboard li:nth-child(2){background:#e6eaf2}
.ranking-page #leaderboard li:nth-child(3){background:#f4dfd0}
.rank-number{width:28px;flex-shrink:0;text-align:center;color:#426f92}
.rank-avatar{width:34px;height:34px;flex-shrink:0;display:grid;place-items:center;overflow:hidden;border:2px solid #88b8d5;background:#fff8e9;font-size:20px}
.rank-avatar img{width:100%;height:100%;object-fit:cover}
.rank-name{flex:1;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ranking-page #leaderboard li .rank-score{float:none;white-space:nowrap;font-weight:bold}
.ranking-page #rankingNotice{font-size:10px;line-height:1.4}
.ranking-page #rankingRetry{margin-top:2px}
.ranking-page #rankingMenu{margin-top:2px}
#gameOverNext{background:#b3dcf2;color:#345b79;border:3px solid #345b79;padding:10px 30px;font-weight:900;font-size:20px;border-radius:4px}
#overlay .modal #start{display:block;margin:8px auto 0;background:transparent;border:0;box-shadow:none;font-size:12px;padding:3px 8px;text-decoration:underline}
@media(max-width:600px){.ranking-page #leaderboard{font-size:11px}.ranking-page .leaderboard-panel{padding:8px}.ranking-page #leaderboard li{gap:6px;min-height:36px;padding:3px 5px}.rank-avatar{width:29px;height:29px}}


/* Ranking: desktop uses a bounded scroll panel. */
.ranking-page { justify-content:flex-start; gap:8px; }
.ranking-page .leaderboard-panel {
  flex:1 1 auto; min-height:0; max-height:440px;
  overflow-x:hidden; overflow-y:auto;
  -webkit-overflow-scrolling:touch; touch-action:pan-y;
}
.ranking-page #leaderboard { max-height:none; overflow:visible; }

/* Mobile landscape: scale the game, but render ranking in the real viewport. */
@media (orientation:landscape) and (max-height:600px) and (max-width:1200px) {
html,body { margin:0; width:100%; height:100%; min-height:0; overflow:hidden; }
  body { display:flex; align-items:center; justify-content:center; }
  #app {
    width:1000px !important;
    min-width:1000px;
    flex:0 0 1000px;
    padding:0 !important;
    margin:0 !important;
    transform:scale(var(--landscape-fit, .5));
    transform-origin:center center;
    position:relative;
  }
  #app > .page {
    width:100%;
    height:auto !important;
    min-height:620px !important;
    padding:20px 24px !important;
    overflow:visible !important;
    box-shadow:none;
  }
  #app > .cover-page { min-height:620px !important; }
  .cover-page .cover-title { font-size:55px; line-height:1.3; margin:10px 0; }
  .cover-page .cover-subtitle { font-size:15px; }
  .cover-page .page-kicker { font-size:12px; }
  .cover-scene { height:210px; }
  .runner-wonbin,.runner-sohee { width:155px; height:190px; }
  .cover-page #coverNext { min-width:210px; padding:12px 20px; font-size:19px; }
  .cover-page .cover-footer { font-size:12px; margin-top:18px; }
  .panel { margin:14px auto 16px; padding:18px; }
  .panel h2,.card-page-title { font-size:26px; margin-bottom:10px; }
  .intro,.guide-note { font-size:15px; line-height:1.55; }
  .control-box { margin:12px 0; padding:12px; }
  .control-box strong { font-size:16px; }
  .control-box span { font-size:13px; }
  .item-grid { margin:12px 0; gap:8px; }
  .item-grid>div { padding:10px 4px; }
  .item-grid span { font-size:27px; }
  .item-grid b { font-size:13px; }
  .item-grid small { font-size:11px; }
  .runner-card { margin:16px auto 12px; padding:16px; }
  .card-body { margin:14px 0; }
  .photo-preview { width:85px; height:85px; margin:7px auto; }
  .field-label { margin:9px 0 4px; }
  .pixel-input { padding:10px; }
  .language-selector { top:14px; right:14px; }
  .language-button { font-size:12px; padding:8px 12px; }
  #soundToggle { position:absolute; top:10px; left:10px; right:auto; bottom:auto; font-size:11px; padding:7px 9px; }
  #app > .game-page { min-height:0 !important; padding:6px !important; overflow:hidden !important; }
  .game-page #screen { width:100%; height:auto !important; aspect-ratio:16/9; border-width:3px; }
  .game-page .help { display:none; }
  #hud { inset:10px 12px auto; font-size:17px; }
  .hud-pill { padding:5px 9px; border-width:2px; }
  .modal { padding:15px; max-height:95%; }
  .modal h1 { font-size:25px; }
  .modal p { font-size:13px; line-height:1.5; }
  .modal #start { font-size:18px; padding:9px 25px; }
#app:has(#gameScreen:not(.hidden)) > #soundToggle {
    top:76px;
    left:12px;
    right:auto;
    bottom:auto;
  }
html.ranking-mobile-active,
  html.ranking-mobile-active body {
    width:100% !important; height:100% !important;
    min-height:0 !important; overflow:hidden !important;
  }
  html.ranking-mobile-active body {
    display:block !important; align-items:unset !important;
    justify-content:unset !important;
  }
  html.ranking-mobile-active #app {
    transform:none !important; transform-origin:initial !important;
    position:static !important; display:block !important;
    width:100% !important; min-width:0 !important;
    height:100% !important; flex:none !important;
    margin:0 !important; padding:0 !important;
  }
  html.ranking-mobile-active #rankingScreen {
    position:fixed !important; inset:0 !important;
    z-index:50 !important;
    display:flex !important; flex-direction:column !important;
    align-items:center !important; justify-content:flex-start !important;
    width:100% !important; height:100% !important;
    height:100dvh !important; min-height:0 !important;
    max-height:100dvh !important;
    padding:6px 12px 7px !important;
    gap:2px !important; overflow:hidden !important;
    box-shadow:none !important; box-sizing:border-box !important;
  }
  html.ranking-mobile-active #rankingScreen .page-kicker,
  html.ranking-mobile-active #rankingScreen .card-page-title,
  html.ranking-mobile-active #rankingScreen .ranking-subtitle {
    flex:0 0 auto !important; margin:0 !important;
    line-height:1.15 !important;
  }
  html.ranking-mobile-active #rankingScreen .page-kicker { font-size:9px !important; }
  html.ranking-mobile-active #rankingScreen .card-page-title { font-size:17px !important; }
  html.ranking-mobile-active #rankingScreen .ranking-subtitle { font-size:10px !important; }
  html.ranking-mobile-active #rankingScroll {
    flex:1 1 0 !important; min-height:0 !important;
    height:0 !important; max-height:none !important;
    width:min(94%,660px) !important;
    margin:2px auto !important; padding:5px 8px !important;
    overflow-x:hidden !important; overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
    touch-action:pan-y !important;
    overscroll-behavior:contain;
  }
  html.ranking-mobile-active #leaderboard { max-height:none !important; overflow:visible !important; }
  html.ranking-mobile-active #leaderboard li { height:29px !important; min-height:29px !important; padding:1px 5px !important; gap:7px !important; font-size:11px !important; }
  html.ranking-mobile-active #rankingRetry {
    flex:0 0 auto !important; min-width:130px !important;
    margin:2px auto 0 !important; padding:5px 12px !important;
    font-size:12px !important;
  }
  html.ranking-mobile-active #rankingMenu {
    flex:0 0 auto !important; margin:0 auto !important;
    padding:2px 8px !important; font-size:10px !important;
  }
  html.ranking-mobile-active #soundToggle {
    position:fixed !important; top:6px !important; left:6px !important;
    right:auto !important; bottom:auto !important; z-index:1000 !important;
  }

  /* Compact only the mobile ranking rows; preserve the working scroll container. */
  html.ranking-mobile-active #rankingScreen .rank-avatar {
    width:23px !important; height:23px !important;
    border-width:1px !important; font-size:13px !important;
  }
  html.ranking-mobile-active #rankingScreen .rank-number {
    width:23px !important; font-size:10px !important;
  }
  html.ranking-mobile-active #rankingScreen .rank-name,
  html.ranking-mobile-active #rankingScreen .rank-score {
    font-size:11px !important; line-height:1.2 !important;
  }
  html.ranking-mobile-active #rankingScreen #leaderboard {
    gap:3px !important; font-size:11px !important;
  }
  html.ranking-mobile-active #rankingScreen #rankingNotice {
    font-size:9px !important; margin:3px 0 0 !important;
  }
}
