/* =========================================================
   きよごんメモリアル　画面の見た目
   ・文字：ロゴ=Dela Gothic One、本文=Zen Maru Gothic、議事録=Klee One
   ========================================================= */
:root {
  --ink: #fff8f1;
  --ink-dim: #c7d3e6;
  --ink-faint: rgba(255, 248, 241, .55);
  --sea-1: #041327;
  --abyss: #01060f;
  --glass: rgba(9, 22, 46, .72);
  --glass-line: rgba(255, 255, 255, .16);
  --coral: #ff6f91;
  --coral-deep: #d9406a;
  --gold: #ffd36b;
  --mine: #ff5a4e;
  --ok: #6be3a8;
  --cyan: #7fe3ff;
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --display: "Dela Gothic One", "Hiragino Sans", sans-serif;
  --hand: "Klee One", "Hiragino Mincho ProN", serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; color: var(--ink); font-family: var(--font); }
body { overscroll-behavior: none; display: grid; place-items: center; background: radial-gradient(120% 80% at 50% 0%, #0e2f5c, #01060f 70%); }
button { font: inherit; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; }

#app {
  position: relative; width: 100%; max-width: 440px; height: 100dvh; overflow: hidden;
  background: var(--sea-1); user-select: none; -webkit-user-select: none; box-shadow: 0 0 80px rgba(0, 0, 0, .6);
}
@media (min-width: 600px) { #app { height: min(100dvh, 920px); border-radius: 28px; } }
#sea { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; animation: screen-in .45s var(--ease-out); }
@keyframes screen-in { from { opacity: 0; } }
.overlay { z-index: 20; }
.hidden { display: none !important; }

.btn {
  display: block; width: 100%; padding: 15px 18px; border-radius: 999px; border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, .08); font-size: 16px; font-weight: 700; letter-spacing: .04em; transition: transform .15s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn.primary { border: none; color: #fff; background: linear-gradient(135deg, #ff8aa6, var(--coral-deep)); box-shadow: 0 10px 30px -8px rgba(255, 111, 145, .7), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.small { width: auto; padding: 8px 16px; font-size: 13px; }

/* ---------- タイトル ---------- */
#title { align-items: center; justify-content: center; }
.title-bg { position: absolute; inset: -4%; background: url(assets/cg/title.jpg) center 60% / cover, linear-gradient(180deg, #2a1240, #0b1a33); animation: kenburns 24s ease-in-out infinite alternate; }
.title-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(25, 8, 50, .55) 0%, rgba(25, 8, 50, 0) 38%, rgba(2, 10, 26, 0) 60%, rgba(2, 10, 26, .85) 100%); }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translateY(-1.5%); } }
.rays { position: absolute; inset: 0; mix-blend-mode: screen; opacity: .5; background: repeating-conic-gradient(from 200deg at 30% -10%, rgba(255, 220, 180, .16) 0deg 3deg, transparent 3deg 11deg); -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%); mask-image: linear-gradient(180deg, #000 0%, transparent 70%); animation: rays 9s ease-in-out infinite alternate; }
@keyframes rays { to { transform: rotate(4deg) scale(1.05); opacity: .3; } }
.title-inner { position: relative; z-index: 2; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; padding: max(54px, env(safe-area-inset-top)) 24px max(26px, env(safe-area-inset-bottom)); text-align: center; }
.title-kicker { margin: 0; display: flex; gap: .4em; font-size: 14px; font-weight: 700; letter-spacing: .28em; color: #ffe9c9; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.title-kicker span { opacity: 0; animation: rise-in .9s var(--ease-out) forwards; }
.title-kicker span:nth-child(2) { animation-delay: .15s; }
.logo { margin: 10px 0 0; font-family: var(--display); font-weight: 400; line-height: .98; letter-spacing: .02em; }
.logo-line { display: block; font-size: clamp(50px, 15vw, 66px); background: linear-gradient(180deg, #fff 0%, #ffe2ea 38%, #ff8fad 72%, #e64b78 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #6a1238) drop-shadow(0 0 26px rgba(255, 120, 160, .55)); opacity: 0; transform: translateY(24px) scale(.96); animation: logo-in 1.1s var(--spring) .25s forwards; }
.logo-line.sub { font-size: clamp(40px, 12vw, 54px); animation-delay: .42s; letter-spacing: .06em; }
@keyframes logo-in { to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.title-kiyogon { display: none; }
/* 差し出された手と「はじめから」に同じ光。押すと光が手へ吸い寄せられる */
.hand-glow { position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 244, 220, .95), rgba(255, 190, 210, .35) 40%, transparent 70%); mix-blend-mode: screen; pointer-events: none; animation: hand-breathe 2.4s ease-in-out infinite; }
@keyframes hand-breathe { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } }
.glow-orb { position: absolute; z-index: 8; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255, 220, 230, .8) 40%, transparent 70%); box-shadow: 0 0 30px 10px rgba(255, 190, 210, .6); opacity: 0; pointer-events: none; }
#title.diving .glow-orb { animation: orb-fly .55s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes orb-fly { 0% { opacity: 1; transform: translate(0, 0) scale(1.4); } 100% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(.6); } }
#title.diving .hand-glow { animation: hand-catch .5s ease-out .5s forwards; }
@keyframes hand-catch { to { opacity: 1; transform: scale(2.6); } }
.title-menu { margin-top: auto; width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.title-menu .menu-btn { opacity: 0; animation: rise-in .7s var(--ease-out) forwards; }
.title-menu .menu-btn:nth-child(1) { animation-delay: 1.1s; }
.title-menu .menu-btn:nth-child(2) { animation-delay: 1.2s; }
.title-menu .menu-btn:nth-child(3) { animation-delay: 1.3s; }
.menu-btn { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 16px 22px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(8, 20, 44, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 17px; font-weight: 900; letter-spacing: .08em; transition: transform .15s; }
.menu-btn[hidden] { display: none; }
.menu-btn small { font-size: 12px; font-weight: 700; color: var(--ink-dim); letter-spacing: .02em; }
.menu-btn.primary { justify-content: center; border: none; background: linear-gradient(135deg, #ff9ab2, var(--coral-deep)); box-shadow: 0 14px 36px -10px rgba(255, 111, 145, .9), inset 0 1px 0 rgba(255, 255, 255, .45); font-size: 19px; }
.menu-btn.primary::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid rgba(255, 236, 200, .7); box-shadow: 0 0 24px rgba(255, 236, 200, .45); animation: pulse-ring 2.4s ease-out infinite; }
@keyframes pulse-ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.12); opacity: 0; } }
.menu-btn.ghost { background: rgba(255, 255, 255, .06); }
.menu-btn:active { transform: scale(.97); }
.title-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-dim); letter-spacing: .12em; }

/* ---------- 会話 ---------- */
#game { background: var(--sea-1); }
.stage { position: absolute; inset: 0; }
.bg { position: absolute; inset: -3%; background-size: cover; background-position: center top; animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-1.5%, -1%) scale(1.03); } }
.bg.izakaya { background-color: #2a1a4a; } .bg.pier { background-color: #d9f0ff; } .bg.cafe { background-color: #8a5a3a; }
.bg.office { background-color: #c9d6e8; } .bg.ship { background-color: #f39a6b; } .bg.sub { background-color: #0b2f55; } .bg.deep { background-color: #04122a; }
.stage-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 8, 20, .5) 0%, transparent 18%, transparent 50%, rgba(2, 8, 20, .85) 100%); }
.kiyogon { position: absolute; left: 50%; bottom: 25%; height: 56%; max-width: 92%; object-fit: contain; transform: translateX(-50%); transform-origin: 50% 100%; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); animation: breathe 3.6s ease-in-out infinite; transition: opacity .16s; }
.kiyogon.swap { opacity: 0; }
@keyframes breathe { 50% { transform: translateX(-50%) scale(1.012, .992); } }
.kiyogon.shake { animation: shake .45s; }
@keyframes shake { 15%, 55% { transform: translateX(-56%) rotate(-2deg); } 35%, 75% { transform: translateX(-44%) rotate(2deg); } }

