/* © 2026 SUKIMA GAMES All rights reserved. 無断転載・再配布禁止 */
:root {
  --ink: #1d1830; --night: #2a2350; --shu: #e2452f; --cream: #fff3dc; --water: #5cc8ff; --water2: #1f8fd6; --gold: #ffcf5a;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a2340; color: var(--cream); font-family: var(--font); -webkit-user-select: none; user-select: none; overscroll-behavior: none; touch-action: none; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
[hidden] { display: none !important; }

/* ---- 画面(タイトル・一時停止・結果) */
.screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); z-index: 20; overflow-y: auto; touch-action: pan-y; }
.screen.show { display: flex; }
#titleScreen { background: linear-gradient(180deg, rgba(30,22,60,.15), rgba(30,22,60,.05) 40%, rgba(25,15,40,.65)); }
#pauseScreen, #resultScreen { background: rgba(22,16,40,.55); backdrop-filter: blur(3px); }
.back { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 14px; color: var(--cream); text-decoration: none; font-size: 14px; opacity: .85; padding: 6px 10px; border-radius: 99px; background: rgba(20,14,40,.45); }
.tCard { width: min(560px, 100%); margin: auto 0; text-align: center; padding: 26px 22px 20px; border-radius: 22px; background: rgba(28,20,52,.72); border: 1px solid rgba(255,220,170,.22); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.tCard.small { width: min(320px, 100%); }
.tCard h2 { margin: 0 0 16px; font-size: 22px; }
.credit { font-size: 11px; letter-spacing: .32em; opacity: .7; margin-bottom: 6px; }
.logo { margin: 0; line-height: 1; font-weight: 900; }
.logo .l1 { display: block; font-size: 17px; letter-spacing: .22em; color: var(--gold); text-shadow: 0 2px 0 #8a3a1a; }
.logo .l2 { display: block; margin-top: 4px; font-size: clamp(34px, 9.4vw, 58px); letter-spacing: .02em; white-space: nowrap; color: #fff; -webkit-text-stroke: 2px var(--water2); paint-order: stroke fill; text-shadow: 0 5px 0 var(--water2), 0 10px 24px rgba(40,140,220,.55); }
.lead { margin: 14px 0 18px; font-size: 15px; line-height: 1.7; }
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 14px 28px; font: 800 17px var(--font); color: var(--ink); background: var(--cream); cursor: pointer; text-decoration: none; margin: 4px; }
.btn.go { background: linear-gradient(180deg, #7fdcff, var(--water2)); color: #fff; box-shadow: 0 5px 0 #0f5a8c; text-shadow: 0 1px 0 rgba(0,0,0,.25); min-width: 210px; }
.btn.go:active { transform: translateY(3px); box-shadow: 0 2px 0 #0f5a8c; }
.btn.x { background: #111; color: #fff; }
.btn.ghost { background: rgba(255,255,255,.12); color: var(--cream); }
.best { margin-top: 10px; font-size: 13px; opacity: .85; min-height: 1em; }
.how { margin-top: 14px; text-align: left; font-size: 13px; line-height: 1.65; background: rgba(0,0,0,.18); border-radius: 12px; padding: 8px 12px; }
.how summary { cursor: pointer; font-weight: 700; text-align: center; }
.how ul { margin: 8px 0; padding-left: 1.2em; }
.how b { color: var(--gold); }
.keys { margin: 6px 0 2px; opacity: .85; font-size: 12px; }
body.sp .pcOnly, body:not(.sp) .spOnly { display: none; }

/* ---- 結果 */
.rCard { width: min(560px, 100%); margin: auto 0; text-align: center; padding: 20px 18px; border-radius: 22px; background: rgba(28,20,52,.82); border: 1px solid rgba(255,220,170,.25); }
.rHead { font-size: 14px; letter-spacing: .2em; opacity: .8; }
.rPct { font-size: 30px; font-weight: 900; line-height: 1; margin: 2px 0 6px; }
.rPct b { font-size: 84px; color: #fff; -webkit-text-stroke: 2px var(--water2); paint-order: stroke fill; text-shadow: 0 4px 0 var(--water2); }
.rTitle { display: inline-block; font-size: 20px; font-weight: 900; color: var(--ink); background: var(--gold); padding: 4px 16px; border-radius: 6px; }
.rLine { margin: 8px 0; font-size: 14px; opacity: .9; }
.rStats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 13px; opacity: .9; }
.rStats b { font-size: 17px; color: var(--gold); }
.rImg { display: block; width: 100%; max-width: 480px; aspect-ratio: 1200 / 630; margin: 12px auto 8px; border-radius: 10px; background: #000; object-fit: cover; }
.rBtns { display: flex; flex-wrap: wrap; justify-content: center; }
.shareMsg { font-size: 12px; min-height: 1em; opacity: .85; }

/* ---- プレイ中 */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hTop { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 max(14px, env(safe-area-inset-left)); }
.hSaved, .hFire { background: rgba(25,18,45,.55); border-radius: 12px; padding: 5px 12px; min-width: 92px; }
.hSaved small, .hFire small { display: block; font-size: 10px; opacity: .8; letter-spacing: .1em; }
.hSaved b { font-size: 28px; font-weight: 900; color: #bff0ff; }
.hFire { text-align: right; margin-right: 52px; }
.hFire b { font-size: 24px; font-weight: 900; color: #ffb27a; }
.hSaved i, .hFire i { font-style: normal; font-size: 12px; margin-left: 2px; }
.hTime { font-size: 34px; font-weight: 900; letter-spacing: .04em; text-shadow: 0 2px 6px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.hTime.hurry { color: #ff8a6a; }
.bPause { pointer-events: auto; position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(25,18,45,.6); color: var(--cream); font-size: 16px; font-weight: 900; }
.hTank { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); width: 240px; }
.tankLabel { font-size: 11px; letter-spacing: .15em; opacity: .85; }
.tankBar { height: 16px; border-radius: 99px; background: rgba(20,14,40,.6); border: 2px solid rgba(190,235,255,.55); overflow: hidden; }
.tankBar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #2a9ce0, #8fe1ff); transition: width .1s; }
.tankBar.low i { background: linear-gradient(90deg, #e0502a, #ffb07a); }
.hItems { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.chip.hose { background: var(--shu); }
.chip.bal { background: #d65aa8; }
.cross { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; }
.cross::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; background: #fff; border-radius: 50%; }
#toasts { position: absolute; top: 25%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.toast { font-weight: 900; font-size: 20px; padding: 5px 16px; border-radius: 99px; background: rgba(25,18,45,.6); text-shadow: 0 2px 4px rgba(0,0,0,.4); animation: toast 2.2s forwards; }
.toast.fire { color: #ffb27a; }
.toast.out { color: #bff0ff; }
.toast.lost { color: #c9b8b8; }
.toast.item { color: var(--gold); }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px) scale(.9); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.refill { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); font-weight: 900; font-size: 18px; color: #bff0ff; background: rgba(20,60,100,.6); padding: 4px 14px; border-radius: 99px; }
.hint { position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); font-size: 14px; font-weight: 800; color: #ffd0a0; text-shadow: 0 2px 4px rgba(0,0,0,.6); white-space: nowrap; }
.count { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 110px; font-weight: 900; pointer-events: none; z-index: 15; color: #fff; -webkit-text-stroke: 3px var(--water2); paint-order: stroke fill; text-shadow: 0 6px 0 var(--water2); }
.count.word { font-size: clamp(44px, 12vw, 84px); }
.gfoot { position: fixed; right: 10px; bottom: 6px; font-size: 10px; opacity: .55; z-index: 21; pointer-events: none; }
.gfoot a { color: inherit; pointer-events: auto; }
body.playing .gfoot { display: none; }

/* ---- スマホ操作 */
#touch { position: fixed; inset: 0; z-index: 9; display: none; }
body.sp.playing #touch { display: block; }
.stick { position: absolute; left: 22%; top: 72%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.3); opacity: .5; transition: opacity .15s; pointer-events: none; }
.stick.show { opacity: 1; }
.stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.55); transform: translate(-50%, -50%); }
.tb { position: absolute; border: 0; border-radius: 50%; font: 900 15px var(--font); color: #fff; touch-action: none; }
.tb.spray { right: max(22px, env(safe-area-inset-right)); bottom: max(34px, env(safe-area-inset-bottom)); width: 104px; height: 104px; background: radial-gradient(circle at 40% 35%, #8fe1ff, var(--water2)); box-shadow: 0 5px 0 #0f5a8c; }
.tb.spray.on { transform: translateY(3px) scale(.96); box-shadow: 0 2px 0 #0f5a8c; }
.tb.balloon { right: max(136px, env(safe-area-inset-right)); bottom: max(54px, env(safe-area-inset-bottom)); width: 66px; height: 66px; background: radial-gradient(circle at 40% 35%, #ffa6dc, #c2408e); font-size: 13px; }
.tb.balloon b { display: block; font-size: 15px; }
.tb.balloon.none { opacity: .35; }
.tb.balloon.on { transform: scale(.92); }
body.sp .hTank { bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 66px); width: 180px; }
body.sp .hint { bottom: auto; top: 62%; }

/* 縦画面 */
@media (orientation: portrait) {
  .hTime { font-size: 28px; }
  .hSaved, .hFire { min-width: 0; padding: 4px 9px; }
  .hSaved b { font-size: 22px; } .hFire b { font-size: 19px; }
  .hFire { margin-right: 48px; }
  .toast { font-size: 16px; }
  .tb.spray { bottom: max(70px, env(safe-area-inset-bottom)); }
  .tb.balloon { right: max(36px, env(safe-area-inset-right)); bottom: max(190px, env(safe-area-inset-bottom)); }
}
/* 横長で低い(スマホ横) */
@media (orientation: landscape) and (max-height: 500px) {
  .tCard { padding: 14px 18px; }
  .logo .l1 { font-size: 18px; } .logo .l2 { font-size: 48px; }
  .lead { margin: 8px 0 10px; font-size: 13px; }
  .rPct b { font-size: 56px; }
  .rCard { width: min(800px, 100%); padding: 12px 14px; display: grid; grid-template-columns: 1.1fr 1fr; column-gap: 16px; align-items: center; }
  .rCard > * { grid-column: 2; }
  .rCard > .rImg { grid-column: 1; grid-row: 1 / span 7; max-width: none; margin: 0; }
  .rTitle { justify-self: center; font-size: 16px; }
  .rLine { margin: 4px 0; font-size: 12px; }
  .rBtns .btn { padding: 10px 16px; font-size: 14px; min-width: 0; }
  .tb.spray { width: 92px; height: 92px; bottom: max(24px, env(safe-area-inset-bottom)); }
  .tb.balloon { right: max(128px, env(safe-area-inset-right)); bottom: max(30px, env(safe-area-inset-bottom)); }
  body.sp .hTank { top: calc(max(8px, env(safe-area-inset-top)) + 70px); width: 160px; }
  #toasts { top: 20%; }
  .toast { font-size: 15px; padding: 3px 12px; }
}

/* ---- キャラ選び・ボス・溜めゲージ */
.pick { margin: 4px 0 8px; font-size: 12px; letter-spacing: .3em; opacity: .85; }
.chars { display: flex; gap: 8px; justify-content: center; }
.chCard { flex: 1 1 0; max-width: 120px; padding: 6px 4px 4px; border-radius: 14px; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: var(--cream); font: 800 13px var(--font); cursor: pointer; transition: transform .12s, border-color .12s; }
.chCard canvas { display: block; width: 100%; aspect-ratio: 4 / 5; }
.chCard.sel { border-color: var(--gold); background: rgba(255,207,90,.18); transform: translateY(-3px); }
.charInfo { margin: 10px 0 12px; min-height: 3.6em; font-size: 13px; line-height: 1.6; text-align: left; background: rgba(0,0,0,.2); border-radius: 12px; padding: 8px 12px; }
.charInfo b { color: var(--gold); }
.boss { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translateX(-50%); width: min(300px, 60vw); text-align: center; font-weight: 900; font-size: 13px; color: #ffb27a; }
.bossBar { height: 12px; border-radius: 99px; background: rgba(20,14,40,.65); border: 2px solid rgba(255,170,110,.7); overflow: hidden; }
.bossBar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff4a1a, #ffb24a); transition: width .1s; }
.charge { position: absolute; left: 50%; top: 56%; transform: translateX(-50%); width: 120px; height: 10px; border-radius: 99px; background: rgba(20,14,40,.6); border: 2px solid rgba(190,235,255,.7); overflow: hidden; }
.charge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5cc8ff, #fff); }
.tb.jump { right: max(22px, env(safe-area-inset-right)); bottom: max(150px, env(safe-area-inset-bottom)); width: 70px; height: 70px; background: radial-gradient(circle at 40% 35%, #b8f08a, #4aa83a); font-size: 12px; box-shadow: 0 4px 0 #2a6a22; }
.tb.jump.on { transform: translateY(2px) scale(.95); }
.tb.spray { font-size: 16px; }
@media (orientation: portrait) {
  .tb.jump { right: max(26px, env(safe-area-inset-right)); bottom: max(190px, env(safe-area-inset-bottom)); }
  .tb.balloon { right: max(120px, env(safe-area-inset-right)); bottom: max(100px, env(safe-area-inset-bottom)); }
  .boss { top: calc(max(10px, env(safe-area-inset-top)) + 64px); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tCard { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1.25fr; column-gap: 14px; align-items: center; text-align: center; }
  .tCard > .credit, .tCard > .logo, .tCard > .lead, .tCard > .btn, .tCard > .best, .tCard > .how { grid-column: 1; }
  .tCard > .pick, .tCard > .chars, .tCard > .charInfo { grid-column: 2; }
  .tCard > .pick { grid-row: 1; }
  .tCard > .chars { grid-row: 2 / span 2; }
  .tCard > .charInfo { grid-row: 4 / span 2; font-size: 12px; min-height: 0; }
  .tCard > .how { grid-row: 6; }
  .logo .l2 { font-size: 34px; }
  .chCard canvas { aspect-ratio: 4 / 4; object-fit: cover; object-position: top; }
  .tb.jump { right: max(124px, env(safe-area-inset-right)); bottom: max(100px, env(safe-area-inset-bottom)); }
  .tb.balloon { right: max(210px, env(safe-area-inset-right)); bottom: max(28px, env(safe-area-inset-bottom)); }
  .boss { top: calc(max(8px, env(safe-area-inset-top)) + 52px); }
}

/* ---- ふきだし・サブ武器 */
.bubble { position: absolute; left: max(16px, env(safe-area-inset-left)); top: 34%; max-width: min(300px, 62vw); padding: 8px 14px 9px; border-radius: 18px 18px 18px 4px; background: #fffaf0; color: #3a2a30; box-shadow: 0 4px 0 rgba(0,0,0,.25); animation: bub .25s ease-out; }
.bubble b { display: block; font-size: 11px; letter-spacing: .1em; color: #2f8fd0; }
.bubble span { font-size: 16px; font-weight: 900; line-height: 1.4; }
@keyframes bub { from { transform: scale(.7) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.subHud { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); text-align: right; background: rgba(25,18,45,.6); border-radius: 12px; padding: 6px 12px; line-height: 1.3; }
.subHud small { display: block; font-size: 10px; letter-spacing: .1em; opacity: .8; }
.subHud kbd { background: rgba(255,255,255,.2); border-radius: 4px; padding: 0 5px; font: inherit; }
.subHud b { display: block; font-size: 15px; }
.subHud i { font-style: normal; font-weight: 900; color: #7affc0; }
.subHud.wait i { color: #ffd07a; }
body.sp .subHud { display: none; }
.rQuote { margin: 2px 0 6px; font-size: 15px; font-weight: 800; color: #bff0ff; }
.chCard small { display: block; font-size: 10px; font-weight: 700; opacity: .7; margin-top: -2px; }
.tb.sub { right: max(22px, env(safe-area-inset-right)); bottom: max(250px, env(safe-area-inset-bottom)); width: 78px; height: 78px; background: radial-gradient(circle at 40% 35%, #ffd98a, #e08a1e); font-size: 11px; line-height: 1.15; box-shadow: 0 4px 0 #8a4a0a; }
.tb.sub b { display: block; font-size: 16px; }
.tb.sub.none { opacity: .5; }
.tb.sub.on { transform: scale(.93); }
@media (orientation: portrait) {
  .tb.sub { right: max(120px, env(safe-area-inset-right)); bottom: max(190px, env(safe-area-inset-bottom)); }
  .bubble { top: 30%; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tb.sub { right: max(210px, env(safe-area-inset-right)); bottom: max(100px, env(safe-area-inset-bottom)); width: 70px; height: 70px; }
  .tb.balloon { right: max(300px, env(safe-area-inset-right)); }
  .bubble { top: 40%; }
}
@media (orientation: portrait) {
  .tb.balloon { right: max(142px, env(safe-area-inset-right)); bottom: max(84px, env(safe-area-inset-bottom)); }
  .tb.sub { right: max(116px, env(safe-area-inset-right)); bottom: max(196px, env(safe-area-inset-bottom)); }
}

/* ---- 導入 */
.intro { display: none; align-items: stretch; justify-content: stretch; padding: 0; cursor: pointer; background: none; z-index: 25; overflow: hidden; touch-action: manipulation; }
.intro.show { display: flex; }
.intro::before, .intro::after { content: ""; position: absolute; left: 0; right: 0; height: 14%; background: #120d22; z-index: 1; }
.intro::before { top: 0; } .intro::after { bottom: 0; height: 30%; }
.intro .skip { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; z-index: 3; border: 0; border-radius: 99px; padding: 8px 14px; background: rgba(255,255,255,.18); color: var(--cream); font: 800 13px var(--font); cursor: pointer; }
.introBand { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 16px max(8px, env(safe-area-inset-bottom)); }
.introText { white-space: pre-line; font-size: clamp(17px, 3.4vw, 30px); font-weight: 900; line-height: 1.55; letter-spacing: .04em; color: #fff3dc; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.intro.flip .introText { animation: introIn .9s ease-out both; }
@keyframes introIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.introHint { margin-top: 6px; font-size: 15px; font-weight: 900; color: #7fdcff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.introChars { position: absolute; left: 0; right: 0; bottom: 30%; z-index: 2; display: none; justify-content: center; gap: clamp(6px, 2vw, 22px); pointer-events: none; }
.intro[data-cut="3"] .introChars { display: flex; }
.introChars canvas { width: clamp(70px, 17vw, 150px); aspect-ratio: 4 / 5; animation: charIn .7s cubic-bezier(.2,1.4,.4,1) both; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.introChars canvas:nth-child(2) { animation-delay: .12s; } .introChars canvas:nth-child(3) { animation-delay: .24s; } .introChars canvas:nth-child(4) { animation-delay: .36s; }
@keyframes charIn { from { transform: translateY(120%) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@media (orientation: landscape) and (max-height: 500px) { .intro::before { height: 10%; } .intro::after, .introBand { height: 34%; } .introChars { bottom: 34%; } .introChars canvas { width: clamp(56px, 11vw, 110px); } .introText { font-size: clamp(14px, 2.6vw, 22px); } }

/* ---- お化けの見送りの言葉 */
.farewells { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bye { position: absolute; transform: translate(-50%, -50%); max-width: 56vw; padding: 5px 12px; border-radius: 99px; background: rgba(255,243,220,.95); color: #6a2a14; font-weight: 900; font-size: 15px; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.2); animation: bye 1.8s ease-out forwards; }
.bye.big { font-size: 20px; white-space: normal; text-align: center; padding: 8px 18px; border-radius: 18px; animation-duration: 2.8s; }
@keyframes bye { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@media (orientation: portrait) { .bye { font-size: 13px; } .bye.big { font-size: 16px; } }

.btn.small { padding: 6px 14px; font-size: 12px; margin-top: 6px; }

/* ---- ドデカの導火線・泳ぐボタン */
.fuseBar { height: 7px; margin-top: 3px; border-radius: 99px; background: rgba(20,14,40,.65); border: 1px solid rgba(255,230,120,.7); overflow: hidden; }
.fuseBar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe08a, #ff5a1a); }
.boss small { display: block; margin-top: 2px; font-size: 10px; opacity: .85; }
.boss.hot .fuseBar { animation: blink .5s infinite; border-color: #ff5a1a; }
.tb.swim { right: max(22px, env(safe-area-inset-right)); bottom: max(250px, env(safe-area-inset-bottom)); width: 78px; height: 78px; background: radial-gradient(circle at 40% 35%, #8ff0ff, #1f9fd6); font-size: 13px; box-shadow: 0 4px 0 #0f5a8c; }
.tb.swim.on { transform: scale(.93); background: radial-gradient(circle at 40% 35%, #c8fbff, #35b4ec); }
@media (orientation: portrait) { .tb.swim { right: max(26px, env(safe-area-inset-right)); bottom: max(290px, env(safe-area-inset-bottom)); } .tb.sub { bottom: max(196px, env(safe-area-inset-bottom)); } }
@media (orientation: landscape) and (max-height: 500px) { .tb.swim { right: max(124px, env(safe-area-inset-right)); bottom: max(190px, env(safe-area-inset-bottom)); width: 66px; height: 66px; } .boss small { display: none; } }
@media (orientation: portrait) { .boss { top: calc(max(10px, env(safe-area-inset-top)) + 112px); width: min(340px, 80vw); } .boss small { font-size: 9px; } }

/* ======== タイトル画面(ポップ・紙の切り抜き風) ======== */
#titleScreen { background: radial-gradient(120% 80% at 50% 0%, rgba(255,150,90,.28), rgba(40,30,90,.10) 55%), linear-gradient(180deg, rgba(30,22,80,.10), rgba(20,12,50,.55)); }
.tWrap { width: min(640px, 100%); margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px 0 18px; position: relative; z-index: 1; }
.tHead { text-align: center; }
.tHead .credit { font-size: 11px; letter-spacing: .3em; opacity: .8; margin-bottom: 8px; }
.ribbon { display: inline-block; padding: 5px 20px; font-weight: 900; font-size: 15px; letter-spacing: .12em; color: #fff; background: #e2452f; border: 3px solid #fff; border-radius: 6px; transform: rotate(-2deg); box-shadow: 0 4px 0 rgba(0,0,0,.28); }
.logo2 { margin: 10px 0 0; font-weight: 900; line-height: .98; transform: rotate(-3deg); animation: logoBob 3.2s ease-in-out infinite; }
.logo2 span { display: block; font-size: clamp(44px, 12.5vw, 84px); letter-spacing: .02em; -webkit-text-stroke: 9px #fff; paint-order: stroke fill; filter: drop-shadow(0 6px 0 rgba(20,14,60,.55)); }
.logo2 .a { color: #ff5a2a; text-align: left; padding-left: 4%; }
.logo2 .b { color: #1f9bf0; text-align: right; padding-right: 4%; margin-top: -2px; }
@keyframes logoBob { 0%,100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-6px); } }
.tHead .lead { margin: 14px 0 0; font-size: 15px; font-weight: 700; text-shadow: 0 2px 0 rgba(20,14,50,.6); }
.tPick { width: 100%; text-align: center; background: rgba(255,248,232,.14); border: 3px solid rgba(255,255,255,.55); border-radius: 22px; padding: 10px 10px 12px; backdrop-filter: blur(3px); }
.pick { margin: 0 0 8px; letter-spacing: .12em; opacity: 1; }
.pick span { display: inline-block; background: #fff; color: var(--ink); border-radius: 99px; padding: 3px 16px; font-size: 13px; font-weight: 900; }
.chars { gap: 8px; }
.chCard { max-width: 132px; background: #fff7e6; color: var(--ink); border: 3px solid #fff; box-shadow: 0 5px 0 rgba(20,14,50,.35); border-radius: 16px; padding: 6px 4px 6px; transform: rotate(var(--rot, 0deg)); transition: transform .15s, box-shadow .15s; }
.chCard:nth-child(1) { --rot: -2deg; } .chCard:nth-child(2) { --rot: 1.5deg; } .chCard:nth-child(3) { --rot: -1.5deg; } .chCard:nth-child(4) { --rot: 2deg; }
.chCard span { display: block; margin-top: 2px; color: var(--ink); }
.chCard small { display: block; font-size: 11px; font-weight: 800; color: #fff; background: var(--cc, #5cc8ff); border-radius: 99px; margin: 3px 6px 0; padding: 1px 0; }
.chCard canvas { background: color-mix(in srgb, var(--cc, #5cc8ff) 28%, #fff7e6); border-radius: 10px; }
.chCard:hover { transform: rotate(0) translateY(-3px); }
.chCard.sel { background: #fff; border-color: var(--cc, var(--gold)); box-shadow: 0 0 0 4px var(--gold), 0 8px 0 rgba(20,14,50,.4); transform: rotate(0) translateY(-8px) scale(1.06); z-index: 1; }
.chCard.sel::after { content: "えらんだ!"; position: absolute; }
.chCard { position: relative; }
.chCard.sel::after { top: -12px; left: 50%; transform: translateX(-50%) rotate(-4deg); background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 900; padding: 1px 9px; border-radius: 99px; white-space: nowrap; box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.charInfo { margin: 12px 4px 0; background: #fff7e6; color: var(--ink); border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 0 rgba(20,14,50,.3); position: relative; font-weight: 700; }
.charInfo::before { content: ""; position: absolute; top: -11px; left: 50%; width: 16px; height: 16px; background: #fff7e6; border-left: 3px solid #fff; border-top: 3px solid #fff; transform: translateX(-50%) rotate(45deg); }
.charInfo b { color: #d6471f; }
.tAct { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.btn.big { font-size: 28px; letter-spacing: .14em; padding: 16px 40px; min-width: min(360px, 90%); border: 4px solid #fff; background: linear-gradient(180deg, #ff9a3c, #ff4e2a); box-shadow: 0 7px 0 #a82a12, 0 12px 24px rgba(0,0,0,.35); animation: goPulse 1.6s ease-in-out infinite; }
.btn.big:hover { filter: brightness(1.08); }
.btn.big:active { transform: translateY(5px); box-shadow: 0 2px 0 #a82a12; animation: none; }
@keyframes goPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.best { margin: 0; font-weight: 800; background: rgba(20,14,50,.45); border-radius: 99px; padding: 2px 14px; }
.best:empty { display: none; }
.icons { display: flex; gap: 10px; }
.ibtn { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 92px; padding: 8px 4px 6px; border: 3px solid #fff; border-radius: 16px; background: #fff7e6; color: var(--ink); font: 800 11px var(--font); cursor: pointer; box-shadow: 0 4px 0 rgba(20,14,50,.35); }
.ibtn i { font-style: normal; font-size: 22px; line-height: 1; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #1f9bf0; }
.ibtn:nth-child(2) i { background: #8b6ad8; } .ibtn:nth-child(3) i { background: #3fb86a; } .ibtn.off i { background: #999; }
.ibtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(20,14,50,.35); }
/* ふわふわ飛ぶ紙ふぶき */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 19; display: none; }
#titleScreen.show ~ .confetti, body.titleOn .confetti { display: block; }
.confetti i { position: absolute; top: -20px; width: 14px; height: 18px; border-radius: 3px; border: 2px solid #fff; opacity: .9; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(115vh) rotate(540deg); } }
/* あそびかた・せってい(重ねて開く) */
.screen.over { z-index: 40; background: rgba(15,10,40,.62); }
.how2 { width: min(560px, 100%); text-align: left; background: #fff7e6; color: var(--ink); border: 4px solid #fff; }
.how2 h2 { text-align: center; } .how2 ul { padding-left: 1.2em; font-size: 14px; line-height: 1.7; } .how2 b { color: #d6471f; }
.how2 .keys { font-size: 12px; background: rgba(0,0,0,.07); border-radius: 10px; padding: 6px 10px; }
.how2 .btn, .setCard .btn { display: block; margin: 10px auto 0; }
.setCard { background: #fff7e6; color: var(--ink); border: 4px solid #fff; width: min(380px, 100%); }
.setCard .row { display: block; text-align: left; font-weight: 800; margin: 8px 0; }
.setCard .row b { color: #d6471f; margin-left: 6px; }
.setCard input[type=range] { width: 100%; margin-top: 8px; accent-color: #ff5a2a; height: 30px; }
.setCard .sensHint { display: flex; justify-content: space-between; opacity: .6; margin: -4px 0 6px; }
.setCard .chk { display: flex; align-items: center; gap: 10px; } .setCard .chk input { width: 22px; height: 22px; accent-color: #ff5a2a; }
.setCard .btn.ghost { background: #e8dfc8; color: var(--ink); }
@media (orientation: landscape) and (max-height: 500px) {
  .tWrap { width: min(860px, 100%); display: grid; grid-template-columns: 1fr 1.15fr; grid-template-rows: auto auto; column-gap: 18px; row-gap: 8px; padding: 6px 0; align-items: center; }
  .tHead { grid-column: 1; grid-row: 1; } .tPick { grid-column: 2; grid-row: 1 / span 2; padding: 8px; } .tAct { grid-column: 1; grid-row: 2; }
  .logo2 span { font-size: 42px; -webkit-text-stroke: 7px #fff; } .tHead .lead { display: none; } .tHead .credit { display: none; }
  .btn.big { font-size: 22px; padding: 10px 24px; } .ibtn { width: 78px; padding: 5px 2px 4px; } .ibtn i { width: 26px; height: 26px; font-size: 17px; }
  .chCard canvas { aspect-ratio: 1 / 1; object-fit: cover; object-position: top; } .charInfo { font-size: 11px; min-height: 0; margin-top: 8px; padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) { .logo2, .btn.big, .confetti i { animation: none; } }
/* タイトル: 1画面におさめる調整 */
.logo2 span { white-space: nowrap; font-size: clamp(34px, min(15vw, 10vh), 72px); -webkit-text-stroke-width: 7px; }
.tWrap { gap: 8px; padding: 26px 0 10px; }
.charInfo { font-size: 12px; line-height: 1.5; min-height: 0; padding: 6px 10px; }
@media (max-height: 900px) { .tHead .lead, .tHead .credit { display: none; } .ribbon { font-size: 13px; padding: 3px 14px; } .btn.big { font-size: 24px; padding: 11px 34px; } .ibtn { padding: 5px 4px 4px; } .chCard canvas { aspect-ratio: 1 / 1; object-fit: cover; object-position: top; } }
@media (orientation: landscape) and (max-height: 500px) { .logo2 span { font-size: 40px; } }
@media (max-height: 820px) and (min-width: 600px) {
  .tWrap { gap: 6px; padding: 14px 0 6px; } .logo2 span { font-size: min(9vw, 8.5vh); } .chCard { max-width: 96px; padding: 4px 3px; } .chCard span { font-size: 12px; }
  .tAct { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 10px; } .tAct .best { order: 3; } .btn.big { font-size: 22px; padding: 9px 26px; min-width: 0; } .ibtn { width: 70px; } .ibtn span { font-size: 10px; } .ibtn i { width: 24px; height: 24px; font-size: 15px; }
}

/* ======== GPTの完成絵を使った表示 ======== */
.logoImg { margin: 0; animation: logoBob 3.2s ease-in-out infinite; }
.logoImg img { display: block; width: min(560px, 88vw); max-height: 24vh; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(20,14,60,.5)) drop-shadow(0 10px 18px rgba(0,0,0,.3)); }
.tHead .ribbon { margin-top: 6px; }
.chCard canvas { image-rendering: auto; }
/* タンクのわく */
.tankBar { position: relative; height: auto; aspect-ratio: 512 / 96; background: none; border: 0; border-radius: 0; overflow: visible; }
.tankBar::after { content: ""; position: absolute; inset: 0; background: url(img/tank_frame.webp) center / 100% 100% no-repeat; pointer-events: none; }
.tankSlot { position: absolute; left: 15%; right: 3.5%; top: 23%; bottom: 23%; border-radius: 99px; overflow: hidden; background: rgba(20,14,50,.35); }
.tankBar i { height: 100%; }
/* ふきだし(顔アイコン) */
.bubble { display: flex; align-items: center; gap: 10px; }
.bubble img { width: 54px; height: 54px; flex: none; object-fit: contain; }
.subHud { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; column-gap: 8px; }
.subHud img { width: 40px; height: 40px; object-fit: contain; }
.rIcon { display: block; width: 72px; height: 72px; margin: 0 auto 4px; object-fit: contain; }
/* スマホのボタン(絵つき) */
.tb { font-size: 0 !important; background-color: transparent !important; background-repeat: no-repeat !important; background-position: center !important; background-size: contain !important; box-shadow: none !important; filter: drop-shadow(0 4px 0 rgba(20,14,60,.4)); }
.tb.spray { background-image: url(img/btn_attack.webp) !important; }
.tb.balloon { background-image: url(img/btn_balloon.webp) !important; }
.tb.jump { background-image: url(img/btn_jump.webp) !important; }
.tb.sub { background-image: url(img/btn_sub.webp) !important; }
.tb.swim { background-image: url(img/btn_swim.webp) !important; }
.tb.on { transform: translateY(3px) scale(.94); filter: brightness(1.15) drop-shadow(0 1px 0 rgba(20,14,60,.4)); }
.tb b { font-size: 18px !important; position: absolute; right: -2px; bottom: -2px; min-width: 24px; padding: 1px 6px; border-radius: 99px; background: #fff7e6; color: #1d1830; border: 2px solid #1d1830; line-height: 1.2; }
.tb b:empty { display: none; }
.tb.none { opacity: .45; }
/* 導入: 3枚の絵 */
.intro { background: #120d22 center / cover no-repeat; }
.intro[data-cut="1"] { background-image: url(img/intro_stalls_1.webp); } .intro[data-cut="2"] { background-image: url(img/intro_stalls_2.webp); } .intro[data-cut="3"] { background-image: url(img/intro_stalls_3.webp); }
.intro::before { display: none; } .intro::after { display: none; }
.introBand { background: linear-gradient(180deg, transparent, rgba(18,13,34,.82) 45%); height: 36%; }
.intro[data-cut="3"] .introChars { display: none; }
@media (orientation: landscape) and (max-height: 500px) { .introBand { height: 44%; } }
