/* SUICAT identity and responsive play surface. */
html,body{overscroll-behavior:none}
button{touch-action:manipulation}
.brand-mark{width:44px;height:44px;flex-shrink:0;object-fit:cover;border-radius:50%;border:2px solid #b1d6c777}
.wordmark{gap:13px;letter-spacing:-1px}
.wordmark b{font-size:28px;font-weight:900}
.wordmark>span{margin-left:5px;letter-spacing:2px;line-height:1.5}
.menu .eyebrow:before{display:none}
.menu-logo{width:49px;height:49px;object-fit:cover;border:2px solid #a8cfbd77;border-radius:50%}
h1{font-size:clamp(70px,7.9vw,112px);letter-spacing:-.048em}
h1 .sub-title{font-size:clamp(17px,1.85vw,29px);letter-spacing:.18em;margin-left:3px}
.level-selector{width:min(375px,100%)}
.level-pill{min-width:0;flex:1}
.menu-actions{flex-wrap:wrap;column-gap:18px;row-gap:6px}
.panel{max-height:100%;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.modal-wrap{padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));z-index:6}
.screen{z-index:5}
.screen:empty{display:none}
.touch-controls{padding:0 max(20px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));-webkit-touch-callout:none;user-select:none;-webkit-user-select:none}
.touch-controls button{transition:background .08s,transform .08s;-webkit-touch-callout:none}
.touch-controls button.held{background:#d4efdb88;transform:scale(.94);color:#04272e}
.touch-controls .jump{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;line-height:1}
.jump small{font-size:10px;letter-spacing:1.1px;font-weight:800}
.shell-fullscreen{position:absolute;top:20px;right:65px;z-index:7;width:36px;height:36px;display:none;place-items:center;border-radius:50%;background:#082d38d9;border:1px solid #b1d0ba55;font-size:22px;color:#ecf1dd}
.game-shell.expanded .shell-fullscreen{display:grid;right:max(64px,calc(env(safe-area-inset-right) + 54px))}
.game-shell:fullscreen,.game-shell.fullscreen-fallback{height:var(--viewport-height,100dvh);max-height:none;aspect-ratio:auto}
.game-shell.expanded .hud{top:max(16px,env(safe-area-inset-top));left:max(18px,env(safe-area-inset-left));right:max(113px,calc(env(safe-area-inset-right) + 108px))}
.game-shell.expanded .pause-button{top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right))}
.game-shell.expanded .shell-fullscreen{top:max(12px,env(safe-area-inset-top))}
.game-shell.expanded .world-caption{right:max(130px,calc(env(safe-area-inset-right) + 120px))}
.game-shell.expanded .menu{padding-top:max(5%,env(safe-area-inset-top));padding-bottom:max(5%,env(safe-area-inset-bottom))}
.boss-hud{position:absolute;z-index:2;top:77px;left:50%;transform:translateX(-50%);width:min(280px,46%);padding:8px 12px;background:#062532dd;border:1px solid #a5bfc32a;border-radius:5px;text-align:center;pointer-events:none;font-size:11px;letter-spacing:1.3px;color:#e6ecd9}
.boss-hud[hidden]{display:none}
#boss-meter{height:4px;margin-top:6px;background:#496062;border-radius:3px;overflow:hidden}
#boss-fill{display:block;height:100%;width:100%;background:#d5e7cd;transition:width .2s}
.hud-title{max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.toast{z-index:4}
@media(hover:none),(pointer:coarse){
  .shell-fullscreen{display:grid;top:14px;right:64px;width:42px;height:42px}
  .pause-button{top:14px;right:14px;width:42px;height:42px;font-size:18px}
  .touch-controls button{width:62px;height:62px;font-size:22px}
  .touch-controls .jump{width:74px;height:74px;background:#e9b171dd}
  .touch-controls .movement{gap:13px}
  .icon-button{width:42px;height:42px}
  .hud{right:115px}
  .world-caption{right:120px}
  .game-shell{touch-action:auto}
  .modal-wrap,.panel{touch-action:pan-y}
  .footer>span:first-child:after{content:'HOLD TO MOVE · TAP TWICE TO DOUBLE JUMP'}
}
@media(max-width:600px) and (orientation:portrait){
  .app{padding:0 10px;min-height:var(--viewport-height,100dvh)}
  .topbar{height:70px;gap:10px}
  .brand-mark{width:37px;height:37px}
  .wordmark{gap:8px;align-items:center;flex-wrap:nowrap;min-width:0}
  .wordmark b{font-size:23px;letter-spacing:-.7px}
  .wordmark>span{font-size:8px;letter-spacing:1.3px;max-width:66px;border-left:0;padding-left:0;margin-left:1px}
  .header-end{gap:5px}
  .icon-button{width:38px;height:38px;font-size:20px}
  .game-shell{height:calc(var(--viewport-height,100dvh) - 126px);min-height:360px;max-height:none;aspect-ratio:auto}
  .menu{padding:24px;justify-content:center;background:linear-gradient(90deg,#071e29e8,#071e29ad 57%,#071e2944)}
  .menu .eyebrow{font-size:9px;letter-spacing:1.8px;gap:11px;max-width:100%;line-height:1.5}
  .menu-logo{width:40px;height:40px}
  h1{font-size:clamp(49px,15vw,82px);line-height:.95;letter-spacing:-.04em}
  h1 .sub-title{font-size:clamp(15px,4.7vw,23px);margin-top:13px;letter-spacing:.17em}
  .intro{font-size:14px;margin:21px 0;max-width:245px}
  .primary{font-size:12px;min-height:48px;padding:13px 20px}
  .secondary{font-size:12px;min-height:36px}
  .level-selector{margin-top:22px;gap:5px}
  .level-pill{padding:8px 6px;min-height:50px;font-size:10px;gap:5px}
  .level-pill .number{font-size:15px}
  .world-caption{display:none}
  .menu-bottom{font-size:8px;bottom:17px;left:24px;right:24px;letter-spacing:1.5px}
  .footer{height:56px;gap:7px}
  .footer>span:first-child:after{font-size:8px;letter-spacing:.5px;max-width:200px;line-height:1.7}
  .footer button{white-space:nowrap}
  .hud{left:13px;right:112px;top:16px;align-items:flex-start;gap:8px}
  .hud-title{font-size:11px;max-width:125px}
  .hud-label{font-size:8px;letter-spacing:.7px}
  .hud-group{gap:3px}
  .health{gap:2px}
  .health span{font-size:16px}
  .pearls{font-size:12px}
  .boss-hud{top:79px;width:60%;font-size:10px}
  .toast{bottom:23%;font-size:12px}
  .app.is-playing .topbar{height:56px}
  .app.is-playing .footer{display:none}
  .app.is-playing .game-shell{height:calc(var(--viewport-height,100dvh) - 56px - env(safe-area-inset-bottom));min-height:0}
  .touch-controls{padding-left:max(15px,env(safe-area-inset-left));padding-right:max(15px,env(safe-area-inset-right));padding-bottom:max(23px,env(safe-area-inset-bottom))}
  .touch-controls button{width:58px;height:58px}
  .touch-controls .jump{width:70px;height:70px}
  .game-shell.expanded .hud{left:max(13px,env(safe-area-inset-left));right:max(114px,calc(env(safe-area-inset-right) + 108px))}
  .game-shell.expanded .boss-hud{top:max(82px,calc(env(safe-area-inset-top) + 57px))}
}
@media(max-width:359px) and (orientation:portrait){
  .wordmark>span{display:none}
  .menu{padding:19px}
  .menu-logo{width:33px;height:33px}
  .menu .eyebrow{font-size:8px;letter-spacing:1.2px}
  .menu-actions{column-gap:8px}
  .primary{padding:12px 17px;gap:22px}
  .level-pill{font-size:9px}
  .hud-title{max-width:95px;font-size:10px}
  .hud-label{font-size:7px;letter-spacing:0}
  .health span{font-size:14px}
  .touch-controls .movement{gap:8px}
  .touch-controls button{width:54px;height:54px}
  .touch-controls .jump{width:66px;height:66px}
}
@media(max-height:550px) and (orientation:landscape){
  .app{padding:0 8px;min-height:var(--viewport-height,100dvh)}
  .brand-mark{width:30px;height:30px}
  .wordmark b{font-size:22px}
  .topbar{height:44px}
  .game-shell{height:calc(var(--viewport-height,100dvh) - 74px);min-height:0;max-height:none;width:min(100%,calc((var(--viewport-height,100dvh) - 74px)*1.95));aspect-ratio:auto}
  .menu{padding:14px 5.8%}
  .menu-logo{display:none}
  .eyebrow{font-size:8px;line-height:1.2;margin-bottom:10px}
  h1{font-size:clamp(46px,7.7vw,72px)}
  h1 .sub-title{font-size:16px;margin-top:9px}
  .intro{display:none}
  .menu-actions{margin-top:18px}
  .level-selector{margin-top:13px;width:330px}
  .level-pill{padding:6px 8px;font-size:9px;min-height:34px}
  .world-caption{right:118px;top:15px;font-size:8px}
  .world-caption b{font-size:17px}
  .menu-bottom{bottom:8px;font-size:8px}
  .panel{padding:18px 23px;max-height:100%}
  .panel .help-lines{line-height:1.4}
  .panel .help-lines p{font-size:12px;margin:6px 0}
  .panel h2{font-size:27px}
  .touch-controls{padding-left:max(18px,env(safe-area-inset-left));padding-right:max(18px,env(safe-area-inset-right));padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .touch-controls button{width:54px;height:54px}
  .touch-controls .jump{width:62px;height:62px}
  .shell-fullscreen,.pause-button{top:max(9px,env(safe-area-inset-top));width:40px;height:40px}
  .pause-button{right:max(12px,env(safe-area-inset-right))}
  .shell-fullscreen{right:max(59px,calc(env(safe-area-inset-right) + 48px))}
  .hud{top:max(12px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));right:max(112px,calc(env(safe-area-inset-right) + 110px))}
  .boss-hud{top:max(57px,calc(env(safe-area-inset-top) + 48px));font-size:9px;padding:6px 10px;width:230px}
  .toast{bottom:27%;font-size:11px}
  .app.is-playing{padding:0;justify-content:flex-start}
  .app.is-playing .topbar,.app.is-playing .footer{display:none}
  .app.is-playing .game-shell{width:100%;height:var(--viewport-height,100dvh);border:0;border-radius:0;max-height:none}
}
@media(prefers-reduced-motion:reduce){.touch-controls button,.primary,#boss-fill{transition:none}}
.app .game-shell.expanded{width:100vw;height:var(--viewport-height,100dvh);min-height:0;max-height:none}
/* Draw the controls instead of using Unicode arrows, which iOS renders as blue emoji tiles. */
.touch-controls .movement button{position:relative;display:grid;place-items:center;overflow:hidden;background:linear-gradient(145deg,rgba(13,63,72,.92),rgba(3,30,40,.9));border:1px solid rgba(204,238,220,.58);box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 8px 20px rgba(1,16,24,.38);color:#f1f2d8}
.touch-controls .movement button:before{content:'';position:absolute;inset:5px;border:1px solid rgba(182,229,208,.13);border-radius:50%;pointer-events:none}
.move-icon{position:relative;z-index:1;display:block;width:18px;height:18px;border-top:4px solid currentColor;border-right:4px solid currentColor;border-radius:2px;filter:drop-shadow(0 2px 2px rgba(0,15,22,.55))}
.move-left{transform:rotate(-135deg);margin-left:5px}
.move-right{transform:rotate(45deg);margin-right:5px}
.touch-controls .jump{position:relative;overflow:hidden;background:linear-gradient(145deg,#f0bf7e,#d99455);border:1px solid #ffe0b5;box-shadow:inset 0 1px 0 rgba(255,255,255,.38),0 8px 20px rgba(1,16,24,.34);color:#082b32}
.touch-controls .jump:before{content:'';position:absolute;inset:5px;border:1px solid rgba(88,48,24,.13);border-radius:50%;pointer-events:none}
.jump-icon{position:relative;z-index:1;display:block;width:24px;height:25px;color:inherit}
.jump-icon:before{content:'';position:absolute;left:10px;bottom:1px;width:4px;height:17px;border-radius:3px;background:currentColor}
.jump-icon:after{content:'';position:absolute;left:5px;top:0;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:10px solid currentColor}
.jump small{position:relative;z-index:1}
.touch-controls .movement button.held{background:linear-gradient(145deg,#f1c486,#d89555);border-color:#ffe0b5;color:#082b32;transform:scale(.94)}
.touch-controls .jump.held{background:linear-gradient(145deg,#194e57,#0a333e);border-color:#bae0cf;color:#f1f2d8;transform:scale(.94)}
/* Player registration and the Top 100 share the dive's compact phone layout. */
.social-actions{display:flex;align-items:center;gap:12px;margin:12px 0 17px;flex-wrap:wrap}
.social-actions .secondary{margin:0;padding:9px 14px;min-height:42px}
.player-chip{border:1px solid #d4eac13b;border-radius:20px;background:#082e38d9;color:#d7edd0;font:600 11px Arial;letter-spacing:.05em;padding:12px 16px;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu .level-pill{cursor:default;pointer-events:none}
.panel .subtle,.subtle{color:#a4bdb0;font-size:12px;line-height:1.6}
.player-form{display:grid;gap:10px;margin:18px 0 8px;text-align:left}
.player-form[hidden]{display:none}
.player-form label,.panel>label{font-size:12px;letter-spacing:.06em;color:#c8ddc3}
.player-form input,.private-code{width:100%;box-sizing:border-box;border:1px solid #94b8a969;background:#092832;color:#eef6df;border-radius:8px;padding:14px;font:16px Arial;outline:none;min-width:0}
.player-form input:focus,.private-code:focus{border-color:#d3edc4;box-shadow:0 0 0 3px #c3e5b91a}
.private-code{margin:10px 0;resize:none;text-align:center;letter-spacing:.08em;line-height:1.6;overflow-wrap:anywhere;font-family:monospace}
.form-status{font-size:13px!important;line-height:1.5;min-height:1.5em;color:#efcd9c!important}
.panel button:disabled{opacity:.48;cursor:wait}
.panel [hidden]{display:none!important}
.stats small{font:14px Arial;color:#99b6a8}
.stats strong{font-size:clamp(20px,4.5vw,30px)}
.run-clock{font:12px monospace;font-variant-numeric:tabular-nums;color:#e5eacb;min-width:34px}
.leaderboard-panel{width:min(660px,100%);max-width:660px!important;text-align:left}
.leaderboard-panel h2{margin-bottom:12px}
.ranking-rule{font-size:13px!important;line-height:1.7}
.preview-note{padding:10px 12px;border:1px solid #f0bd713d;background:#e2ae6810;border-radius:7px;font-size:12px!important;color:#e6c28b!important}
.own-rank{display:flex;justify-content:space-between;gap:10px;align-items:center;background:#b9e3b918;border:1px solid #b9e3b947;border-radius:8px;padding:14px;margin:16px 0;font-size:12px;flex-wrap:wrap}
.own-rank span{letter-spacing:.08em;color:#c6e6be}
.own-rank b{font:600 13px monospace;white-space:nowrap}
.board-scroll{max-height:min(43vh,360px);overflow:auto;overscroll-behavior:contain;border:1px solid #a8bfa52d;border-radius:9px;touch-action:pan-y}
.leaderboard-table{border-collapse:collapse;width:100%;font:13px Arial;table-layout:fixed}
.leaderboard-table thead{position:sticky;top:0;background:#183c40;z-index:1}
.leaderboard-table th,.leaderboard-table td{padding:13px 10px;border-bottom:1px solid #a8bfa51a;text-align:left;overflow-wrap:anywhere}
.leaderboard-table thead th{font-size:9px;letter-spacing:.09em;color:#b4cbb6}
.leaderboard-table th:first-child,.leaderboard-table td:first-child{width:34px;color:#aac4ae;text-align:center}
.leaderboard-table th:nth-child(3),.leaderboard-table td:nth-child(3){width:58px;text-align:center}
.leaderboard-table th:last-child,.leaderboard-table td:last-child{width:90px;text-align:right;font-family:monospace;white-space:nowrap}
.leaderboard-table tbody th{font-weight:500}
.leaderboard-table .is-you{background:#c8e3a815;color:#e4f4c4}
.leaderboard-table small{font-size:8px;color:#c6e6be}
.board-empty{text-align:center;padding:25px 12px;background:#82c3b008;border:1px dashed #bdd2b930;border-radius:9px;margin:16px 0}
.board-empty>span{font-size:36px;color:#d2edc4}
.board-empty h3{font:20px Georgia;color:#e8edcf;margin:12px 0}
.board-empty p{font-size:13px}
.board-actions{display:flex;gap:14px;align-items:center;justify-content:space-between;margin-top:20px}
.board-actions .primary{width:auto;margin:0;padding:13px 17px;font-size:11px}
.board-actions .secondary{width:auto;margin:0;font-size:11px}
@media(max-width:600px){.social-actions{gap:8px;margin:10px 0}.player-chip{max-width:170px;padding:11px}.panel{padding:24px 18px}.leaderboard-table th,.leaderboard-table td{padding:12px 7px}.leaderboard-table th:first-child,.leaderboard-table td:first-child{width:25px}.leaderboard-table th:last-child,.leaderboard-table td:last-child{width:76px;font-size:11px}.leaderboard-table th:nth-child(3),.leaderboard-table td:nth-child(3){width:44px}.hud-group{gap:8px}.run-clock{font-size:10px}.health{gap:3px}.menu-bottom .coordinates{display:none}}
@media(max-height:500px) and (orientation:landscape){.social-actions{position:absolute;right:20px;top:14px;margin:0}.menu .level-selector{margin-top:12px}.menu-bottom{margin-top:12px}.leaderboard-panel{width:min(650px,100%)}.board-scroll{max-height:190px}}

.menu>.intro{margin-top:17px;margin-bottom:17px}
.menu>.level-selector{margin-top:8px}
.menu>.social-actions{margin:10px 0 6px}

/* Consistent menu arrows without platform emoji rendering. */
.ui-arrow{display:inline-block;position:relative;width:18px;height:18px;flex:0 0 18px;vertical-align:-3px;color:inherit;pointer-events:none}
.ui-arrow:before{content:'';position:absolute;left:2px;top:8px;width:16px;height:2px;border-radius:2px;background:currentColor;transform:rotate(-45deg)}
.ui-arrow:after{content:'';position:absolute;right:1px;top:1px;width:10px;height:10px;border-top:2px solid currentColor;border-right:2px solid currentColor;border-radius:1px}
