:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#17212b;background:#eee7d6}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#eee7d6;overscroll-behavior:none}
button,a{-webkit-tap-highlight-color:transparent}
.game-shell{position:relative;width:100%;height:100%;min-height:100dvh;overflow:hidden;background:#f6f0df;touch-action:none;user-select:none}
#game{display:block;width:100%;height:100%;touch-action:none}
.game-topbar{position:absolute;z-index:8;top:max(10px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:11px;font-weight:900;letter-spacing:.08em;color:#28313a;text-shadow:0 1px rgba(255,255,255,.7);pointer-events:none}
.game-topbar .back,.top-actions button{pointer-events:auto}
.game-topbar .back{color:#28313a;text-decoration:none;border:1.5px solid #28313a;border-radius:999px;padding:7px 11px;background:rgba(246,240,223,.82);backdrop-filter:blur(7px)}
.top-actions{display:flex;gap:6px;align-items:center}.top-actions button{border:1.5px solid #26313a;background:rgba(255,253,245,.84);border-radius:999px;padding:7px 10px;font-weight:850;color:#26313a;white-space:nowrap}
#weaponButton{min-width:84px}
.start-card{position:absolute;z-index:10;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-.5deg);width:min(560px,calc(100% - 28px));padding:26px 28px 22px;background:#fffdf5;border:2px solid #1e2933;border-radius:18px;box-shadow:8px 9px 0 rgba(30,41,51,.13);text-align:center}.start-card.hidden{display:none}.start-card:before{content:"";position:absolute;left:22px;right:22px;top:62px;height:1px;background:#b8d4dd;box-shadow:0 32px #b8d4dd,0 64px #b8d4dd;opacity:.4;pointer-events:none}.start-card>*{position:relative}.eyebrow{margin:0 0 8px;color:#09839a;font-size:11px;font-weight:950;letter-spacing:.17em}.start-card h1{margin:0 0 10px;font-size:clamp(34px,7vw,60px);line-height:.95;font-family:"Comic Sans MS","Marker Felt",cursive;letter-spacing:-.05em}.start-card p{margin:10px auto;max-width:470px;line-height:1.5;color:#49535e}.quota-line{display:inline-block;margin:8px 0 5px;padding:8px 13px;border:1.5px dashed #0b8297;border-radius:12px;background:#eefbfc;color:#0b7182;font-weight:900;font-size:13px}.keys{font-size:12px!important;color:#6c737b!important}.card-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:12px}.card-actions button{border:1.8px solid #17212b;border-radius:999px;background:#fffdf5;color:#17212b;padding:10px 14px;font-weight:900;cursor:pointer}.card-actions .primary{background:#13a6bc;color:white;box-shadow:3px 3px 0 #17212b}.card-actions button:disabled{opacity:.45;cursor:not-allowed}.text-button{margin-top:8px;border:0;background:transparent;text-decoration:underline;color:#66717a;font-size:12px;cursor:pointer}
.touch-controls{position:absolute;z-index:7;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));display:flex;justify-content:space-between;pointer-events:none}.touch-group{display:flex;align-items:flex-end;gap:8px;pointer-events:none}.touch-button{pointer-events:auto;width:82px;height:58px;border:2px solid #17212b;border-radius:18px;background:rgba(255,253,245,.8);color:#17212b;font-weight:950;letter-spacing:.04em;box-shadow:3px 4px 0 rgba(23,33,43,.28);backdrop-filter:blur(5px);touch-action:none}.touch-button.move{width:58px;font-size:24px}.touch-button.dive{width:62px;height:48px;background:rgba(255,225,168,.88)}.touch-button.jump{width:92px}.touch-button.fire{background:rgba(19,166,188,.88);color:white}.touch-button:active{transform:translate(2px,2px);box-shadow:1px 2px 0 rgba(23,33,43,.28)}
.director-notice{position:fixed;z-index:100005;left:50%;top:18%;transform:translateX(-50%);width:min(460px,calc(100vw - 32px));padding:13px 20px;border:2px solid #fff;border-radius:14px;background:rgba(23,33,43,.95);color:#fff;text-align:center;box-shadow:0 0 0 5px #17212b,0 12px 35px rgba(23,33,43,.32);animation:directorSlam .22s ease-out;pointer-events:none}.director-notice.hidden{display:none}.director-notice small,.director-notice strong,.director-notice span{display:block}.director-notice small{color:#6ee3ef;font-size:9px;font-weight:950;letter-spacing:.15em}.director-notice strong{margin:4px 0;font-size:23px}.director-notice span{color:#dbe4e8;font-size:11px;font-weight:800}@keyframes directorSlam{from{opacity:0;transform:translateX(-50%) scale(.72) rotate(-2deg)}to{opacity:1;transform:translateX(-50%) scale(1)}}
.toast{position:fixed;z-index:99999;left:50%;top:calc(env(safe-area-inset-top) + 64px);bottom:auto;max-width:calc(100vw - 32px);transform:translate(-50%,-12px);opacity:0;visibility:hidden;transition:.18s ease;padding:11px 15px;border:2px solid rgba(255,255,255,.9);border-radius:14px;background:#17212b;color:white;font-size:13px;font-weight:900;line-height:1.35;text-align:center;pointer-events:none;white-space:normal;box-shadow:0 8px 28px rgba(23,33,43,.35)}.toast.show{opacity:1;visibility:visible;transform:translate(-50%,0)}.rotate-hint{display:none;position:absolute;z-index:9;left:50%;bottom:92px;transform:translateX(-50%);padding:7px 11px;border-radius:999px;background:rgba(23,33,43,.78);color:white;font-size:11px;white-space:nowrap}
.modal{position:absolute;z-index:20;inset:0;display:grid;place-items:center;padding:18px;background:rgba(21,29,36,.3);backdrop-filter:blur(6px)}.modal.hidden{display:none}.modal-card{position:relative;width:min(620px,100%);max-height:min(78vh,720px);overflow:auto;background:#fffdf5;border:2px solid #17212b;border-radius:18px;box-shadow:8px 8px 0 rgba(23,33,43,.22);padding:24px}.modal-card h2{margin:0 34px 18px 0}.modal-card h3{margin:18px 0 8px}.modal-close{position:absolute;right:12px;top:10px;border:0;background:transparent;font-size:28px;cursor:pointer}.mini-button{border:1.5px solid #17212b;border-radius:999px;padding:7px 11px;background:white;font-weight:850}.rank-list{display:grid;gap:7px}.rank-row{display:grid;grid-template-columns:30px 1fr auto;gap:8px;align-items:center;padding:9px 10px;border-bottom:1px dashed #c4d8de}.rank-row b{font-variant-numeric:tabular-nums}.team-box{padding:12px;border:1.5px dashed #0b8297;border-radius:14px;background:#effbfc}.team-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.share-score{padding:14px;border:1.5px solid #17212b;border-radius:14px;background:#f5fbfb;text-align:left}.share-score strong{font-size:22px}.muted{color:#6a737c;font-size:12px}
#copyInvite{position:relative;transition:.15s ease}#copyInvite:focus,#copyInvite:active{outline:none;background:#0b8297;color:#fff;border-color:#0b8297} .team-box:has(#copyInvite:focus)::after{content:"✓ 邀请链接已复制，可以直接发给朋友";display:block;margin-top:12px;padding:9px 11px;border:1.5px solid #0b8297;border-radius:10px;background:#e7fafc;color:#08687a;font-size:12px;font-weight:900;text-align:center}
.result-card-v2{display:grid;grid-template-columns:62px 1fr;gap:12px;align-items:center;margin:12px 0;background:linear-gradient(135deg,#fff8dc,#eafafd);box-shadow:3px 4px 0 rgba(23,33,43,.13)}.result-card-v2 .team-actions{grid-column:1/-1;margin-top:2px}.result-card-v2 .mini-button:first-child{background:#17212b;color:#fff}.result-copy{display:grid;gap:2px;min-width:0}.result-copy small{color:#087b8d;font-size:8px;font-weight:950;letter-spacing:.14em}.result-copy strong{font-size:20px!important;line-height:1.05}.result-avatar{position:relative;width:54px;height:72px;filter:drop-shadow(2px 3px 0 rgba(23,33,43,.16))}.result-avatar i,.result-avatar b,.result-avatar span{position:absolute;display:block;border:2px solid #17212b}.result-avatar i{left:13px;top:0;width:28px;height:25px;border-radius:4px;background:#fff8dc}.result-avatar i:before,.result-avatar i:after{content:"";position:absolute;top:8px;width:3px;height:3px;border-radius:50%;background:#17212b}.result-avatar i:before{left:6px}.result-avatar i:after{right:6px}.result-avatar b{left:12px;top:28px;width:30px;height:31px;border-radius:4px;background:#dff5fa}.result-avatar span{left:6px;top:60px;width:16px;height:11px;border-radius:3px;background:#fff}.result-avatar span:after{content:"";position:absolute;left:24px;top:-2px;width:12px;height:7px;border:2px solid #17212b;border-radius:3px;background:#fff}
.dice-spotlight.show:before,.dice-spotlight.show:after,.dice-spotlight.rare-roll:before,.dice-spotlight.rare-roll:after{content:"✦";position:absolute;left:50%;top:50%;font-size:34px;font-weight:950;color:#e8a13a;animation:rareBurst .72s ease-out forwards}.dice-spotlight.show:after,.dice-spotlight.rare-roll:after{content:"✦  ✦";color:#16a7bf;animation-delay:.08s}.dice-spotlight.show .dice-spotlight-card,.dice-spotlight.rare-roll .dice-spotlight-card{animation:rareCard .42s cubic-bezier(.2,.9,.2,1.2);box-shadow:10px 12px 0 rgba(23,33,43,.24),0 0 0 6px rgba(255,212,143,.26)}@keyframes rareBurst{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}35%{opacity:1}100%{transform:translate(-50%,-50%) scale(4) rotate(28deg);opacity:0}}@keyframes rareCard{0%{transform:scale(.78) rotate(-4deg)}65%{transform:scale(1.08) rotate(2deg)}100%{transform:scale(1)}}
@media(pointer:fine){.touch-controls{opacity:.2}.touch-button{height:44px}.touch-button.move{width:46px}.touch-button.dive{width:52px;height:40px}.touch-button.jump{width:74px}.touch-button.fire{width:66px}.rotate-hint{display:none!important}}
@media(orientation:portrait) and (max-width:700px){.rotate-hint{display:block}.game-topbar>span{display:none}.top-actions{gap:4px}.top-actions button{padding:6px 8px;font-size:10px}.start-card{padding:22px 18px}.start-card h1{font-size:42px}.card-actions button{padding:9px 11px}.modal-card{padding:20px 16px}.toast{top:calc(env(safe-area-inset-top) + 56px);font-size:12px}.result-card-v2{grid-template-columns:50px 1fr}.result-avatar{transform:scale(.88);transform-origin:left center}.result-copy strong{font-size:17px!important}}
@media(max-height:540px){.start-card{padding:16px 20px}.start-card p{margin:5px auto}.start-card .keys{display:none}.start-card h1{font-size:36px}.quota-line{margin:4px}.touch-controls{bottom:8px}.touch-button{height:44px}.touch-button.dive{height:38px}.card-actions{margin-top:7px}.game-topbar>span{display:none}.toast{top:calc(env(safe-area-inset-top) + 48px)}.director-notice{top:14%;padding:8px 16px}.director-notice strong{font-size:18px}.result-card-v2{margin:5px 0;padding:8px}.result-copy strong{font-size:16px!important}.result-avatar{display:none}}