.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; padding: max(10px, env(safe-area-inset-top)) 10px 10px; }
.day-chip { display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12px; font-weight: 700; white-space: nowrap; min-width: 0; }
.day-chip b { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #ff9ab2, var(--coral-deep)); font-family: var(--display); font-weight: 400; font-size: 14px; }
.day-chip span { overflow: hidden; text-overflow: ellipsis; max-width: 6.5em; }
@media (max-width: 420px) { .day-chip span { display: none; } .day-chip { padding-right: 4px; } }
.status { display: flex; gap: 1px; padding: 4px 6px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.param { display: flex; align-items: center; padding: 0 2px; font-size: 12px; }
.param i { font-style: normal; font-size: 10px; }
.param b { min-width: 1.1em; font-variant-numeric: tabular-nums; }
.param.bump { animation: bump .5s var(--spring); }
.param.hot { color: #ffb0a6; animation: blink .8s infinite; }
@keyframes bump { 40% { transform: scale(1.6); } }
@keyframes blink { 50% { opacity: .35; } }
.hud-right { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.life { font-size: 12px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.life.low { color: #ffb0a6; animation: blink .8s infinite; }
.mute { border: none; background: none; font-size: 16px; padding: 2px; }

.depth { position: absolute; right: 8px; top: 62px; bottom: 46%; z-index: 5; width: 26px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.depth-track { position: relative; flex: 1; width: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.depth-fill { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 4px; background: linear-gradient(180deg, var(--cyan), #2a6bff); transition: height 1.4s var(--ease-out); }
.depth-dot { position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px var(--cyan); transition: top 1.4s var(--ease-out); }
.depth-label { font-size: 10px; font-weight: 900; color: var(--cyan); writing-mode: vertical-rl; letter-spacing: .1em; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }

.pops { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.pop { position: absolute; left: 50%; top: 30%; font-weight: 900; font-size: 24px; text-shadow: 0 3px 0 rgba(0, 0, 0, .55); animation: pop 1.3s var(--ease-out) forwards; }
@keyframes pop { from { transform: translate(-50%, 10px) scale(.6); opacity: 0; } 20% { transform: translate(-50%, 0) scale(1.15); opacity: 1; } to { transform: translate(-50%, -70px); opacity: 0; } }
.stamp { position: absolute; top: 30%; left: 50%; z-index: 7; padding: 10px 18px; border: 5px double var(--mine); border-radius: 10px; color: var(--mine); font-family: var(--display); font-size: 22px; line-height: 1.15; text-align: center; background: rgba(255, 252, 246, .92); transform: translate(-50%, -50%) rotate(-12deg) scale(2.4); opacity: 0; pointer-events: none; }
.stamp.show { animation: stamp 1.7s forwards; }
@keyframes stamp { 12% { transform: translate(-50%, -50%) rotate(-12deg) scale(.92); opacity: 1; } 20% { transform: translate(-50%, -50%) rotate(-12deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }
.burst { position: absolute; top: 26%; left: 50%; z-index: 7; font-family: var(--display); font-size: 54px; color: var(--gold); text-shadow: 0 5px 0 #a5600b, 0 0 30px rgba(255, 211, 107, .9); transform: translate(-50%, -50%) scale(0); pointer-events: none; white-space: nowrap; }
.burst.show { animation: burst 1.4s forwards; }
@keyframes burst { 18% { transform: translate(-50%, -50%) scale(1.25) rotate(-7deg); } 32% { transform: translate(-50%, -50%) scale(1) rotate(-7deg); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(-7deg); } }

.dialog { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; flex-direction: column; gap: 10px; padding: 0 12px max(14px, env(safe-area-inset-bottom)); }
.textbox { position: relative; min-height: 118px; padding: 22px 20px 20px; border-radius: 22px; background: linear-gradient(180deg, rgba(14, 30, 60, .84), rgba(6, 16, 36, .92)); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .1); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.speaker { position: absolute; top: -15px; left: 16px; padding: 5px 16px 5px 14px; border-radius: 999px 999px 999px 6px; background: linear-gradient(135deg, #ff9ab2, var(--coral-deep)); font-size: 13px; font-weight: 900; letter-spacing: .12em; box-shadow: 0 6px 16px -6px rgba(255, 90, 130, .9); }
.speaker.narration { display: none; }
.text { margin: 0; font-size: 17px; line-height: 1.75; font-weight: 700; white-space: pre-wrap; letter-spacing: .02em; }
.text.narration { color: var(--ink-dim); font-size: 15px; font-weight: 500; }
.text .ch { opacity: 0; animation: ch-in .22s forwards; }
@keyframes ch-in { from { opacity: 0; transform: translateY(3px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.next { position: absolute; right: 18px; bottom: 12px; width: 10px; height: 10px; border-right: 2px solid var(--coral); border-bottom: 2px solid var(--coral); transform: rotate(45deg); animation: nudge 1s ease-in-out infinite; }
.next.off { visibility: hidden; }
@keyframes nudge { 50% { transform: rotate(45deg) translate(3px, 3px); } }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choices:empty { display: none; }
.choice { position: relative; padding: 14px 16px 14px 44px; border-radius: 16px; text-align: left; font-size: 15px; font-weight: 700; line-height: 1.45; background: rgba(255, 252, 246, .95); color: #1e2340; border: none; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .8); animation: card-in .42s var(--spring) backwards; transition: transform .12s; }
.choice::before { content: ""; position: absolute; left: 16px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--coral-deep); }
.choice:active { transform: scale(.97); background: #ffe3ea; }
.choice.mine { background: linear-gradient(135deg, #2a0f18, #4a1020); color: #ffd7cf; box-shadow: 0 0 0 2px var(--mine), 0 10px 30px -10px rgba(255, 90, 78, .9); }
.choice.mine::before { content: "💣"; border: none; width: auto; height: auto; margin-top: -11px; font-size: 16px; left: 14px; animation: fuse .9s ease-in-out infinite; }
@keyframes fuse { 50% { transform: rotate(-12deg) scale(1.15); } }
.choice.warn { background: linear-gradient(135deg, #3a2800, #5a3c00); color: #ffe29a; box-shadow: 0 0 0 2px #ffb020; }
.choice.warn::before { border-color: #ffb020; }
.choice.single { padding-left: 16px; text-align: center; font-size: 17px; background: linear-gradient(135deg, #ff9ab2, var(--coral-deep)); color: #fff; }
.choice.single::before { display: none; }
@keyframes card-in { from { transform: translateY(16px) scale(.96); opacity: 0; } }

.notebook { position: absolute; inset: 0; z-index: 12; display: none; align-items: center; justify-content: center; padding: 70px 18px 30px; background: rgba(2, 8, 20, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.notebook.open { display: flex; animation: screen-in .4s; }
.nb-page { position: relative; width: 100%; max-height: 100%; overflow: hidden; padding: 22px 22px 18px 48px; border-radius: 6px 14px 14px 6px; background-color: #f6ecd6; color: #3a2a1e; font-family: var(--hand); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), inset 6px 0 0 #c9a77a; background-image: linear-gradient(90deg, transparent 34px, rgba(220, 80, 80, .5) 34px, rgba(220, 80, 80, .5) 36px, transparent 36px), repeating-linear-gradient(180deg, transparent 0 33px, rgba(70, 110, 170, .25) 33px 34px); transform: rotate(-1.2deg); animation: nb-in .6s var(--spring); }
@keyframes nb-in { from { transform: rotate(-6deg) translateY(40px) scale(.9); opacity: 0; } }
.nb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 600; }
.nb-head span:first-child { font-size: 26px; letter-spacing: .2em; }
.nb-owner { font-size: 12px; opacity: .7; }
.nb-lines { margin: 0; padding: 0; list-style: none; }
.nb-lines li { font-size: 18px; line-height: 34px; animation: write-in .7s ease-out backwards; }
.nb-lines li.strong { font-weight: 600; color: #a1261c; }
@keyframes write-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.nb-hint { margin: 8px 0 0; text-align: right; font-size: 12px; opacity: .5; }

/* ---------- 画面の乗っ取り ---------- */
#takeover { background: #f4f6f9; color: #1d2433; padding: 24px 18px max(20px, env(safe-area-inset-bottom)); justify-content: center; gap: 16px; animation: glitch .55s steps(6); }
#takeover.red { background: #fff2f2; }
@keyframes glitch { 0% { clip-path: inset(0 0 100% 0); } 33% { clip-path: inset(30% 0 40% 0); transform: translateX(-10px); } 66% { clip-path: inset(8% 0 0 0); transform: translateX(8px); } 100% { clip-path: inset(0); } }
.board { display: flex; flex-direction: column; gap: 14px; }
.board-head span { font-size: 12px; color: #5b6578; }
.board-head h2 { margin: 2px 0; font-size: 24px; font-weight: 900; }
.board-by { display: block; }
.kpt { display: grid; gap: 8px; }
.kpt > div { padding: 12px 14px; border-radius: 12px; background: #fff; border-left: 6px solid; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.kpt h3 { margin: 0 0 4px; font-size: 14px; } .kpt p { margin: 2px 0; font-size: 15px; }
.kpt .k { border-color: #2fa36b; } .kpt .p { border-color: #e04b4b; } .kpt .t { border-color: #2f6fe0; }
.slides { display: flex; flex-direction: column; gap: 10px; }
.slide { position: relative; padding: 18px; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); border-top: 6px solid #2f6fe0; animation: card-in .4s var(--spring) backwards; }
.slide:nth-child(2) { animation-delay: .25s; } .slide:nth-child(3) { animation-delay: .5s; }
.slide h2 { margin: 0 0 6px; font-size: 18px; } .slide p { margin: 2px 0; font-size: 16px; } .slide .small { font-size: 12px; color: #6b7280; }
.slide-no { position: absolute; right: 12px; top: 10px; font-size: 11px; color: #6b7280; }
.cashout { display: flex; flex-direction: column; gap: 10px; }
.sheet-bar { padding: 8px 10px; border-radius: 6px 6px 0 0; background: #1d7a45; color: #fff; font-size: 12px; font-weight: 700; }
.sheet { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.sheet th { background: #eef0f3; color: #6b7280; font-weight: 600; width: 28px; }
.sheet td, .sheet th { border: 1px solid #d5d9e0; padding: 8px 6px; }
.sheet .neg { color: #d61f1f; font-weight: 800; }
.sheet .big { font-size: 18px; background: #ffe1e1; }
.sheet-alert { margin: 4px 0 0; padding: 12px; border-radius: 8px; background: #d61f1f; color: #fff; font-weight: 900; text-align: center; animation: blink .6s infinite; }

/* ---------- 一本釣りファイト ---------- */
#battle { background: linear-gradient(180deg, rgba(255, 190, 140, .25), rgba(255, 190, 140, 0) 15%), linear-gradient(180deg, transparent 0 14.6%, rgba(255, 255, 255, .7) 14.6% 15%, #3c8fc4 15%, #0b3b66 70%, #041a33 100%), url(assets/bg/pier.jpg) center 30% / cover; }
.battle-head { color: #fff !important; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.timer small { font-family: var(--font); font-size: 11px; margin: 0 3px; opacity: .8; }
.tension-label { text-align: center; line-height: 1.15; font-size: 10px !important; }
.shout { position: absolute; left: 58%; z-index: 3; max-width: 38%; padding: 6px 10px; border-radius: 14px 14px 14px 2px; background: #fff; color: #1d2433; font-size: 13px; font-weight: 900; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s; pointer-events: none; }
.shout.show { opacity: 1; animation: burst-in .25s var(--spring); }
.battle-head { display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top)) 18px 6px; color: #0b2340; }
.battle-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .04em; }
.timer { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.water { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.water.thrash { animation: quake .15s infinite; }
@keyframes quake { 50% { transform: translateX(4px); } }
.line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.line line { stroke: #f4faff; stroke-width: 2; }
.line.tense line { stroke: var(--mine); stroke-width: 3; }
.fish-kiyogon { position: absolute; left: 50%; width: 36%; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.fish-kiyogon.thrash { animation: thrash .18s infinite; }
.fish-kiyogon.caught { transform: translate(-50%, -50%); width: 62%; }
@keyframes thrash { 50% { transform: translate(-50%, -50%) rotate(14deg); } }
.ko { display: none; }
.warn { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 7px 16px; border-radius: 999px; background: var(--mine); font-weight: 900; white-space: nowrap; display: none; animation: blink .3s infinite; }
.warn.show { display: block; }
.tension { position: absolute; right: 12px; top: 56px; bottom: 56px; width: 26px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tension-label { font-size: 12px; font-weight: 900; }
.tension-bar { position: relative; flex: 1; width: 14px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.tension-bar::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; background: rgba(255, 90, 78, .35); }
.tension-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--ok); }
.tension-fill.danger { background: var(--mine); }
.distance { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-dim); }
.distance-bar { flex: 1; height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.distance-fill { height: 100%; width: 50%; background: linear-gradient(90deg, var(--gold), var(--coral)); }
.battle-result { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font-family: var(--display); font-size: 40px; text-shadow: 0 5px 0 rgba(0, 0, 0, .5); display: none; }
.battle-result.show { display: block; animation: burst-in .4s var(--spring); }
@keyframes burst-in { from { transform: scale(1.8); opacity: 0; } }
.battle-foot { padding: 10px 16px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; background: rgba(0, 0, 0, .25); }
.hint { margin: 0; font-size: 13px; text-align: center; color: var(--ink-dim); }
.reel { height: 88px; border: 1.5px solid rgba(255, 211, 107, .9); border-radius: 999px; font-family: var(--display); font-size: 32px; letter-spacing: .14em; color: var(--gold); background: rgba(4, 14, 32, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 4px rgba(255, 211, 107, .08), 0 0 34px -6px rgba(255, 211, 107, .6); text-shadow: 0 0 14px rgba(255, 211, 107, .6); touch-action: none; }
.reel.down { transform: scale(.97); background: rgba(255, 211, 107, .92); color: #2a1600; text-shadow: none; }

/* ---------- ゲームオーバー ---------- */
#gameover { align-items: center; justify-content: center; gap: 14px; padding: 28px; background: radial-gradient(80% 50% at 50% 30%, #3b1630, #0b0710); text-align: center; }
.go-label { margin: 0; font-family: var(--display); font-size: 34px; letter-spacing: .16em; color: var(--mine); text-shadow: 0 0 24px rgba(255, 90, 78, .7); animation: rise-in .6s var(--ease-out); }
.go-art { position: relative; width: 260px; height: 260px; border-radius: 18px; background: #f3ead8 center / cover; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); transform: rotate(-2deg); animation: nb-in .7s var(--spring); }
.go-art.gyotaku::before { content: ""; position: absolute; inset: 30px 40px; border-radius: 50%; border: 6px solid #1a1a1a; }
.go-art.calendar::before { content: "8"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 110px; font-weight: 900; color: #c22; }
.go-art.frozen::before { content: "凍結"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; font-weight: 900; color: #c22; }
.go-art.crack::before { content: ""; position: absolute; inset: 20px; border-radius: 50%; border: 10px solid #556; background: radial-gradient(circle at 40% 40%, #29496e, #0b1a33); }
.go-title { margin: 6px 0 0; font-size: 28px; font-weight: 900; }
.go-line { margin: 0 0 8px; color: var(--ink-dim); }
.go-actions { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- 正体がわかる場面 ---------- */
#reveal { background: var(--abyss); }
.reveal-world { position: absolute; inset: 0; transform-origin: 62% 62%; transition: transform 2.6s cubic-bezier(.2, .8, .2, 1); }
.reveal-world.close { transform: scale(3.2); }
.reveal-cg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.8s; }
.reveal-world.has-cg .octo, .reveal-world.has-cg .reveal-kiyogon { display: none; }
.reveal-world.has-cg:not(.close) .reveal-cg { opacity: 1; animation: kenburns 18s ease-in-out infinite alternate; }
.octo { position: absolute; left: 50%; bottom: 14%; width: 118%; transform: translateX(-56%); opacity: 0; transition: opacity 1.6s; }
.octo.show { opacity: 1; }
.reveal-kiyogon { position: absolute; right: 6%; bottom: 20%; width: 26%; opacity: 0; transition: opacity 1.6s; }
.reveal-kiyogon.show { opacity: 1; }
.hand { position: absolute; right: 8%; bottom: -60%; width: 46%; transition: bottom 1.6s cubic-bezier(.2, .8, .2, 1); z-index: 2; }
.hand.in { bottom: 14%; }
.hand.gone { opacity: 0; transition: opacity .8s; }
.reveal-text { position: absolute; left: 12px; right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 3; min-height: 88px; padding: 18px 20px; border-radius: 22px; background: linear-gradient(180deg, rgba(8, 20, 46, .78), rgba(2, 8, 22, .9)); border: 1px solid rgba(127, 227, 255, .25); font-size: 18px; line-height: 1.65; font-weight: 700; opacity: 0; transition: opacity .4s; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.reveal-text.show { opacity: 1; }

/* ---------- 結末 ---------- */
#ending { overflow-y: auto; background: linear-gradient(180deg, #0b0718, #04122a); }
.end-hero { position: relative; flex-shrink: 0; height: 100dvh; overflow: hidden; }
.end-scroll { margin: 18px 0 0; font-size: 12px; letter-spacing: .3em; color: var(--ink-dim); opacity: 0; animation: fade-in 1s ease 4.4s forwards; }
.end-scroll::after { content: ""; display: block; width: 1px; height: 28px; margin: 8px auto 0; background: linear-gradient(180deg, var(--ink-dim), transparent); animation: scroll-cue 1.8s ease-in-out infinite; }
@keyframes scroll-cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.end-cg { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; animation: kenburns 20s ease-in-out infinite alternate; }
.end-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(11, 7, 24, .3) 65%, #0b0718 100%); opacity: 0; animation: fade-in 1.2s ease 2.4s forwards; }
@keyframes fade-in { to { opacity: 1; } }
.end-hero-text { position: absolute; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); z-index: 2; padding: 0 22px; text-align: center; }
.end-kicker { margin: 0; font-family: var(--display); font-size: 13px; letter-spacing: .5em; color: var(--gold); opacity: 0; animation: rise-in .8s var(--ease-out) 2.8s forwards; }
.end-title { margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 8vw, 34px); line-height: 1.2; text-shadow: 0 4px 24px rgba(0, 0, 0, .8); opacity: 0; transform: translateY(20px); animation: logo-in 1s var(--spring) 3.1s forwards; }
.end-body { display: flex; flex-direction: column; gap: 14px; padding: 8px 16px max(24px, env(safe-area-inset-bottom)); }
.end-card { padding: 16px; border-radius: 20px; background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-line); opacity: 0; animation: rise-in .7s var(--ease-out) forwards; }
.end-card { animation-delay: .2s; }
.end-card h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: .14em; color: var(--ink-dim); }
.end-card h3 small { margin-left: 6px; color: var(--gold); }
.end-stats { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.end-stats dt { color: var(--ink-dim); font-size: 13px; }
.end-stats dd { margin: 0; font-weight: 900; }
.notebook-card { background-color: #f6ecd6; color: #3a2a1e; border: none; font-family: var(--hand); }
.notebook-card h3 { color: #7a5a3a; font-family: var(--font); }
.end-minutes li.hot { color: #b3261e; font-weight: 600; font-size: 18px; letter-spacing: .02em; text-shadow: .4px .4px 0 #b3261e; transform: rotate(-1.2deg); transform-origin: left; }
.end-minutes { margin: 0; padding-left: 18px; font-size: 16px; line-height: 30px; background-image: repeating-linear-gradient(180deg, transparent 0 29px, rgba(70, 110, 170, .25) 29px 30px); }
.album-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.album-grid.big { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px 24px; }
.album-slot { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-line); display: grid; place-items: center; font-size: 22px; color: var(--ink-faint); }
.album-slot img { width: 100%; height: 100%; object-fit: cover; }
.album-slot span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 6px; font-size: 10px; line-height: 1.3; color: #fff; text-align: center; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .75)); }
.album-grid.big .album-slot span { font-size: 13px; }
.album-slot.new { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(255, 211, 107, .6); }
.end-credit { margin: 4px 0 0; font-size: 10px; line-height: 1.6; color: var(--ink-faint); text-align: center; }
#album { overflow-y: auto; background: radial-gradient(120% 60% at 50% 0%, #20335e, #04122a 70%); }
.album-head { display: flex; justify-content: space-between; align-items: center; padding: max(18px, env(safe-area-inset-top)) 16px 4px; }
.album-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; }
.album-lead { margin: 4px 16px 14px; font-size: 13px; color: var(--ink-dim); }

/* ---------- 日の切り替え ---------- */
.daycard { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; visibility: hidden; }
.daycard.show { visibility: visible; pointer-events: auto; }
.dc-water { position: absolute; inset: 0; background: linear-gradient(180deg, #0f4c8a, #041327); transform: translateY(100%); }
.daycard.show .dc-water { animation: tide 2.1s var(--ease-out) forwards; }
@keyframes tide { 0% { transform: translateY(100%); } 28%, 72% { transform: translateY(0); } 100% { transform: translateY(-100%); } }
.dc-text { position: relative; text-align: center; opacity: 0; }
.daycard.show .dc-text { animation: dc-text 2.1s var(--ease-out) forwards; }
@keyframes dc-text { 0%, 18% { opacity: 0; transform: translateY(20px); } 35%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-30px); } }
.dc-day { margin: 0; font-family: var(--display); font-size: 64px; line-height: 1; letter-spacing: .06em; background: linear-gradient(180deg, #fff, #9fe6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dc-place { margin: 10px 0 0; font-size: 18px; font-weight: 900; letter-spacing: .12em; }
.dc-depth { margin: 8px 0 0; font-size: 13px; color: var(--cyan); letter-spacing: .3em; }

/* ---------- ミニゲーム ---------- */
#minigame { background-size: cover; background-position: center; }
#mgRoot { position: absolute; inset: 0; }
.mg { position: absolute; inset: 0; display: flex; flex-direction: column; }
.mg.dark { background: #01060f; }
.mg-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: max(12px, env(safe-area-inset-top)) 16px 6px; text-align: center; }
.mg-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 999px; background: rgba(4, 14, 32, .55); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.mg-chip b { padding: 3px 9px; border-radius: 999px; background: linear-gradient(135deg, #ff9ab2, var(--coral-deep)); font-family: var(--display); font-weight: 400; font-size: 11px; letter-spacing: .1em; }
.mg-how { font-size: 11px; line-height: 1.5; color: var(--ink-dim); letter-spacing: .04em; font-feature-settings: "palt"; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.mg-intro { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 28px; text-align: center; background: radial-gradient(80% 50% at 50% 50%, rgba(4, 14, 32, .55), rgba(1, 6, 15, .85)); pointer-events: none; animation: mg-intro 1.7s var(--ease-out) forwards; }
.mg-intro-kicker { margin: 0; font-family: var(--display); font-size: 12px; letter-spacing: .4em; color: var(--cyan); }
.mg-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 10vw, 42px); line-height: 1.15; color: #fff; letter-spacing: .06em; text-shadow: 0 0 28px rgba(120, 220, 255, .55); }
.mg-intro-how { margin: 0; max-width: 300px; font-size: 14px; line-height: 1.7; color: var(--ink); font-feature-settings: "palt"; }
@keyframes mg-intro { 0% { opacity: 0; transform: scale(1.06); } 15%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.97); } }
.mg-area { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.mg-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px max(16px, env(safe-area-inset-bottom)); }
/* 操作ボタン：場面の上に浮くガラスの帯。押すと金色に満ちる */
.mg-btn { --tint: 255, 211, 107; flex: 1; height: 68px; border: 1.5px solid rgba(var(--tint), .85); border-radius: 999px; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: .12em; color: rgb(var(--tint)); background: rgba(4, 14, 32, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 4px rgba(var(--tint), .08), 0 0 30px -6px rgba(var(--tint), .55), inset 0 1px 0 rgba(255, 255, 255, .15); text-shadow: 0 0 14px rgba(var(--tint), .6); touch-action: manipulation; transition: background .12s, color .12s, transform .12s; }
.mg-btn.big { height: 76px; font-size: 28px; }
.mg-btn:active, .mg-btn.down { transform: scale(.97); background: rgba(var(--tint), .92); color: #2a1600; text-shadow: none; }
.mg-btn.half { height: 64px; font-size: 20px; }
.mg-btn.work { --tint: 140, 180, 255; }
.mg-btn.love { --tint: 255, 140, 170; }
.mg-opt { flex: 1 1 45%; min-height: 58px; border-radius: 16px; border: none; background: rgba(255, 252, 246, .95); color: #1e2340; font-size: 15px; font-weight: 700; animation: card-in .35s var(--spring) backwards; }
.mg-opt.right { background: #c9f6df; box-shadow: 0 0 0 3px var(--ok); }
.mg-opt.wrong { background: #ffd2cc; box-shadow: 0 0 0 3px var(--mine); }
.mg-banner { position: absolute; left: 0; right: 0; top: 40%; z-index: 5; text-align: center; font-family: var(--display); font-size: 46px; white-space: pre-line; text-shadow: 0 5px 0 rgba(0, 0, 0, .6); pointer-events: none; opacity: 0; }
.mg-banner.show { opacity: 1; animation: burst-in .35s var(--spring); }
.mg-banner.go { color: var(--gold); }
.mg-banner.good { color: var(--ok); font-size: 30px; }
.mg-banner.bad { color: #ff8a7a; font-size: 26px; }
.mg-banner.result { font-size: 34px; line-height: 1.35; padding: 22px 10px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mg-banner.result.great { color: var(--gold); }
.mg-tally, .mg-score, .mg-timer { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 18px; font-weight: 900; }
.mg-score { display: flex; justify-content: space-around; font-size: 14px; }
.mg-score b { font-family: var(--display); font-size: 28px; color: var(--gold); }

.mg-kanpai .mg-area { background: radial-gradient(60% 40% at 50% 50%, rgba(255, 176, 74, .35), transparent); }
.jug { position: absolute; top: 52%; left: 50%; font-size: 120px; margin-left: -60px; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .5)); z-index: 3; }
.kanpai-kiyogon { position: absolute; left: 50%; top: 4%; height: 58%; transform: translateX(-50%); filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); z-index: 1; }
.kanpai-table { position: absolute; left: -10%; right: -10%; bottom: 0; height: 34%; z-index: 2; background: linear-gradient(180deg, #8a5a32, #5a3517 60%, #3a2210); border-top: 6px solid #a8743f; border-radius: 50% 50% 0 0 / 18% 18% 0 0; box-shadow: inset 0 10px 30px rgba(255, 200, 120, .25), 0 -10px 40px rgba(0, 0, 0, .4); }
.foam { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; z-index: 4; pointer-events: none; }
.foam.show.perfect, .foam.show.good { animation: foam-burst .7s ease-out forwards; box-shadow: 0 0 0 0 #fff, 30px -40px 0 6px #fffbe8, -34px -30px 0 8px #fff, 10px -70px 0 4px #fff7d0, -14px -60px 0 7px #fff, 44px -10px 0 5px #fffbe8, -46px -6px 0 4px #fff; }
.foam.show.miss { animation: foam-burst .9s ease-out forwards; background: #ffcf5a; box-shadow: 40px 40px 0 10px #ffcf5a, -50px 30px 0 8px #f5b83a, 10px 80px 0 12px #ffcf5a, -20px -50px 0 6px #ffe08a; }
@keyframes foam-burst { from { transform: scale(.2); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.mg-area.splashed { animation: jolt .4s; }
@keyframes jolt { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.mg-area.splashed .kanpai-kiyogon { filter: drop-shadow(0 0 0 transparent) sepia(.6) saturate(2) hue-rotate(-10deg); }
.clink { position: absolute; top: 40%; left: 0; right: 0; z-index: 5; text-align: center; font-family: var(--display); font-size: 38px; opacity: 0; -webkit-text-stroke: 6px #2a1406; paint-order: stroke fill; text-shadow: 0 6px 16px rgba(0, 0, 0, .6); }
.clink.show { opacity: 1; animation: burst-in .3s var(--spring); }
.clink.perfect { color: var(--gold); } .clink.good { color: #fff; } .clink.miss { color: #ff8a7a; }
.pond { position: absolute; left: 0; right: 0; top: 40%; bottom: 0; background: linear-gradient(180deg, rgba(120, 190, 240, .85) 0%, #2f78ad 30%, #0b3b66 100%); box-shadow: 0 -2px 0 rgba(255, 255, 255, .5); }
.pond::before { content: ''; position: absolute; inset: 0 0 auto; height: 40%; background: repeating-linear-gradient(170deg, transparent 0 18px, rgba(255, 255, 255, .12) 18px 20px); animation: ripple 3s linear infinite; }
@keyframes ripple { to { background-position: 60px 0; } }
.atari-kiyogon { position: absolute; left: -6%; top: 8%; height: 40%; z-index: 2; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); }
.bobber::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 46vh; background: rgba(255, 255, 255, .6); transform-origin: bottom; transform: rotate(-24deg); }
.bobber { position: absolute; left: 50%; top: 32%; width: 26px; height: 46px; margin-left: -13px; border-radius: 13px 13px 8px 8px; background: linear-gradient(180deg, #ff4a4a 0 45%, #fff 45% 100%); box-shadow: 0 6px 12px rgba(0, 0, 0, .3); animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.bobber.twitch { animation: twitch .26s; }
.bobber.sunk { top: 40%; height: 18px; opacity: .6; animation: none; }
@keyframes twitch { 50% { transform: translateY(8px); } }
.bite-mark { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-family: var(--display); font-size: 72px; color: #ffef5a; text-shadow: 0 4px 0 #c22; opacity: 0; }
.bite-mark.show { opacity: 1; animation: burst-in .2s; }
.caught-fish { position: absolute; left: 50%; top: 22%; width: 58%; transform: translateX(-50%); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .4)); animation: fish-jump .6s var(--spring); }
@keyframes fish-jump { from { transform: translate(-50%, 60px) rotate(-20deg) scale(.6); opacity: 0; } }
.splash { position: absolute; left: 50%; top: 38%; width: 120px; height: 60px; margin-left: -60px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .9); animation: splash .7s ease-out forwards; }
@keyframes splash { from { transform: scale(.2); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.ai-name { margin: 18px 16px 6px; font-size: 12px; color: var(--ink-dim); }
.ai-bubble { margin: 0 16px; padding: 18px; border-radius: 20px 20px 20px 6px; background: #eef2ff; color: #1d2433; font-size: 19px; font-weight: 900; line-height: 1.5; animation: card-in .4s var(--spring); }
.quiz-bar { margin: 14px 16px; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.quiz-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--ok), var(--gold)); }
.swipe-labels { position: absolute; top: 44px; left: 16px; right: 16px; display: flex; justify-content: space-between; font-weight: 900; color: var(--ink-dim); }
.task-card { position: absolute; left: 50%; top: 45%; width: 72%; padding: 36px 10px; margin-left: -36%; transform: translateY(-50%); border-radius: 22px; background: #fff8ee; color: #2a2030; text-align: center; font-size: 26px; font-weight: 900; box-shadow: 0 16px 30px rgba(0, 0, 0, .35); touch-action: none; }
.task-card:empty { visibility: hidden; }
.task-card.in { animation: card-in .2s var(--spring); }
.task-card.out-work { transform: translate(-130%, -50%) rotate(-16deg); opacity: 0; transition: .16s; }
.task-card.out-love { transform: translate(130%, -50%) rotate(16deg); opacity: 0; transition: .16s; }
.task-card.ng { background: #ffd2cc; }
.phone { --heat: 0; position: absolute; left: 50%; top: 44px; bottom: 6px; width: min(92%, 380px); transform: translateX(-50%); border-radius: 40px; padding: 10px; background: #0c0f16; box-shadow: 0 0 0 2px #2a2f3a, 0 0 calc(20px + var(--heat) * 60px) rgba(255, 90, 31, calc(var(--heat) * .9)), 0 30px 60px rgba(0, 0, 0, .6); transition: box-shadow .3s; }
.phone::before { content: ''; position: absolute; inset: 10px; border-radius: 30px; background: radial-gradient(120% 80% at 50% 0%, #3a2a5a, #12162a 60%), #12162a; }
.phone::after { content: ''; position: absolute; inset: 10px; border-radius: 30px; pointer-events: none; background: linear-gradient(0deg, rgba(255, 80, 20, calc(var(--heat) * .5)), transparent 60%); }
.phone-bar { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 6px 18px 0; font-size: 12px; font-weight: 700; }
.phone-island { width: 80px; height: 22px; border-radius: 999px; background: #000; }
.notif-field { position: absolute; inset: 44px 18px 18px; z-index: 1; }
.notif { display: flex; gap: 8px; align-items: center; width: 66%; max-width: none !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.notif-icon { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #1d1d1f; font-size: 16px; overflow: hidden; }
.notif-icon img { width: 140%; margin-top: 20%; }
.notif-body { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.35; }
.notif-body b { font-size: 11px; opacity: .6; }
.notif.fire { animation: card-in .18s var(--spring), flicker .5s .2s infinite alternate; }
@keyframes flicker { to { box-shadow: 0 0 18px rgba(255, 110, 40, .8), 0 8px 16px rgba(0, 0, 0, .35); } }
.douse { position: absolute; font-size: 34px; pointer-events: none; animation: douse .6s ease-out forwards; }
@keyframes douse { from { transform: translateY(-20px) scale(.6); opacity: 1; } to { transform: translateY(20px) scale(1.4); opacity: 0; } }
.notif { position: absolute; max-width: 56%; padding: 10px 12px; border-radius: 14px; border: none; font-size: 14px; font-weight: 700; text-align: left; box-shadow: 0 8px 16px rgba(0, 0, 0, .35); animation: card-in .18s var(--spring); touch-action: manipulation; }
.notif.fire { background: rgba(255, 255, 255, .92); color: #1d2433; border-left: 6px solid #ff5a1f; }
.notif.dm { background: rgba(223, 241, 255, .95); color: #0b3b66; border-left: 6px solid #2f8fe0; }
.notif.dm .notif-icon { background: #ffd9c2; }
.notif.put { transform: scale(.2); opacity: 0; transition: .25s; }
.notif.oops { background: #ffd2cc; transform: rotate(-8deg) scale(.6); opacity: 0; transition: .25s; }
.notif.fade { opacity: 0; transition: .3s; }
.porthole { --deep: 0; position: absolute; left: 50%; top: 46%; width: 62vmin; max-width: 300px; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 16px solid #6b7590; box-shadow: inset 0 0 40px rgba(0, 0, 0, .6), 0 0 0 4px #3a4258; background: radial-gradient(circle at 50% 40%, hsl(205, 80%, calc(45% - var(--deep) * 40%)), hsl(220, 80%, calc(18% - var(--deep) * 14%))); }
.cracks { position: absolute; inset: 0; border-radius: 50%; opacity: 0; background: linear-gradient(35deg, transparent 48%, rgba(255, 255, 255, .8) 49%, transparent 51%), linear-gradient(-60deg, transparent 47%, rgba(255, 255, 255, .7) 48%, transparent 50%); }
.porthole { overflow: hidden; border-color: #8a7350; box-shadow: inset 0 0 50px rgba(0, 0, 0, .7), 0 0 0 4px #4a3a22, 0 0 0 10px rgba(0, 0, 0, .25), 0 20px 50px rgba(0, 0, 0, .6); }
.ph-fish { position: absolute; inset: 0; opacity: calc(1 - var(--deep) * 1.6); }
.ph-fish img { position: absolute; left: 110%; width: 32%; filter: brightness(.6) saturate(.7); animation: swim-by linear infinite; }
@keyframes swim-by { to { left: -40%; } }
.ph-glow { position: absolute; inset: 0; opacity: calc(var(--deep) * 1.8 - .5); background: radial-gradient(4px 4px at 20% 30%, #7ff, transparent), radial-gradient(6px 6px at 70% 60%, #f7f, transparent), radial-gradient(3px 3px at 40% 80%, #7ff, transparent), radial-gradient(5px 5px at 80% 25%, #ffb, transparent), radial-gradient(3px 3px at 30% 55%, #f9f, transparent); animation: glow-drift 6s ease-in-out infinite alternate; }
@keyframes glow-drift { to { transform: translate(-8px, -14px); } }
.ph-snow { position: absolute; inset: 0; opacity: calc(var(--deep) * 1.2); background-image: radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,255,255,.7), transparent), radial-gradient(1px 1px at 60% 40%, rgba(255,255,255,.6), transparent), radial-gradient(1.5px 1.5px at 35% 75%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 85% 85%, rgba(255,255,255,.6), transparent); background-size: 100% 50%; animation: marine-snow 4s linear infinite; }
@keyframes marine-snow { to { background-position: 0 -100%; } }
.mg-dive { --deep: 0; }
.mg-dive .mg-area::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 46%, transparent 30%, rgba(0, 0, 8, calc(.3 + var(--deep) * .65)) 70%); }
.mg-dive.fast .porthole { animation: rattle .12s infinite; }
@keyframes rattle { 50% { transform: translate(calc(-50% + 2px), calc(-50% - 1px)); } }
.mg-dive.creak { animation: jolt .4s; }
.speed-meter { position: absolute; right: 18px; top: 14%; bottom: 14%; width: 22px; border-radius: 999px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.speed-zone { position: absolute; left: 0; right: 0; background: rgba(107, 227, 168, .55); }
.speed-needle { position: absolute; left: -4px; right: -4px; height: 6px; background: #fff; border-radius: 3px; }
.speed-needle.danger { background: var(--mine); }
.mg-dive .depth { position: absolute; left: 0; right: 0; bottom: 8px; top: auto; width: auto; display: block; text-align: center; font-family: var(--display); font-size: 22px; }
.hand-kiyogon { position: absolute; z-index: 3; right: 2%; top: 8%; height: 62%; filter: drop-shadow(0 0 30px rgba(120, 180, 255, .4)); }
.hand-target { position: absolute; z-index: 4; right: 30%; top: 30%; width: 90px; height: 90px; border-radius: 50%; border: 3px dashed rgba(255, 255, 255, .5); animation: blink 1.2s infinite; }
.hand-orb { position: absolute; z-index: 5; left: 50%; top: 88%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: radial-gradient(circle, #fff, #9fe6ff 50%, transparent 72%); box-shadow: 0 0 30px #9fe6ff; pointer-events: none; }
.hand-orb.touched { transform: scale(3); opacity: 0; transition: .6s; }
.hand-hint { position: absolute; left: 0; right: 0; bottom: 4%; text-align: center; color: var(--ink-dim); animation: blink 1.4s infinite; }
.trail-bubble { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid rgba(190, 230, 255, .8); background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .8), rgba(150, 210, 255, .15) 60%); pointer-events: none; animation: bubble-up 1.4s ease-out forwards; }
@keyframes bubble-up { to { transform: translateY(-80px) scale(1.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.reveal-kiyogon.wiggle { animation: tailwag 1s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes tailwag { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }

/* タイトル → 本編：差し出された手へ寄って、海へ沈む */
#title.diving .title-bg { animation: dive-in 1s cubic-bezier(.6, 0, .4, 1) forwards; }
#title.diving .title-inner { transition: opacity .25s; opacity: 0; }
#title.diving .title-bg { animation-delay: .35s; }
#title.diving::after { content: ''; position: absolute; inset: 0; z-index: 9; background: radial-gradient(circle at 70% 72%, rgba(120, 220, 255, .0), #04122a 70%); animation: sink-fade 1s ease-in .4s both; }
@keyframes dive-in { to { transform: scale(2.4); transform-origin: 72% 74%; filter: blur(2px) brightness(.7); } }
@keyframes sink-fade { from { opacity: 0; } to { opacity: 1; } }


.quiz-kiyogon { position: absolute; right: -8%; bottom: -4%; height: 52%; opacity: .95; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); pointer-events: none; }
.swipe-kiyogon { position: absolute; left: 50%; bottom: -18%; height: 46%; transform: translateX(-50%); filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); pointer-events: none; }

/* ---------- 投資家プレゼン ---------- */

/* ---------- 海底居酒屋の接客 ---------- */
.mg-service .mg-area { background: radial-gradient(70% 45% at 50% 40%, rgba(255, 176, 74, .22), transparent); }
.service-counter { position: absolute; left: 10px; right: 10px; top: 52px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; z-index: 2; }
.seat { position: relative; height: 230px; border-radius: 18px; background: rgba(4, 14, 32, .45); border: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 10px; touch-action: none; user-select: none; -webkit-user-select: none; }
.seat > * { opacity: 0; transition: opacity .2s; pointer-events: none; }
.seat.in > *, .seat.pouring > * { opacity: 1; }
.seat.in { animation: card-in .35s var(--spring); }
.seat-order { position: absolute; top: 8px; width: 40px; height: 40px; padding: 6px; border-radius: 50%; border: 1.5px solid currentColor; color: #ffe48a; background: rgba(4, 14, 32, .6); }
.seat-order svg { width: 100%; height: 100%; display: block; }
.seat.yaki .seat-order { color: #ffb0a6; }
.service-hint .ico { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; }
.service-hint .ico.beer { color: #ffe48a; } .service-hint .ico.yaki { color: #ffb0a6; }
.seat.yaki .seat-order { animation: tailwag 1s ease-in-out infinite; }
.seat-fish { width: 88%; margin-bottom: auto; margin-top: 48px; transform: scaleX(-1); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.seat-glass { position: relative; width: 42px; height: 58px; border: 2px solid rgba(255, 255, 255, .75); border-top: none; border-radius: 0 0 10px 10px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.seat.yaki .seat-glass { display: none; }
.seat-beer { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, #fffbe8 0 8px, #ffcf4a 8px, #e89c1a); }
.seat-mark { position: absolute; left: -4px; right: -4px; bottom: 82%; height: 0; border-top: 2px dashed #7fe3ff; }
.seat-patience { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 4px; border-radius: 4px; background: var(--ok); }
.seat.pouring { box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(255, 211, 107, .5); }
.seat.happy { animation: rise-in .5s var(--ease-out) reverse; }
.seat.sad { animation: jolt .4s; background: rgba(255, 90, 78, .2); }
.service-kiyogon { position: absolute; right: -6%; bottom: -6%; height: 40%; z-index: 1; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); pointer-events: none; }
.service-shout { position: absolute; right: 18%; bottom: 33%; z-index: 3; padding: 6px 12px; border-radius: 14px; background: #fff; color: #1e2340; font-size: 13px; font-weight: 900; opacity: 0; pointer-events: none; }
.service-shout.show { animation: shout-pop 1.2s ease-out forwards; }
@keyframes shout-pop { 0% { opacity: 0; transform: scale(.6); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.service-hint { flex: 1; margin: 0; padding: 14px; border-radius: 16px; background: rgba(4, 14, 32, .5); font-size: 13px; line-height: 1.6; text-align: center; color: var(--ink-dim); }

/* 会話の間と、控えめなHUD */
.kiyogon.freeze { animation: none; }
.kiyogon.dip { animation: dip .6s var(--ease-out), breathe 3.6s ease-in-out .6s infinite; }
@keyframes dip { 0% { transform: translateX(-50%) translateY(0); } 40% { transform: translateX(-50%) translateY(2.5%) rotate(-1deg); } 100% { transform: translateX(-50%) translateY(0); } }
.status { opacity: .45; transition: opacity .4s; }
.status.lit, .status.danger { opacity: 1; }
.status.lit { box-shadow: 0 0 0 1px rgba(255, 211, 107, .5), 0 0 18px rgba(255, 211, 107, .35); }
.kakunin { position: absolute; right: 10px; top: 8px; padding: 2px 8px; border: 3px solid #d2342a; border-radius: 50%; color: #d2342a; font-family: var(--display); font-size: 15px; transform: rotate(-14deg); animation: stamp-in .2s ease-out; }
@keyframes stamp-in { from { transform: rotate(-14deg) scale(2.2); opacity: 0; } }
/* 一本釣り：釣り上げた瞬間の水しぶき */
.splash-burst { position: absolute; left: 50%; z-index: 4; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; box-shadow: -40px -10px 0 6px #e9fbff, 40px -14px 0 5px #e9fbff, -20px -40px 0 4px #fff, 22px -46px 0 7px #e9fbff, 0 -64px 0 5px #fff, -60px -30px 0 3px #fff, 62px -34px 0 4px #fff; animation: foam-burst .8s ease-out forwards; pointer-events: none; }
/* 手を取る：自分の腕の輪郭 */
.hand-arm { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; opacity: 0; overflow: visible; transition: opacity .15s; }
.arm-outer { fill: none; stroke: rgba(127, 227, 255, .9); stroke-width: 34; stroke-linecap: round; }
.arm-inner { fill: none; stroke: #01060f; stroke-width: 30; stroke-linecap: round; }
.arm-dot { fill: none; stroke: rgba(127, 227, 255, .8); stroke-width: 1.2; }
.hand-arm.touched { opacity: 1 !important; filter: drop-shadow(0 0 12px rgba(127, 227, 255, .9)); transition: opacity .3s, filter .3s; }

/* 結末の3段階（①絵 ②議事録 ③記録とアルバム） */
#ending[data-stage="1"] { overflow: hidden; }
#ending[data-stage="1"] .end-body { display: none; }
#ending[data-stage="2"] .end-hero, #ending[data-stage="3"] .end-hero { display: none; }
#ending[data-stage="2"] { background: radial-gradient(90% 60% at 50% 40%, #2a1d10, #0b0718 70%); }
#ending[data-stage="2"] .end-body { min-height: 100%; justify-content: center; padding-top: max(24px, env(safe-area-inset-top)); }
#ending[data-stage="2"] .end-body > :not(.notebook-card) { display: none; }
#ending[data-stage="2"] .notebook-card { opacity: 1; padding: 22px 20px 16px; transform: rotate(-1deg); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); animation: nb-in .6s var(--spring) both; }
#ending[data-stage="2"] .end-minutes { font-size: 17px; line-height: 34px; background-image: repeating-linear-gradient(180deg, transparent 0 33px, rgba(70, 110, 170, .25) 33px 34px); }
#ending[data-stage="3"] .notebook-card { display: none; }
#ending[data-stage="3"] .end-body { padding-top: max(24px, env(safe-area-inset-top)); }
.end-tap { display: none; margin: 14px 0 0; font-family: var(--font); font-size: 12px; letter-spacing: .2em; color: #8a6a4a; text-align: center; }
#ending[data-stage="2"] .end-tap { display: block; animation: blink 1.6s 1s infinite both; }

/* 結末②：画面いっぱいの紙のノート（黒丸なし、行ごとに少し傾く、コーヒーの染み） */
#ending[data-stage="2"] { background: #e9dcc0; }
#ending[data-stage="2"] .end-body { padding: 0; gap: 0; }
#ending[data-stage="2"] .notebook-card { flex: 1; min-height: 100dvh; margin: 0; padding: max(56px, env(safe-area-inset-top)) 26px 40px 58px; border-radius: 0; transform: none; box-shadow: inset 10px 0 0 #c9a77a, inset 14px 0 18px -8px rgba(0, 0, 0, .25);
  background-color: #f3e7cc;
  background-image:
    radial-gradient(closest-side, rgba(150, 95, 40, .18), rgba(150, 95, 40, .1) 70%, transparent 72%),
    radial-gradient(closest-side, transparent 80%, rgba(150, 95, 40, .22) 84%, transparent 90%),
    linear-gradient(90deg, transparent 44px, rgba(220, 80, 80, .5) 44px, rgba(220, 80, 80, .5) 46px, transparent 46px),
    repeating-linear-gradient(180deg, transparent 0 39px, rgba(70, 110, 170, .22) 39px 40px),
    radial-gradient(120% 80% at 50% 50%, transparent 60%, rgba(120, 80, 30, .2));
  background-size: 150px 150px, 170px 170px, auto, auto, auto;
  background-position: 88% 82%, 84% 79%, 0 0, 0 52px, 0 0;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, no-repeat; }
#ending[data-stage="2"] .notebook-card h3 { margin: 0 0 18px; font-family: var(--hand); font-size: 22px; font-weight: 600; letter-spacing: .06em; color: #3a2a1e; transform: rotate(-1.5deg); }
#ending[data-stage="2"] .end-minutes { padding: 0; list-style: none; font-size: 18px; line-height: 40px; background: none; }
#ending[data-stage="2"] .end-minutes li { transform-origin: left; opacity: 0; animation: write-in .5s ease-out forwards; }
#ending[data-stage="2"] .end-minutes li:nth-child(3n+1) { transform: rotate(-.8deg); }
#ending[data-stage="2"] .end-minutes li:nth-child(3n+2) { transform: rotate(.6deg) translateX(3px); }
#ending[data-stage="2"] .end-minutes li:nth-child(3n) { transform: rotate(-.3deg) translateX(-2px); }
#ending[data-stage="2"] .end-minutes li.hot { font-size: 21px; }
#ending[data-stage="2"] .end-minutes li:nth-child(1) { animation-delay: .3s; } #ending[data-stage="2"] .end-minutes li:nth-child(2) { animation-delay: .6s; } #ending[data-stage="2"] .end-minutes li:nth-child(3) { animation-delay: .9s; } #ending[data-stage="2"] .end-minutes li:nth-child(4) { animation-delay: 1.2s; } #ending[data-stage="2"] .end-minutes li:nth-child(5) { animation-delay: 1.5s; } #ending[data-stage="2"] .end-minutes li:nth-child(n+6) { animation-delay: 1.8s; }
@keyframes write-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
#ending[data-stage="2"] .end-tap { position: absolute; left: 0; right: 0; bottom: max(24px, env(safe-area-inset-bottom)); }
#ending[data-stage="2"] .notebook-card { position: relative; }
/* プレゼン：スライドを大きく、うさんくささは右端の縦メーター */
.ai-name.worried { color: #ffb0a6; animation: jolt .35s; }
/* 決闘：本物の暴れの前は糸が震える。ふりのときは、きよごんだけが大げさに揺れる */
.line.quiver { animation: line-quiver .07s linear infinite; }
.line.quiver line { stroke: #fff; stroke-width: 3; }
@keyframes line-quiver { 0% { transform: translateX(-2px); } 50% { transform: translateX(2px); } 100% { transform: translateX(-2px); } }
.fish-kiyogon.bluff, #fishKiyogon.bluff { animation: bluff .22s ease-in-out infinite; }
@keyframes bluff { 0%, 100% { rotate: -8deg; } 50% { rotate: 8deg; } }
/* 接客の手応え */
.seat-mark { border-top-width: 3px !important; border-top-style: solid !important; border-color: rgba(127, 227, 255, .9) !important; }
.seat-glass.near { border-color: #ffe48a; box-shadow: 0 0 16px rgba(255, 228, 138, .8); }
.seat-glass.near .seat-mark { border-color: #ffe48a !important; }
.seat-glass.serve { transition: transform .4s var(--ease-out), opacity .4s; transform: translateY(-120px) scale(.7); opacity: 0; }
.seat-fish.hop { animation: fish-hop .4s var(--spring); }
@keyframes fish-hop { 50% { transform: scaleX(-1) translateY(-18px) rotate(-8deg); } }
.mg-service .mg-timer b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--gold); }
.mg-service.rush .mg-area { box-shadow: inset 0 0 60px rgba(255, 120, 80, .35); }
.service-hint { font-size: 14px; }
/* 結末①：タイトルと同じ光の粒が、下から上ってきて消える（余韻） */
.end-glow { position: absolute; left: 50%; bottom: -30px; z-index: 1; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255, 220, 230, .8) 40%, transparent 70%); box-shadow: 0 0 30px 10px rgba(255, 190, 210, .6); animation: end-glow 2.6s cubic-bezier(.3, 0, .2, 1) .2s both; pointer-events: none; }
@keyframes end-glow { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 80% { opacity: .9; transform: translateY(-46vh) scale(1.1); } 100% { opacity: 0; transform: translateY(-52vh) scale(2.6); } }
.end-credit { font-size: 11px; }
.end-tap { font-size: 13px; }

/* ---------- 派手な反応の層（fx.js） ---------- */
#fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
#fxLayer { position: absolute; inset: 0; z-index: 41; pointer-events: none; overflow: hidden; }
.fx-flash { position: absolute; inset: 0; mix-blend-mode: screen; }
.fx-lines { position: absolute; inset: -20%; background: repeating-conic-gradient(from 0deg at 50% 45%, transparent 0 4deg, var(--c) 4deg 5deg, transparent 5deg 11deg); -webkit-mask-image: radial-gradient(circle at 50% 45%, transparent 28%, #000 70%); mask-image: radial-gradient(circle at 50% 45%, transparent 28%, #000 70%); }
.fx-slam { position: absolute; left: 50%; transform: translate(-50%, -50%) rotate(-3deg); width: max-content; max-width: 96%; text-align: center; font-family: var(--display); line-height: 1.1; -webkit-text-stroke: 2px rgba(20, 8, 30, .85); paint-order: stroke fill; filter: drop-shadow(0 6px 0 rgba(20, 8, 30, .7)) drop-shadow(0 0 26px currentColor); }
.fx-slam b { display: block; font-weight: 400; font-size: clamp(40px, 13vw, 58px); letter-spacing: .04em; }
.fx-slam small { display: block; margin-top: 4px; font-size: 18px; color: #fff; -webkit-text-stroke: 1px rgba(20, 8, 30, .85); }
.fx-float { position: absolute; font-family: var(--display); font-size: 22px; -webkit-text-stroke: 1px rgba(20, 8, 30, .8); paint-order: stroke fill; white-space: nowrap; }
.fx-combo { position: absolute; right: 10px; top: 132px; display: flex; flex-direction: column; align-items: flex-end; font-family: var(--display); color: var(--c, #fff); opacity: 0; transition: opacity .2s; -webkit-text-stroke: 1.5px rgba(20, 8, 30, .85); paint-order: stroke fill; filter: drop-shadow(0 3px 0 rgba(20, 8, 30, .6)) drop-shadow(0 0 14px var(--c, #fff)); transform: rotate(4deg); }
.fx-combo.show { opacity: 1; }
.fx-combo b { font-weight: 400; font-size: 46px; line-height: .9; }
.fx-combo span { font-size: 12px; letter-spacing: .2em; }
.fx-combo i { font-style: normal; font-size: 13px; color: #fff; margin-top: 2px; }
/* コンボが育つと、画面のふちが光って脈打つ */
#app[data-heat]::after { content: ""; position: absolute; inset: 0; z-index: 39; pointer-events: none; }
#app[data-heat="1"]::after { box-shadow: inset 0 0 40px rgba(255, 211, 107, .45); }
#app[data-heat="2"]::after { box-shadow: inset 0 0 60px rgba(127, 227, 255, .6); animation: heat-pulse .6s ease-in-out infinite; }
#app[data-heat="3"]::after { box-shadow: inset 0 0 80px rgba(201, 160, 255, .7); animation: heat-pulse .45s ease-in-out infinite; }
#app[data-heat="4"]::after { box-shadow: inset 0 0 110px rgba(255, 111, 145, .8); animation: heat-pulse .3s ease-in-out infinite; }
@keyframes heat-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { #app[data-heat]::after { animation: none; } }

/* ---------- 投資家プレゼン（作り直し） ---------- */
.pitch-ledger { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 4px 16px 8px; font-size: 11px; color: var(--ink-dim); letter-spacing: .08em; }
.pitch-ledger b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--gold); }
.pitch-ledger em { margin-left: 10px; font-style: normal; letter-spacing: .3em; color: var(--ink); }
.pitch-slide { position: relative; margin: 0 14px; padding: 12px 14px 16px 18px; border-radius: 10px; background: #fbfaf6; color: #1d2433; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7), inset 0 -6px 0 #e8e2d4; overflow: hidden; }
.pitch-slide::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(180deg, var(--coral), var(--gold)); }
.pitch-slide.in { animation: card-in .35s var(--spring); }
.pitch-slide.busted { animation: jolt .4s; }
.pitch-slide.busted::after { content: "見送り"; position: absolute; right: 14px; top: 40%; padding: 6px 16px; border: 5px double var(--mine); border-radius: 10px; color: var(--mine); font-family: var(--display); font-size: 34px; transform: rotate(-14deg); background: rgba(255, 252, 246, .92); animation: stamp-in .2s ease-out; }
.pitch-page { font-size: 10px; letter-spacing: .2em; color: #8a8f9c; }
.pitch-title { margin-top: 2px; font-size: 18px; font-weight: 900; line-height: 1.35; }
.pitch-market { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 4px; background: #eef2ff; font-size: 12px; font-weight: 900; color: #2f5fd0; transition: font-size .15s; }
.pitch-market.lv3, .pitch-market.lv4 { font-size: 15px; color: #c47a00; background: #fff3d6; }
.pitch-market.lv5 { font-size: 18px; color: var(--mine); background: #ffe3de; animation: blink .5s infinite; }
.pitch-chart { display: block; width: 100%; height: 74px; margin-top: 6px; overflow: visible; }
.pitch-chart rect { fill: #8fb6ff; transition: y .2s, height .2s; }
.pitch-chart polyline { fill: none; stroke: #2f5fd0; stroke-width: 1.6; stroke-linejoin: round; }
.pitch-chart.wild rect { fill: #ffb36b; } .pitch-chart.wild polyline { stroke: var(--mine); stroke-width: 2.4; }
.pitch-chart .arrow { fill: var(--mine); }
.pitch-words { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; margin-top: 8px; }
.pitch-word { padding: 3px 9px; border-radius: 6px; background: #1d2433; color: #ffe48a; font-size: 13px; font-weight: 900; animation: burst-in .3s var(--spring); }
.pitch-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #e8e2d4; }
.pitch-timer i { display: block; height: 100%; width: 100%; background: #2f5fd0; }
.pitch-est { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 10px 0 0; font-size: 13px; font-weight: 900; color: var(--ink-dim); }
.pitch-est b { font-family: var(--display); font-weight: 400; font-size: 58px; line-height: 1; color: var(--gold); text-shadow: 0 4px 0 #7a4a00, 0 0 24px rgba(255, 211, 107, .5); }
.pitch-est b.zero { color: var(--mine); text-shadow: 0 4px 0 #6a1010; }
.pitch-risk { position: absolute; left: 14px; right: 14px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: rgba(4, 14, 32, .6); border: 1px solid rgba(255, 255, 255, .12); }
.pitch-face { font-size: 13px; font-weight: 900; }
.pitch-meter { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.pitch-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8fd3ff, #ffb36b 60%, var(--mine)); background-size: 300px 100%; transition: width .2s var(--ease-out); }
.pitch-risk[data-lv="2"] { border-color: #ffb36b; } .pitch-risk[data-lv="2"] .pitch-face { color: #ffb36b; }
.pitch-risk[data-lv="3"] { border-color: var(--mine); animation: jolt .4s; } .pitch-risk[data-lv="3"] .pitch-face { color: #ff8a7a; }
.pitch-kiyogon { position: absolute; right: -4%; bottom: 74px; height: 22%; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); pointer-events: none; }
.pitch-quip { position: absolute; right: 26%; bottom: 120px; max-width: 60%; padding: 6px 10px; border-radius: 12px; background: #fff; color: #1e2340; font-size: 12px; font-weight: 900; opacity: 0; pointer-events: none; }
.pitch-quip.show { animation: shout-pop 2s ease-out forwards; }
.mg-btn.bank { --tint: 157, 255, 176; font-family: var(--font); font-weight: 900; font-size: 17px; letter-spacing: .04em; }
.mg-btn.bank b { font-family: var(--display); font-weight: 400; font-size: 1.3em; }

/* ---------- 一本釣り：糸を主役に ---------- */
.line { overflow: visible; z-index: 1; }
.line path { fill: none; stroke-linecap: round; transition: stroke .15s; }
#lineEl { stroke: #f4faff; stroke-width: var(--lw, 3px); }
.line-glow { stroke: rgba(127, 227, 255, .35); stroke-width: calc(var(--lw, 3px) * 3); filter: blur(3px); }
.line[data-t="good"] #lineEl { stroke: #9dffb0; } .line[data-t="good"] .line-glow { stroke: rgba(157, 255, 176, .35); }
.line[data-t="danger"] #lineEl { stroke: var(--mine); } .line[data-t="danger"] .line-glow { stroke: rgba(255, 90, 78, .55); }
.line.quiver { animation: line-quiver .06s linear infinite; }
.line-tag { position: absolute; z-index: 3; transform: translate(12px, -50%); padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 900; white-space: nowrap; background: rgba(4, 14, 32, .75); border: 2px solid currentColor; pointer-events: none; transition: color .15s; }
.line-tag[data-t="slack"] { color: #9fd6ff; } .line-tag[data-t="good"] { color: #9dffb0; }
.line-tag[data-t="danger"] { color: #ff8a7a; font-size: 15px; animation: jolt .3s infinite; }
.to-surface { position: absolute; left: 50%; z-index: 3; transform: translateX(-50%); padding: 3px 10px; border-radius: 999px; background: rgba(4, 14, 32, .6); font-size: 12px; font-weight: 900; color: var(--gold); white-space: nowrap; pointer-events: none; }
.reel { box-shadow: none !important; text-shadow: none !important; border-color: rgba(255, 211, 107, .55) !important; }
.reel.down { box-shadow: 0 0 24px rgba(255, 211, 107, .8) !important; }

/* 通知消火：炎上と本人を、形・色・顔で瞬時に見分ける */
.notif { width: 72%; padding: 12px 14px; }
.notif.fire { background: linear-gradient(135deg, #ff5a1f, #c8102e); color: #fff; border: none; border-radius: 6px 18px 6px 18px; box-shadow: 0 0 0 2px #ffb36b, 0 0 22px rgba(255, 90, 31, .8); }
.notif.fire .notif-icon { width: 38px; height: 38px; border-radius: 50%; background: #fff3c4; font-size: 22px; }
.notif.fire .notif-body b { color: #ffe48a; opacity: 1; }
.notif.fire::after { content: "消せ"; position: absolute; right: -8px; top: -10px; padding: 2px 7px; border-radius: 999px; background: #fff; color: #c8102e; font-size: 11px; font-weight: 900; transform: rotate(8deg); }
.notif.dm { background: #eaf6ff; color: #0b3b66; border: 3px solid #7fe3ff; border-radius: 22px 22px 22px 6px; box-shadow: 0 0 18px rgba(127, 227, 255, .6); }
.notif.dm .notif-icon { width: 44px; height: 44px; border-radius: 50%; background: #ffd9c2; box-shadow: 0 0 0 3px #fff; }
.notif.dm .notif-body b { color: #2f8fe0; opacity: 1; }
.notif.dm::after { content: "♥ 残す"; position: absolute; right: -8px; top: -10px; padding: 2px 7px; border-radius: 999px; background: #ff6f91; color: #fff; font-size: 11px; font-weight: 900; transform: rotate(8deg); }
/* コンボの数は右上に小さく。中央の大文字は12コンボのときだけ */
.fx-combo { top: 132px; transform: rotate(4deg) scale(.8); transform-origin: right top; }
.fx-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 45%, color-mix(in srgb, var(--c) 55%, transparent) 80%, var(--c)); }

/* ---------- 海底居酒屋（作り直し）：上に客、下にカウンター、横に焼き台 ---------- */
.mg-service .mg-area { background: linear-gradient(180deg, rgba(20, 40, 70, .2), rgba(60, 30, 10, .35)), radial-gradient(70% 40% at 50% 30%, rgba(255, 176, 74, .25), transparent); }
.service-counter { top: 48px; bottom: 34%; gap: 6px; }
.seat { height: auto; background: none; border: none; justify-content: flex-start; padding: 0; }
.seat-order { position: relative; top: 0; margin-bottom: 4px; z-index: 2; }
.seat-fish { width: 96%; margin: 6px 0 0; transform: scaleX(-1); filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) saturate(1.6) contrast(1.1) drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); }
.seat-stool { width: 46%; height: 34px; margin-top: 2px; border-radius: 50% 50% 6px 6px / 30% 30% 6px 6px; background: linear-gradient(180deg, #c0392b, #7b1d14); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .25); opacity: 1 !important; }
.seat-patience { position: relative; left: auto; right: auto; bottom: auto; width: 70%; margin-top: 6px; }
.seat-glass { position: absolute; left: 50%; bottom: calc(-34% - 6px); transform: translateX(-50%); width: 48px; height: 66px; border-width: 3px; z-index: 3; }
.seat-stream { position: absolute; left: 50%; bottom: -10px; width: 8px; height: 90px; margin-left: -4px; border-radius: 4px; background: linear-gradient(180deg, rgba(255, 228, 138, 0), #ffcf4a 30%, #ffe48a); opacity: 0 !important; z-index: 4; }
.seat.pouring .seat-stream { opacity: 1 !important; animation: stream .15s linear infinite; }
@keyframes stream { 50% { transform: scaleX(.7); } }
.seat.pouring { box-shadow: none; }
.seat.pouring .seat-glass { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255, 211, 107, .7); }
.service-countertop { position: absolute; left: -4%; right: -4%; bottom: 0; height: 36%; z-index: 1; background: linear-gradient(180deg, #a8743f, #6b3e1a 18%, #4a2a12); border-top: 8px solid #c8915a; box-shadow: 0 -12px 30px rgba(0, 0, 0, .45), inset 0 14px 20px rgba(255, 200, 120, .15); }
.service-grill { position: absolute; left: 8px; bottom: 12px; z-index: 2; width: 96px; height: 54px; border-radius: 8px; background: linear-gradient(180deg, #333, #111); box-shadow: 0 0 0 3px #555, 0 -8px 26px rgba(255, 120, 40, .6); }
.service-grill .coal { position: absolute; inset: 8px; border-radius: 4px; background: radial-gradient(circle at 30% 60%, #ff6a1f, transparent 40%), radial-gradient(circle at 70% 40%, #ffb36b, transparent 40%), #3a0a00; animation: blink 1.2s infinite; }
.service-grill i { position: absolute; top: -8px; width: 4px; height: 70px; background: #e8d2a6; transform: rotate(80deg); z-index: 1; }
.service-grill i:nth-child(1) { left: 20px; top: 4px; } .service-grill i:nth-child(2) { left: 46px; top: 12px; } .service-grill i:nth-child(3) { left: 72px; top: 20px; }
.service-kiyogon { left: 2px; right: auto; bottom: 52px; height: 24%; z-index: 2; }
.service-shout { left: 30%; right: auto; bottom: 22%; z-index: 5; }
.flying-skewer { position: absolute; z-index: 6; width: 34px; height: 34px; color: #ffb0a6; filter: drop-shadow(0 0 8px #ff6a1f); pointer-events: none; }
.service-counter { top: 64px; bottom: 36%; }
.seat { justify-content: flex-end; }
.seat-fish { width: 100%; height: 74px; object-fit: contain; margin: 0; }
.seat-order { margin-bottom: auto; }
.seat-stool { height: 26px; margin-top: 0; }
.seat-patience { margin: 6px 0 4px; }
.seat-glass { bottom: -86px; }
.service-kiyogon { left: -2px; bottom: 6px; height: 21%; z-index: 3; }
.service-grill { left: 104px; bottom: 22px; width: 84px; height: 46px; }
.seat-order { margin-bottom: 2px; }
.service-grill i { top: auto !important; bottom: 14px; height: 4px; width: 64px; left: 10px !important; transform: rotate(-4deg); background: #e8d2a6; }
.service-grill i:nth-child(2) { bottom: 24px; } .service-grill i:nth-child(3) { bottom: 34px; }
.end-minutes li.sec { list-style: none; margin: 14px 0 2px -18px; font-family: var(--font); font-size: 12px; font-weight: 900; letter-spacing: .2em; color: #8a6a4a; transform: none !important; }
.end-minutes li.sec:first-child { margin-top: 0; }
.end-minutes li.sign { list-style: none; margin: 16px 0 0 -18px; text-align: right; font-size: 14px; line-height: 1.6; color: #3a2a1e; transform: rotate(-1.5deg) !important; }
.album-slot.locked { cursor: pointer; font: inherit; color: var(--ink-faint); }
.fx-float.hint { max-width: 70vw; white-space: normal; text-align: center; font-family: var(--font); font-weight: 900; font-size: 14px; -webkit-text-stroke: 0; padding: 6px 10px; border-radius: 10px; background: rgba(4, 14, 32, .85); }
/* 仕上げ：署名は別の行に右寄せ、失敗後の盛れは押せない見た目、ジョッキと焼き台に厚み */
.end-minutes li.sign span { display: inline-block; margin-top: 2px; font-size: 16px; white-space: nowrap; }
.mg-btn.off { opacity: .35; filter: grayscale(1); pointer-events: none; }
.seat-glass { border-color: rgba(255, 255, 255, .9); box-shadow: 0 6px 10px rgba(0, 0, 0, .35); }
.service-grill { background: linear-gradient(180deg, #4a4a4a, #1a1a1a 60%, #0a0a0a); box-shadow: 0 0 0 3px #666, inset 0 2px 0 rgba(255, 255, 255, .2), 0 -10px 30px rgba(255, 120, 40, .7), 0 8px 14px rgba(0, 0, 0, .5); }
