:root{color-scheme:dark;--ink:#163b41;--cream:#f5f1e8;--mint:#8ac7b2;--orange:#ff9a54;--safe-b:env(safe-area-inset-bottom,0px);--safe-t:env(safe-area-inset-top,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#132e36;font-family:system-ui,-apple-system,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;touch-action:none;overscroll-behavior:none}button,input{font:inherit}button{cursor:pointer;border:0}button:focus-visible,input:focus-visible{outline:3px solid #ffbc63;outline-offset:3px}#app{position:relative;width:100%;height:100%;height:100dvh;overflow:hidden;background:#1a4b4e}#game{display:block;width:100%;height:100%;touch-action:none}.hidden{display:none!important}.screen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;text-align:center;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:calc(38px + var(--safe-t)) 18px calc(18px + var(--safe-b));background:linear-gradient(165deg,#174349 0%,#102d37 80%);color:var(--cream);z-index:10}.screen:before{content:"";pointer-events:none;position:absolute;inset:0;background:radial-gradient(ellipse at 50% 26%,#39776e60,transparent 62%);z-index:0}.screen>*{position:relative;z-index:1}.shop-brand{font-size:10px;font-weight:850;letter-spacing:.19em;color:#b3e4d0}.brand-line{display:inline-block;width:18px;border-top:1px solid #b3e4d0;vertical-align:middle;margin:0 5px}.title-art{height:min(25vh,196px);min-height:110px;width:100%;display:flex;align-items:center;justify-content:center;gap:18px;margin-top:14px}.bag{width:102px;height:118px;background:#eae1cd;clip-path:polygon(14% 23%,32% 23%,32% 2%,68% 2%,68% 23%,86% 23%,91% 100%,9% 100%);color:#d2654a;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:23px;line-height:1.0;font-weight:1000;transform:rotate(-8deg);box-shadow:0 6px 20px #0005}.bag span{font-size:36px}.pile{font-size:95px;letter-spacing:-35px;color:#e9b55b;transform:rotate(17deg);text-shadow:4px 7px #0003}.pile b{color:#92c2ae}.pile i{color:#e78667}h1{font-weight:1000;font-size:clamp(37px,11vw,64px);letter-spacing:-.08em;line-height:1.14;margin:4px 0 12px;text-shadow:0 5px #09222b}h1 em{font-style:normal;color:#ffca78}.tagline{color:#d9e6df;font-weight:700;font-size:14px;line-height:1.8;margin:6px 0 22px}.primary-button{background:#ffab65;color:#193039;border-radius:16px;padding:16px 20px;font-weight:1000;font-size:17px;width:min(100%,345px);min-height:54px;box-shadow:0 6px 0 #a85635,0 10px 24px #0005;display:flex;align-items:center;justify-content:center;gap:20px}.primary-button:active{transform:translateY(4px);box-shadow:0 2px 0 #a85635}.primary-button span{font-size:24px}.instruction{font-size:12px;line-height:1.8;color:#afc8c2;margin:24px 0 10px}.title-bottom{display:flex;gap:12px;margin-top:auto}.text-button{color:#d2e4da;background:#ffffff13;border:1px solid #ffffff25;padding:11px 16px;border-radius:50px;font-size:11px;font-weight:800;letter-spacing:.06em}.best-mini{font-size:10px;letter-spacing:.2em;color:#b2cfca;margin-top:17px}.best-mini strong{font-size:18px;color:#ffce7d;margin-left:8px}.hud{position:absolute;z-index:5;top:0;left:0;right:0;padding:calc(10px + var(--safe-t)) 14px 10px;display:flex;gap:10px;align-items:center;justify-content:space-between;background:linear-gradient(#102e39ee,#102e3900);color:white;pointer-events:none}.hud-left{min-width:72px;display:flex;flex-direction:column}.hud-label{font-size:9px;letter-spacing:.17em;color:#c7dcdb;font-weight:800}.hud-number{font-weight:1000;font-size:32px;line-height:1.1;font-variant-numeric:tabular-nums}.hud-mid{text-align:right;min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.hud-mid span:first-child{font-size:9px;letter-spacing:.18em;color:#bfd4cc}.hud-mid span:last-child{font-size:12px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-button{pointer-events:auto;background:#ffffff25;border:1px solid #ffffff45;color:#fff;border-radius:50%;width:43px;height:43px;font-size:22px}.speech{position:absolute;z-index:8;left:50%;top:23%;transform:translateX(-50%);width:min(90%,360px);display:flex;flex-direction:column;gap:6px;padding:17px 20px;border:2px solid #a5cbb9;background:#f5eee1;color:#24414c;box-shadow:0 8px 0 #13262a88;border-radius:15px;font-weight:900;font-size:21px;line-height:1.4;text-align:center}.speech span:first-child{color:#ac6c48;font-size:11px;letter-spacing:.16em}.tip{position:absolute;z-index:4;bottom:calc(54px + var(--safe-b));left:50%;transform:translateX(-50%);white-space:nowrap;border-radius:30px;background:#102d38b8;color:#e9f5ef;font-size:13px;font-weight:750;padding:11px 20px;pointer-events:none}.banner{position:absolute;z-index:8;top:23%;left:50%;transform:translateX(-50%);color:#ffe1a4;font-size:clamp(23px,7vw,40px);font-weight:1000;white-space:nowrap;text-shadow:0 5px 0 #203b42,0 0 22px #ff5a2b}.result-screen{padding-top:calc(24px + var(--safe-t));gap:0}.result-tag{font-size:11px;letter-spacing:.29em;color:#f4ba82;font-weight:1000}.result-screen h2{font-size:clamp(31px,9vw,46px);line-height:1.18;letter-spacing:-.04em;margin:15px 0 10px}.result-lead{font-size:13px;color:#b5cec4;margin:8px 0 0}.result-score{display:flex;align-items:baseline;gap:7px;color:#ffce79}.result-score strong{font-size:clamp(90px,27vw,135px);line-height:1.06;font-weight:1000}.result-score span{font-size:28px;font-weight:900}.new-best{font-size:13px;color:#fff59f;font-weight:1000;letter-spacing:.06em;animation:pulse .7s infinite alternate}.result-ribbon{background:#f4b76b;color:#213e43;padding:9px 22px;border-radius:7px;font-weight:1000;transform:rotate(-2deg);margin:8px 0 12px}.result-info{display:flex;gap:20px;color:#afc9c5;font-size:10px;font-weight:800;letter-spacing:.1em;margin-bottom:14px}.result-info strong{color:#fff;max-width:110px;display:inline-block;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis}.ranking{width:min(100%,355px);background:#ffffff0b;border:1px solid #ffffff22;border-radius:14px;padding:12px 16px;margin-bottom:17px}.ranking-heading{color:#f8ca7f;font-size:12px;font-weight:900;letter-spacing:.13em;margin-bottom:8px}.rank-row{display:flex;justify-content:space-between;color:#e1eae5;font-size:12px;padding:4px 0;border-bottom:1px solid #ffffff13}.rank-row:last-child{border:0}.rank-row b{color:#ffcf7c}.result-actions{width:min(100%,345px);display:flex;flex-direction:column;align-items:center;gap:12px}.secondary-button{background:#ffffff12;border:1px solid #ffffff55;border-radius:12px;color:#e5f0e9;font-weight:850;padding:12px 20px;min-height:43px}.ad-space{width:min(100%,345px);height:72px;flex-shrink:0;margin:18px 0 4px;border:1px dashed #8aabb355;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#91b5b3;gap:4px}.ad-space span{font-size:10px;letter-spacing:.22em}.ad-space small{font-size:11px}.modal{z-index:30;position:absolute;inset:0;background:#000a;display:flex;align-items:center;justify-content:center;padding:24px}.modal-inner{width:min(100%,350px);padding:25px;background:#f7f2e9;color:#17333c;border-radius:18px}.modal-inner h2{margin:0 0 15px}.modal-inner label{display:block;font-size:12px;margin-bottom:8px;font-weight:750}.modal-inner input{width:100%;padding:14px;border:1px solid #9db6b2;border-radius:10px;background:white;color:#15343e;touch-action:manipulation}.modal-actions{display:flex;gap:10px;margin-top:18px}.modal-actions button{flex:1;font-size:13px;box-shadow:none}.modal-actions .secondary-button{background:#dae0de;color:#16343c;border:0}@keyframes pulse{from{opacity:.6;transform:scale(.97)}to{opacity:1;transform:scale(1.03)}}@media(max-height:670px){.screen{padding-top:calc(18px + var(--safe-t))}.title-art{height:112px;min-height:100px;margin-top:6px}h1{font-size:37px}.tagline{font-size:12px;margin-bottom:12px}.instruction{margin-top:16px}.result-screen h2{font-size:32px}.result-score strong{font-size:76px}}@media(min-width:740px){#app{width:min(100vw,620px);margin:auto;box-shadow:0 0 60px #0008}.screen{padding-left:40px;padding-right:40px}}@media(prefers-reduced-motion:reduce){.new-best{animation:none}}

/* Illustration refresh: depth only. Existing layout, touch rules and ad space stay. */
.screen{background:radial-gradient(ellipse at 18% 5%,#50877b42,transparent 50%),linear-gradient(150deg,#214c50,#102d37 82%)}
.title-art .bag{background:linear-gradient(105deg,#fff1d8,#e1cfad 68%,#b89f7e);filter:drop-shadow(3px 7px 2px #061f2940)}
.pile{text-shadow:1px 1px #ffe6ac,3px 4px #9d623d,7px 10px 12px #061d2980}
.primary-button{background:linear-gradient(110deg,#ffd197,#f3a15f 65%,#dc8650);border-top:1px solid #fff0c785;box-shadow:inset 0 1px 0 #fff4,0 6px 0 #a85635,0 10px 24px #0005}
.ranking{background:linear-gradient(140deg,#ffffff0d,#ffffff04);box-shadow:inset 0 1px 0 #ffffff0d,0 5px 16px #08242d25}
.result-ribbon{background:linear-gradient(100deg,#ffdaa0,#edac65);box-shadow:0 3px 0 #8c533d55,inset 0 1px 0 #fff7}
.speech{background:linear-gradient(145deg,#fff9ec,#eee3cf);box-shadow:0 7px 0 #163d4155,0 10px 24px #0d2a3522}

/* Prevent long-press selection/callouts during play; keep name entry editable. */
#app{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#playerName{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.speech,.banner{pointer-events:none}

.bomb-warning{position:absolute;z-index:9;top:17%;left:50%;transform:translateX(-50%);padding:12px 24px;border:2px solid #ffe298;border-radius:12px;background:#a53127eb;color:#fff2c8;font-size:24px;font-weight:1000;white-space:nowrap;pointer-events:none;box-shadow:0 4px 15px #54231f55}
.ranking-note,#rankingStatus{font-size:11px;line-height:1.6;color:#c4d9d1;margin:8px 0}.online-ranking button{font-size:12px;margin:4px 2px}.online-ranking button:disabled{opacity:.55;cursor:default}.rank-row.is-me{background:#ffc67818;border-radius:5px}.rank-row span{overflow-wrap:anywhere;min-width:0;text-align:left}.rank-row b{white-space:nowrap;margin-left:8px}
.ranking-note a{color:#ffdc9e;text-underline-offset:3px}

.ranking-consent{font-size:10px;line-height:1.6;color:#c8dcd2;margin:0 0 12px}.ranking-consent a{color:#ffdc9e;text-underline-offset:2px}

.title-goods{display:block;width:145px;height:110px;max-width:45vw}
.result-name{width:100%;margin:10px 0 12px;text-align:left}.result-name label{display:block;color:#d4e5da;font-size:12px;font-weight:750;margin-bottom:7px}.result-name-row{display:flex;align-items:stretch;gap:7px}.result-name input{min-width:0;width:100%;flex:1;font-size:16px;padding:10px;border:1px solid #91b5ab;border-radius:9px;background:#fffaf0;color:#183b41;touch-action:manipulation}.result-name button{flex:none;white-space:nowrap;margin:0;padding:10px 12px}.result-name #nameStatus{font-size:11px;line-height:1.6;color:#e0d7b1;margin:7px 0 0}.share-x{display:block;width:100%;text-align:center;text-decoration:none;background:#142e36}

.game-home-link{text-decoration:none}.title-screen{padding-top:calc(54px + var(--safe-t))}.title-screen .title-home{position:absolute;top:calc(9px + var(--safe-t));left:14px;display:inline-flex;align-items:center;min-height:34px;padding:6px 10px;border:1px solid #bed8ca55;border-radius:9px;color:#e6eadb;background:#193d4280;font-size:11px;font-weight:800}.result-actions .game-home-link{display:block;text-align:center;width:100%}
