/* Original V1 materials and layout, scoped to the optional handheld view. */
.sg-shell, .sg-shell * { box-sizing: border-box; }
.sg-launch { font: bold 12px var(--font-brand, 'Papyrus', Georgia, serif); min-height: 44px; padding: 7px 10px; border: 1px solid #e4d2aa; border-radius: 6px; background: #263c30; color: #fff1d6; cursor: pointer; }
.sg-shell { width: min(100%, 580px); margin: 8px auto; padding: 12px; display: grid; gap: 8px; color: #21392e; background: linear-gradient(135deg, #eee1c7, #b9ad95); border: 4px solid #f2e6ce; border-radius: 22px 22px 55px 22px; box-shadow: 0 12px 40px #0008; font: 14px var(--font-brand, 'Papyrus', Georgia, serif); }
.sg-shell[hidden], .sg-shell [hidden], .sg-launch[hidden] { display: none !important; }
.sg-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sg-header strong { font: bold 14px var(--font-brand, 'Papyrus', Georgia, serif); color: #21392e; letter-spacing: .3px; }
.sg-header strong small { font-size: 11px; }
.sg-tools { display: flex; flex-wrap: wrap; gap: 5px; }
.sg-tools button, .sg-meta button, .sg-dialog button { min-height: 44px; border: 0; border-radius: 6px; padding: 8px 10px; background: #263c30; color: #fff; font: bold 12px var(--font-brand, 'Papyrus', Georgia, serif); cursor: pointer; }
.sg-shell button:focus-visible, .sg-launch:focus-visible { outline: 3px solid #d47b15; outline-offset: 3px; }
.sg-bezel { min-width: 0; background: #233d35; padding: 7px; border-radius: 12px 12px 26px 12px; overflow: hidden; }
.sg-caption { display: flex; justify-content: space-between; gap: 10px; color: #263c30; font: 11px var(--font-brand, 'Papyrus', Georgia, serif); }
.sg-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sg-dpad { width: 144px; height: 144px; flex-shrink: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.sg-dpad button, .sg-dpad span { background: #252d29; color: white; border: 1px solid #101b15; border-radius: 3px; padding: 0; min-width: 0; font: 900 18px var(--font-brand, 'Papyrus', Georgia, serif); }
.sg-dpad [data-sg-key=up] { grid-area: 1 / 2; }
.sg-dpad [data-sg-key=left] { grid-area: 2 / 1; }
.sg-dpad [data-sg-key=right] { grid-area: 2 / 3; }
.sg-dpad [data-sg-key=down] { grid-area: 3 / 2; }
.sg-dpad span { grid-area: 2 / 2; border: 0; border-radius: 0; }
.sg-ab { display: flex; gap: 9px; align-items: center; padding-right: 3px; }
.sg-ab button { width: 66px; height: 66px; padding: 4px; background: #76334b; color: white; border: 4px solid #a05a70; border-radius: 50%; font: 900 20px var(--font-brand, 'Papyrus', Georgia, serif); }
.sg-ab button:first-child { margin-top: 18px; }
.sg-ab small { display: block; font: bold 10px/1.2 var(--font-brand, 'Papyrus', Georgia, serif); margin-top: 2px; }
.sg-shell button[data-sg-key] { touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.sg-shell button.sg-held { filter: brightness(1.4); box-shadow: inset 0 3px 10px #0008; }
.sg-shell button:disabled { opacity: .5; cursor: default; }
.sg-meta { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.sg-meta button { border-radius: 18px; background: #535c52; min-width: 83px; }
.sg-meta small { display: block; font-size: 10px; font-weight: normal; margin-top: 3px; }
.sg-hint, .sg-notice { font: 12px/1.45 var(--font-brand, 'Papyrus', Georgia, serif); margin: 0; text-align: center; color: #21392e; }
.sg-notice:empty { display: none; }
.sg-dialog { max-width: min(430px, calc(100vw - 30px)); color: #21392e; background: #f1e6cf; border: 3px solid #263c30; border-radius: 14px; padding: 22px; }
.sg-dialog::backdrop { background: #05150ecc; }
.sg-dialog h2 { font: bold 24px/1.2 var(--font-brand, 'Papyrus', Georgia, serif); color: #21392e; margin: 0 0 16px; }
.sg-dialog p { font: 15px/1.5 var(--font-brand, 'Papyrus', Georgia, serif); color: #21392e; }
.sg-dialog>div { display: flex; flex-wrap: wrap; gap: 10px; }
.sg-minimized>*:not(.sg-header):not(dialog) { display: none; }
.sg-shell:fullscreen, .sg-expanded { width: 100%; max-width: none; height: 100dvh; overflow: auto; margin: 0; border-radius: 0; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.sg-expanded { position: fixed; inset: 0; z-index: 100; }
.sg-view, .sg-view body { height: auto !important; min-height: 100%; overflow: auto !important; }
.sg-view .arcade-layout { display: block; }
.sg-view .mission-sidebar { display: none; }
.sg-shell .game-shell { width: 100%; max-width: none; margin: 0; box-shadow: none; border: 0; border-radius: 0; }
.sg-shell .touch-controls, .sg-shell .cabinet-bottom, .sg-shell .bottom-bar, .sg-shell #controls, .sg-shell .sg-launch { display: none !important; }
.sg-shell[data-game-station=ladder] .game-shell { height: auto; display: block; }
.sg-shell[data-game-station=ladder] .screen { height: clamp(240px, 42svh, 540px); aspect-ratio: auto; flex: none; }
.sg-shell[data-game-station=ladder] .screen canvas { object-fit: contain; }
.sg-shell[data-game-station=shelf] .game-shell { height: clamp(320px, 52svh, 620px); }
.sg-shell .topbar { padding: 6px 9px; min-height: 48px; }
.sg-shell .topbar .brand strong { font-size: 15px; }
.sg-shell .topbar .brand small { font-size: 8px; }
.sg-shell .toolbar { gap: 3px; flex-wrap: wrap; }
.sg-shell .overlay { padding: 8px; }
.sg-shell .panel { max-height: 100%; overflow: auto; }
.sg-shell[data-game-station=grand] .game { height: clamp(330px, 53svh, 620px); min-height: 0; max-height: none; color: var(--cream, #f3e9cb); }
.sg-shell[data-game-station=grand] .title-screen { padding: 20px; overflow: auto; align-items: start; }
.sg-shell[data-game-station=grand] .title-copy { width: 100%; max-width: 100%; }
.sg-shell[data-game-station=grand] .title-copy h1 { font-size: 48px; line-height: .95; letter-spacing: -2px; margin: 12px 0; }
.sg-shell[data-game-station=grand] .title-copy h1 small { font-size: 14px; letter-spacing: 4px; }
.sg-shell[data-game-station=grand] .tagline { font-size: 14px; margin: 12px 0; }
.sg-shell[data-game-station=grand] .route-ticket, .sg-shell[data-game-station=grand] .title-stats { display: none; }
.sg-shell[data-game-station=grand] .title-copy .primary-button { min-height: 44px; padding: 10px 14px; }
.sg-shell[data-game-station=grand] .hud { padding: 10px; }
.sg-shell[data-game-station=grand] .level-block strong { font-size: 16px; }
.sg-shell[data-game-station=grand] .hud-strip { gap: 10px; margin-top: 8px; }
.sg-shell[data-game-station=grand] .boss-hud { top: 108px; }
.sg-shell[data-game-station=pocket] { max-width: 450px; }
.sg-shell[data-game-station=pocket] canvas { display: block; width: 100%; height: min(49svh, 520px); object-fit: contain; image-rendering: pixelated; background: #102b20; }
@media (max-width: 600px) {
  .masthead:has(>.sg-launch) { height: auto; min-height: 66px; gap: 8px; flex-wrap: wrap; padding-block: 8px; }
  .toolbar:has(>.sg-launch) { flex-wrap: wrap; justify-content: flex-end; }
  .sg-shell { padding: 8px; border-width: 3px; }
  .sg-tools { gap: 4px; }
  .sg-tools button { padding-inline: 8px; font-size: 11px; }
  .sg-dpad { width: 132px; height: 132px; }
  .sg-ab button { width: 58px; height: 58px; border-width: 3px; }
  .sg-ab { gap: 7px; }
  .sg-caption { font-size: 10px; }
  .sg-shell[data-game-station=shelf] .hud { gap: 12px; padding: 7px 10px; }
}
@media (max-width: 350px) { .sg-shell { padding: 6px; } .sg-bezel { padding: 4px; } .sg-controls { gap: 4px; } .sg-ab { gap: 5px; padding: 0; } .sg-ab button { width: 54px; height: 54px; } }
@media (max-height: 730px) and (max-width: 649px) {
  .sg-shell:fullscreen .game, .sg-expanded .game,
  .sg-shell:fullscreen .game-shell, .sg-expanded .game-shell,
  .sg-shell:fullscreen[data-game-station=pocket] canvas, .sg-expanded[data-game-station=pocket] canvas { height: max(220px, calc(100dvh - 375px)) !important; min-height: 0; }
  .sg-shell:fullscreen[data-game-station=ladder] .game-shell, .sg-expanded[data-game-station=ladder] .game-shell { display: flex; flex-direction: column; }
  .sg-shell:fullscreen[data-game-station=ladder] .screen, .sg-expanded[data-game-station=ladder] .screen { height: auto; flex: 1; min-height: 0; }
}
@media (max-height: 550px) and (min-width: 650px) {
  .sg-shell:fullscreen, .sg-expanded { grid-template-columns: 150px minmax(0, 1fr) 150px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 5px 10px; }
  .sg-shell:fullscreen .sg-header, .sg-expanded .sg-header { grid-column: 1 / -1; }
  .sg-shell:fullscreen .sg-bezel, .sg-expanded .sg-bezel { grid-column: 2; grid-row: 2; min-height: 0; }
  .sg-shell:fullscreen .sg-controls, .sg-expanded .sg-controls { display: contents; }
  .sg-shell:fullscreen .sg-dpad, .sg-expanded .sg-dpad { grid-column: 1; grid-row: 2; align-self: center; }
  .sg-shell:fullscreen .sg-ab, .sg-expanded .sg-ab { grid-column: 3; grid-row: 2; align-self: center; }
  .sg-shell:fullscreen .sg-meta, .sg-expanded .sg-meta { grid-column: 1 / -1; }
  .sg-shell:fullscreen .sg-caption, .sg-expanded .sg-caption, .sg-shell:fullscreen .sg-hint, .sg-expanded .sg-hint { display: none; }
  .sg-shell:fullscreen .game, .sg-expanded .game, .sg-shell:fullscreen .game-shell, .sg-expanded .game-shell { height: 100% !important; min-height: 0; }
  .sg-shell:fullscreen[data-game-station=ladder] .game-shell, .sg-expanded[data-game-station=ladder] .game-shell { display: flex; flex-direction: column; }
  .sg-shell:fullscreen[data-game-station=ladder] .screen, .sg-expanded[data-game-station=ladder] .screen { height: auto; flex: 1; min-height: 0; }
  .sg-shell:fullscreen[data-game-station=pocket] canvas, .sg-expanded[data-game-station=pocket] canvas { height: 100%; }
}

/* The river's overhead camera keeps all five jetties in the handheld screen. */
.sg-shell[data-game-station=hopper] .game{height:clamp(380px,55svh,620px);min-height:0;max-height:none;color:#e3dcc1}
.sg-shell[data-game-station=hopper] .title-screen{overflow:auto;align-items:flex-start}
.sg-shell[data-game-station=hopper] .title-copy{margin:22px 7%}
.sg-shell[data-game-station=hopper] h1{font-size:clamp(30px,5vw,56px);margin:10px 0}
.sg-shell[data-game-station=hopper] .title-hint,.sg-shell[data-game-station=hopper] .route-ticket,.sg-shell[data-game-station=hopper] .title-best{display:none}
.sg-shell[data-game-station=hopper] .tagline{font-size:14px;margin:12px 0}
.sg-shell[data-game-station=hopper] .title-links{gap:10px}
.sg-shell[data-game-station=hopper] .hud{top:8px;left:8px;right:8px}
.sg-shell[data-game-station=hopper] .hud-top{gap:5px}
.sg-shell[data-game-station=hopper] .hud-score{min-width:55px;padding:6px}
.sg-shell[data-game-station=hopper] .hud-score strong{font-size:22px}
.sg-shell[data-game-station=hopper] .hud-details{gap:8px;padding:8px 5px}
.sg-shell[data-game-station=hopper] .hud-details b{font-size:14px}
.sg-shell[data-game-station=hopper] .hud-actions button{width:30px;height:35px;font-size:17px}
.sg-shell[data-game-station=hopper] .landing-guide{bottom:7px;padding:5px;font-size:9px;max-width:75%}
.sg-shell[data-game-station=hopper] .landing-guide small{font-size:7px}
.sg-shell[data-game-station=hopper] .leap-status{bottom:52px;right:8px;font-size:8px;padding:4px}
.sg-shell[data-game-station=hopper] .run-toast{bottom:80px}
.mirror-embedded.sg-view .app{height:auto;min-height:100svh}
.mirror-embedded.sg-view .app>main{height:auto}
