*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;touch-action:none;overscroll-behavior:none;background:#092f43;color:#f4fcff;font-family:"Yu Gothic",Meiryo,sans-serif;user-select:none}canvas{position:absolute;inset:0;width:100%;height:100%;display:block}button{font:inherit;cursor:pointer;border:1px solid #c5eeef55;color:inherit;background:#123c50bb;border-radius:12px;padding:10px 17px;touch-action:none}button:hover{background:#27586c}button:focus-visible{outline:3px solid #ffe197;outline-offset:4px}[hidden]{display:none!important}#vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#05263880,transparent 65%),linear-gradient(0deg,#062a3c55,transparent 30%)}.screen{position:absolute;inset:0;display:flex;align-items:center;padding:7vw;pointer-events:none}.intro{pointer-events:auto;max-width:600px}.eyebrow{font-size:10px;letter-spacing:3px;color:#9fe0e6;font-weight:700}h1{font-size:clamp(42px,5.7vw,80px);line-height:1.15;letter-spacing:.02em;margin:24px 0 16px;text-shadow:0 4px 28px #07364f}h1 span{display:block}.subtitle{font-size:15px;letter-spacing:3px;color:#d1edf3}.story{margin:28px 0;line-height:1.9;color:#d0e9ed;font-size:16px}.primary{display:block;background:#d4f578;color:#153f42;border:0;font-weight:800;border-radius:14px;padding:17px 26px;min-width:240px;box-shadow:0 7px 24px #061e3444;text-align:left}.primary span{float:right}.primary:hover{background:#e5ffa0}.instructions{font-size:12px;color:#b8d9e4;line-height:1.9;margin-top:22px}.instructions b{font-weight:400;color:#eaf8ed}.best{font-size:11px;letter-spacing:2px;color:#9cbdcb}.stamp{position:absolute;right:5%;bottom:5%;font-size:10px;line-height:2;letter-spacing:2px;color:#b4dce3}header{position:absolute;inset:25px 32px auto;pointer-events:none;display:flex;justify-content:space-between}header button{pointer-events:auto;font-size:12px;padding:8px 12px}.scoreblock{display:flex;flex-direction:column;gap:5px}.scoreblock small{letter-spacing:2px;color:#addef0;font-size:11px}.scoreblock strong{font-size:44px;line-height:1.2;font-weight:700}.scoreblock span{font-size:12px;color:#bde4ed}.right{text-align:right;display:flex;flex-direction:column;gap:10px}#lives{color:#ffceb9;font-size:21px;letter-spacing:4px}#clock{font-size:11px;color:#cce6eb}#combo{position:absolute;top:112px;font-size:26px;color:#ddf996}#combo small{font-size:10px;display:block;color:#bddbe1}#charge{position:absolute;bottom:27px;width:min(420px,80vw);left:50%;transform:translateX(-50%);pointer-events:none}.charge-label{display:flex;justify-content:space-between;font-size:11px;margin-bottom:9px;color:#e4f8ff}.track{height:12px;background:#031d31ac;border:1px solid #b0e5ef55;border-radius:20px;overflow:hidden;position:relative}#fill{height:100%;width:0;background:linear-gradient(90deg,#8ae4ec,#d9f884);border-radius:20px}.track i{position:absolute;left:70%;top:0;height:100%;border-left:1px solid #ffffff88}#tip{font-size:10px;text-align:center;color:#b3d9e4}#toast{position:absolute;top:26%;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:26px;font-weight:800;color:#e7ffa3;text-shadow:0 3px 14px #052a43;pointer-events:none;transition:opacity .2s}.modal{justify-content:center;background:#05273888;backdrop-filter:blur(8px);padding:22px;pointer-events:auto}.panel{background:#0d3346ed;border:1px solid #a4dfe538;border-radius:24px;padding:32px;max-width:500px;width:100%;box-shadow:0 20px 80px #021d3655;text-align:center}.panel h2{font-size:27px;margin:14px 0}.panel p{font-size:12px;color:#bcdbe6;line-height:1.8}.panel .primary{margin:22px auto 0;width:100%}.wide{max-width:850px}#cards{display:flex;gap:14px;margin-top:25px}#cards button{flex:1;text-align:left;padding:22px 16px;background:#184758;min-width:0}#cards button:hover{border-color:#dcf798;background:#245b64}#cards em{font-size:26px;display:block;color:#d8f495;font-style:normal;margin-bottom:12px}#cards strong{font-size:15px}#cards p{font-size:12px;margin-bottom:0}.result-label{font-size:11px;color:#a6cbd7}#finalScore{display:block;font-size:62px;color:#ddf892}#stats{padding:15px;border-top:1px solid #ffffff22;border-bottom:1px solid #ffffff22;line-height:2;font-size:14px}#chosen{min-height:22px}@media(max-width:600px){.screen{padding:28px}.intro{align-self:flex-start;margin-top:5vh}h1{font-size:44px;margin-top:18px}.subtitle{font-size:11px;letter-spacing:1px}.story{margin:20px 0;font-size:13px}.instructions{font-size:10px;margin-top:16px}.primary{min-width:210px;padding:15px 22px}.stamp{display:none}header{inset:18px 20px auto}.scoreblock strong{font-size:34px}#combo{top:103px}#charge{bottom:15px}#toast{font-size:22px;top:32%}.panel{padding:24px 18px}.panel h2{font-size:22px}#cards{flex-direction:column;gap:9px;margin-top:15px}#cards button{padding:12px 15px}#cards em{float:left;margin:0 14px 0 0;font-size:23px}#cards p{margin-top:5px;font-size:11px}.modal{padding:16px}.wide>p{font-size:10px}#finalScore{font-size:48px}}

