/* REAL_GRIND_NINJA presentation. Original course and in-game controls retained. */
:root { color-scheme: light; }
.brand { transform: none; gap: 8px; }
.brand > span:nth-child(2) { font-size: clamp(18px, 2.3vw, 34px); letter-spacing: -.05em; line-height: 1; white-space: nowrap; }
.brand > span:nth-child(2) > span { display: block; color: #ffe44e; }
.brand > b, .brand-bean { display: none; }
.rg-roster { position: absolute; z-index: 4; right: 28px; bottom: 90px; width: 334px; max-height: 62vh; overflow-y: auto; border: 3px solid #302451; border-radius: 22px; background: #fffcf7f7; padding: 18px; color: #302451; box-shadow: 0 6px #302451, 0 16px 36px #30245128; }
.rg-roster-heading { display: flex; flex-direction: column; gap: 4px; }
.rg-roster-heading > span { font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.rg-roster-heading > strong { font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.rg-roster > p { font-size: 16px; line-height: 1.35; margin: 10px 0 14px; }
.rg-character-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.rg-character-grid button { display: flex; align-items: center; text-align: left; gap: 6px; min-height: 43px; padding: 8px; border: 2px solid #d4cbdc; border-radius: 10px; color: #302451; background: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.rg-character-grid button.selected { border-color: #302451; background: #ffe44e; box-shadow: 0 2px #302451; }
.rg-character-grid button:hover { background: #def8f6; }
.rg-character-grid button:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #006a86; outline-offset: 3px; }
.rg-check { flex: 0 0 14px; font-size: 15px; }
.course-sticker { display: none; }
.welcome .intro { font-size: 16px; }
.course-stats, .mode-note, .knockout-preview > p { font-size: 14px; }
.menu-footer { font-size: 11px; }
.welcome { top: 19%; }
.welcome h1 { font-size: clamp(40px, 4.8vw, 76px); line-height: .95; letter-spacing: -.045em; }
.in-menu .welcome { top: 125px; bottom: 76px; max-height: none; overflow-y: auto; scrollbar-width: thin; padding: 10px 12px 16px 3px; }
.welcome .eyebrow { font-size: 12px; margin-bottom: 15px; }
.welcome .intro { margin-bottom: 15px; }
.welcome .course-stats { font-size: 12px; margin-bottom: 16px; }
.welcome .knockout-preview p { font-size: 13px; }
.welcome .mode-picker { margin-top: 14px; }
.welcome .play-button { min-height: 60px; }
.welcome .trail-invite { margin-top: 12px; }
.welcome .how-button { margin-top: 12px; }
.course-lineup { bottom: 72px; left: 50%; }
@media (min-width: 1050px) { .welcome { max-width: min(46vw, 550px); left: 5%; } }
@media (max-width: 1049px) and (min-width: 761px) { .rg-roster { right: 16px; width: 296px; padding: 14px; } .welcome { left: 24px; max-width: 46vw; } .welcome h1 { font-size: 72px; } }
@media (max-width: 760px) {
  html:has(.in-menu), body:has(.in-menu) { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .game-shell.in-menu { height: auto; min-height: 100dvh; overflow: visible; padding: 88px 16px 0; display: flex; flex-direction: column; }
  .in-menu .world { position: fixed; height: 100dvh; }
  .in-menu .menu-shade { position: fixed; background: linear-gradient(180deg, #277ca8dd, #267bbbbb); }
  .topbar { top: 18px; left: 18px; right: 18px; }
  .brand > span:nth-child(2) { font-size: 22px; }
  .in-menu .welcome { position: relative; inset: auto; width: 100%; max-width: 510px; max-height: none; overflow: visible; margin: 0 auto; padding: 12px 0 18px; }
  .in-menu .welcome h1 { font-size: clamp(32px, 8.8vw, 56px); }
  .in-menu .eyebrow { margin-bottom: 12px; }
  .in-menu .intro { font-size: 16px; }
  .in-menu .play-button { width: 100%; }
  .in-menu .rg-roster { position: relative; inset: auto; width: 100%; max-width: 510px; max-height: none; margin: 10px auto 22px; padding: 16px; }
  .rg-character-grid button { min-height: 46px; font-size: 13px; }
  .in-menu .course-lineup { position: relative; inset: auto; flex-wrap: wrap; justify-content: center; margin: 10px auto 22px; max-width: 510px; gap: 12px; }
  .in-menu .menu-footer { position: relative; inset: auto; width: calc(100% + 32px); margin-left: -16px; min-height: 54px; height: auto; padding: 16px; flex-wrap: wrap; gap: 10px; }
  .in-menu .menu-footer > span:nth-child(2) { display: none; }
  .in-game .topbar { top: max(12px, env(safe-area-inset-top)); }
  .in-game .brand > span:nth-child(2) { font-size: 16px; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .in-menu .welcome { top: 90px; }
  .in-menu .welcome h1 { font-size: 52px; }
  .in-menu .rg-roster { top: 85px; bottom: 62px; max-height: none; }
  .in-menu .course-lineup { display: none; }
}
@media (prefers-reduced-motion: reduce) { .rg-roster *, .brand { animation: none !important; transition: none !important; } }

/* Startup stays visible while the selected character downloads. */
.rg-boot { min-height: 100svh; display: grid; align-content: center; justify-items: center; gap: 18px; padding: 24px; color: #302451; text-align: center; }
.rg-boot h1 { font: 900 clamp(24px,5vw,48px)/1.15 system-ui; overflow-wrap: anywhere; }
.rg-boot p { font-size: 18px; }
.rg-load-progress { display: block; width: 100%; height: 16px; accent-color: #5a36a9; margin: 10px 0; }
.rg-roster .rg-load-status { font-size: 14px; line-height: 1.4; margin: 8px 0 14px; }
.rg-retry { min-height: 44px; border: 2px solid #302451; border-radius: 9px; padding: 10px 16px; margin-bottom: 12px; background: #ffe44e; color: #302451; font: 800 16px system-ui; }
.welcome h1 { font-size: clamp(34px,3.8vw,58px); }

/* Android browser bars and rotation can make 100dvh differ from the visible
   screen. The live VisualViewport dimensions are the gameplay boundary. */
:root { --rg-safe-top: env(safe-area-inset-top,0px); --rg-safe-right: env(safe-area-inset-right,0px); --rg-safe-bottom: env(safe-area-inset-bottom,0px); --rg-safe-left: env(safe-area-inset-left,0px); }
html:has(.in-game), body:has(.in-game) { height: 100%; min-height: 0; overflow: hidden; margin: 0; padding: 0; }
.game-shell.in-game { position: fixed; top: var(--rg-view-top,0px); left: var(--rg-view-left,0px); width: var(--rg-view-width,100vw); height: var(--rg-view-height,100dvh); min-height: 0; margin: 0; padding: 0; overflow: hidden; touch-action: none; }
.in-game .world { position: absolute; inset: 0; width: 100%; height: 100%; }
.in-menu .world { height: var(--rg-view-height,100dvh); }
.in-game .topbar { top: calc(var(--rg-safe-top) + 10px); left: calc(var(--rg-safe-left) + 12px); right: calc(var(--rg-safe-right) + 12px); }
.in-game .touch-controls { position: absolute; top: auto; left: 0; right: 0; bottom: calc(var(--rg-safe-bottom) + 12px); display: flex; align-items: flex-end; padding-left: calc(var(--rg-safe-left) + 14px); padding-right: calc(var(--rg-safe-right) + 14px); z-index: 20; }
.in-game .joystick { flex: 0 0 auto; width: clamp(72px,20vw,96px); height: clamp(72px,20vw,96px); }
.in-game .touch-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; max-width: none; gap: 8px; }
.in-game .touch-actions button, .in-game .touch-actions button:last-child { flex: 0 0 auto; width: clamp(46px,11vw,56px); height: clamp(46px,11vw,56px); margin: 0; font-size: 11px; }
.in-game .touch-actions .touch-jump { width: clamp(58px,15vw,72px); height: clamp(58px,15vw,72px); }
html[data-rg-touch="true"] .in-game .camera-hint { display: none; }
.in-game:has(.touch-controls) .race-track { bottom: calc(var(--rg-safe-bottom) + 155px); width: min(78%,540px); }
.in-game:has(.touch-controls) .auto-run { bottom: calc(var(--rg-safe-bottom) + 115px); right: calc(var(--rg-safe-right) + 14px); }
@media (max-width: 760px) { .in-menu .welcome h1 { font-size: clamp(32px,8.8vw,56px); } }
@media (max-height: 500px) and (orientation: landscape) {
  .in-game .brand > span:nth-child(2) { font-size: 15px; }
  .in-game .top-actions { gap: 7px; }
  .in-game .icon-button { width: 44px; height: 44px; min-width: 44px; }
  .in-game .position-pill { top: calc(var(--rg-safe-top) + 8px); padding: 6px 10px; font-size: 11px; }
  .in-game .round-ribbon { top: calc(var(--rg-safe-top) + 45px); padding: 3px; }
  .in-game .objective { top: calc(var(--rg-safe-top) + 76px); left: calc(var(--rg-safe-left) + 12px); max-width: 40%; gap: 6px; }
  .in-game .objective-icon { width: 25px; height: 25px; }
  .in-game .objective b { font-size: 11px; }
  .in-game .objective div > span { font-size: 9px; }
  .in-game .race-counter { top: calc(var(--rg-safe-top) + 62px); right: calc(var(--rg-safe-right) + 12px); width: 116px; min-width: 0; padding: 0; transform: none; }
  .in-game .race-counter > b { font-size: 25px; }
  .in-game .race-counter > span { font-size: 8px; padding: 3px 5px; }
  .in-game .race-counter > div { font-size: 6px; padding: 3px 4px; }
  .in-game .stage-tip, .in-game .camera-hint { display: none; }
  .in-game:has(.touch-controls) .auto-run { bottom: calc(var(--rg-safe-bottom) + 94px); right: calc(var(--rg-safe-right) + 14px); }
  .in-game .countdown strong { font-size: 95px; }
  .in-game:has(.touch-controls) .race-track { display: none; }
}
@media (max-height: 800px) and (min-width: 761px) {
  .in-menu .welcome { top: 96px; }
  .in-menu .welcome h1 { font-size: 48px; margin-bottom: 16px; }
  .in-menu .welcome .eyebrow { margin-bottom: 10px; }
  .in-menu .knockout-preview { padding: 10px; margin-bottom: 10px; }
  .in-menu .knockout-preview p, .in-menu .competition-picker small { display: none; }
  .in-menu .rg-roster { top: 106px; bottom: 82px; max-height: none; }
  .in-menu .rg-roster > p { margin-top: 8px; margin-bottom: 10px; }
  .in-menu .rg-roster .rg-load-status { margin: 6px 0 8px; }
}