/* ためゲージの目印＝次の流氷の中心まで届くため（毎フレーム left を合わせる） */
.track i{left:50%;width:0;border-left:2px solid #fff;box-shadow:0 0 6px #fff;transition:left .25s ease,opacity .2s}
.titleSound{display:block;margin-top:12px;font-size:12px;padding:7px 14px}
.back{display:inline-block;margin-top:10px;padding-block:.35rem;font-size:12px;color:#b8d9e4;text-decoration:none}
.back:hover{color:#fff;text-decoration:underline}
/* 結果・強化の画面は、背の低い画面（スマホ横）でも中でスクロールできるように */
.modal{overflow-y:auto}
.modal .panel{margin:auto}
@media(max-height:500px){.modal{align-items:flex-start}.panel{padding:18px 20px}.panel h2{font-size:20px;margin:8px 0}#finalScore{font-size:40px}#stats{padding:8px;line-height:1.6}.panel .primary{margin-top:12px;padding:12px 20px}#cards{flex-direction:row;margin-top:12px}#cards button{padding:10px 12px}#cards em{font-size:20px;margin-bottom:6px}#cards p{font-size:11px}.intro{margin-top:0}h1{font-size:34px;margin:10px 0 8px}.story{display:none}.instructions{margin-top:10px}}

@media(max-height:500px){.panel .eyebrow{display:none}#stats{display:flex;justify-content:center;gap:1.2em;flex-wrap:wrap}#stats br{display:none}#finalBest{margin:2px 0}.result-label{margin:4px 0}#chosen{margin:2px 0;min-height:0}.panel h2{margin:4px 0}}

.instructions,.story,.subtitle,.best{text-shadow:0 1px 6px #04213299,0 0 2px #042132cc}

@media(max-height:500px){h1 span{display:inline}.subtitle{margin:0}.instructions{line-height:1.6}.titleSound{display:inline-block;margin:10px 0 0}.intro .best{display:inline-block;margin:6px 16px 0 0}.intro .back{margin-top:0}}

/* 「タイトルへ」（一時停止・結果） */
.text-button{display:block;margin:12px auto 0;background:none;border:0;color:#bfe3ec;font-size:13px;padding:8px 14px;text-decoration:underline;text-underline-offset:3px}
.text-button:hover{background:none;color:#fff}
/* タイトルは低い画面でも「← ほかのゲーム」まで届くように：中で縦スクロール（先頭が切れない margin:auto 型） */
#title{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;pointer-events:auto;align-items:flex-start}
#title .intro{margin:auto 0}
@media(max-height:800px) and (min-width:601px){#title{padding-top:28px;padding-bottom:28px}h1{font-size:clamp(40px,7vh,64px);line-height:1.3;margin:12px 0 8px}.subtitle{margin:0}.story{margin:14px 0;font-size:15px;line-height:1.7}.instructions{margin-top:12px;line-height:1.7}.titleSound{margin-top:8px}.best{margin:8px 0 0}.back{margin-top:4px}}
@media(max-height:660px) and (min-width:601px){h1 span{display:inline}.story{display:none}.titleSound{display:inline-block;margin:10px 0 0}.intro .best{display:inline-block;margin:6px 16px 0 0}}
@media(max-width:600px){#title .intro{margin:auto 0;align-self:auto}}
@media(max-width:600px) and (max-height:600px){h1{font-size:38px;margin:8px 0 6px}.story{margin:12px 0}.instructions{margin-top:10px}}
/* 低い画面の結果・一時停止：「もう一度／つづける」と「タイトルへ」を横に並べて1画面に収める */
@media(max-height:640px){.modal .panel .primary{display:inline-block;width:auto;min-width:200px;margin:12px 6px 0;text-align:center}.modal .panel .primary span{float:none;margin-left:6px}.modal .panel .text-button{display:inline-block;margin:12px 6px 0;vertical-align:middle}}
@media(max-width:600px){#title h1{line-height:1.3}}
@media(max-width:600px) and (orientation:portrait){#title .instructions{display:inline-block;background:#06283ad9;border-radius:10px;padding:8px 12px;position:relative;z-index:1}}
@media(max-height:500px){#title h1{line-height:1.15}}
