:root {
  /* IBM Plex Mono sparingly. Interaction is based on bubble expansion wipes. */
  --midnight: #071A2F;
  --moon-blue: #1E7C9A;
  --glass-cyan: #8BE9F4;
  --jelly-blush: #FF9FCA;
  --pearl: #FFF6E8;
  --lavender: #8C6FE8;
  --seaweed: #123D3A;
  --starfruit: #FFE66D;
  --word: "Yomogi", "Comic Sans MS", "Apple Chancery", cursive;
  --round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Avenir Next Rounded", system-ui, sans-serif;
  --drama: "Fraunces", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }

body {
  font-family: var(--round);
  color: var(--pearl);
  background:
    radial-gradient(circle at 50% 115%, rgba(139, 233, 244, .24), transparent 34%),
    linear-gradient(145deg, var(--midnight), #0a2542 47%, var(--moon-blue));
  cursor: none;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -12vmax;
  pointer-events: none;
  z-index: 2;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255, 246, 232, .2) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(139, 233, 244, .15) 0 1.5px, transparent 2.5px);
  background-size: 44px 44px, 72px 72px;
  animation: planktonDrift 22s linear infinite;
  mix-blend-mode: screen;
}

body::after {
  background: repeating-linear-gradient(100deg, transparent 0 42px, rgba(139, 233, 244, .035) 46px, transparent 58px);
  filter: blur(1px);
  animation: shimmerBands 11s ease-in-out infinite alternate;
}

button { font: inherit; color: inherit; cursor: none; }

.aquarium {
  display: flex;
  width: 500vw;
  height: 100vh;
  transform: translate3d(0,0,0);
  transition: transform 1200ms cubic-bezier(.22, .86, .19, 1);
}

.tank {
  position: relative;
  width: 100vw;
  height: 100vh;
  flex: 0 0 100vw;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 22% 20%, color-mix(in srgb, var(--glow) 32%, transparent), transparent 27%),
    radial-gradient(circle at 78% 72%, color-mix(in srgb, var(--temp) 24%, transparent), transparent 30%),
    linear-gradient(155deg, var(--midnight), var(--tide));
}

.tank::before {
  content: "";
  position: absolute;
  inset: 3.2vh 4vw;
  border: 1px solid rgba(255, 246, 232, .22);
  border-radius: 42px;
  box-shadow: inset 0 0 35px rgba(139, 233, 244, .12), 0 0 40px rgba(140, 111, 232, .14);
  z-index: -1;
}

.tank::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 28%, rgba(7, 26, 47, .2) 70%);
  pointer-events: none;
}

.chapter-charms {
  position: fixed;
  z-index: 20;
  right: 1.8rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: .8rem;
}

.charm {
  width: 4.4rem;
  height: 3.4rem;
  border: 1px solid rgba(255, 246, 232, .42);
  border-radius: 58% 42% 56% 44% / 48% 55% 45% 52%;
  background: linear-gradient(140deg, rgba(255,246,232,.28), rgba(139,233,244,.12), rgba(255,159,202,.2));
  box-shadow: inset 0 -10px 18px rgba(7,26,47,.18), 0 0 18px rgba(139,233,244,.16);
  transform: rotate(-8deg);
  transition: transform .45s ease, box-shadow .45s ease, background .45s ease;
}

.charm:nth-child(even) { transform: rotate(8deg) translateX(-.25rem); }
.charm span { display: block; font-family: var(--mono); font-size: .54rem; letter-spacing: .08em; text-transform: uppercase; }
.charm.active, .charm:hover { transform: rotate(0) scale(1.12); background: linear-gradient(140deg, var(--pearl), rgba(255,159,202,.55)); box-shadow: 0 0 26px rgba(255,159,202,.55); color: var(--midnight); }

.save-strip {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  z-index: 24;
  padding: .55rem 1.2rem;
  border: 1px solid rgba(139, 233, 244, .35);
  border-radius: 999px;
  background: rgba(7, 26, 47, .55);
  box-shadow: 0 0 28px rgba(139, 233, 244, .18), inset 0 0 18px rgba(255,246,232,.08);
  color: var(--glass-cyan);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  animation: saveFlicker 4.8s steps(2, end) infinite;
}

.giant-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(62vw, 680px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .6rem;
  text-align: center;
  background:
    radial-gradient(circle at 34% 23%, rgba(255,255,255,.62), transparent 5%),
    radial-gradient(circle at 66% 78%, rgba(255,159,202,.28), transparent 16%),
    linear-gradient(135deg, rgba(255,246,232,.2), rgba(139,233,244,.1) 44%, rgba(140,111,232,.16));
  border: 2px solid rgba(255,246,232,.38);
  box-shadow: inset 0 0 70px rgba(139,233,244,.24), 0 0 95px rgba(139,233,244,.28), 0 0 40px rgba(255,159,202,.2);
  animation: bubbleBreath 4.2s ease-in-out infinite;
}

.giant-bubble h1 {
  margin: 0;
  font-family: var(--word);
  font-size: clamp(4.8rem, 12vw, 10.5rem);
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--pearl);
  text-shadow: 0 0 20px rgba(139,233,244,.75), 0 0 50px rgba(255,159,202,.36);
}

.bubble-sheen { position: absolute; inset: 11%; border-top: 2px solid rgba(255,255,255,.4); border-radius: 50%; transform: rotate(-28deg); }
.bubble-caption { margin: 0; width: 70%; color: rgba(255,246,232,.82); font-size: clamp(1rem, 2vw, 1.4rem); }
.tiny-system, .chapter-name { margin: 0; font-family: var(--mono); color: var(--starfruit); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }

.moon-window { position: absolute; right: 12vw; top: 12vh; width: 25vw; height: 34vh; border-radius: 28px; border: 1px solid rgba(139,233,244,.28); background: linear-gradient(90deg, transparent 49%, rgba(255,246,232,.18) 50% 51%, transparent 52%), linear-gradient(0deg, transparent 49%, rgba(255,246,232,.12) 50% 51%, transparent 52%), rgba(139,233,244,.06); box-shadow: 0 0 45px rgba(139,233,244,.14); transform: rotate(7deg); }

.jellyfish { position: absolute; width: 120px; height: 150px; border-radius: 50% 50% 34% 34%; background: radial-gradient(circle at 45% 28%, rgba(255,246,232,.68), rgba(255,159,202,.3) 44%, rgba(139,233,244,.1) 72%); border: 1px solid rgba(255,246,232,.25); box-shadow: 0 0 34px color-mix(in srgb, var(--glow) 55%, transparent); animation: jellyBob 6s ease-in-out infinite; }
.jellyfish i { position: relative; top: 128px; display: inline-block; width: 16px; height: 80px; margin-left: 10px; border-left: 2px solid rgba(255,159,202,.55); border-radius: 50%; animation: tentacle 2.8s ease-in-out infinite alternate; }
.lamp-one { left: 12vw; top: 13vh; }
.lamp-two { right: 18vw; bottom: 13vh; animation-delay: -2s; }

.note { position: absolute; padding: 1rem 1.2rem; border-radius: 22px 24px 18px 28px; background: rgba(255,246,232,.13); border: 1px solid rgba(255,246,232,.24); font-family: var(--word); font-size: 1.5rem; color: var(--pearl); transform: rotate(-11deg); box-shadow: 0 0 22px rgba(255,159,202,.2); }
.note-a { left: 14vw; bottom: 18vh; animation: floatNote 8s ease-in-out infinite; }
.current-label { position: absolute; left: 7vw; top: 8vh; font-family: var(--drama); font-style: italic; color: var(--jelly-blush); font-size: clamp(1.1rem, 2.4vw, 2rem); }

.petal, .petal::before, .petal::after { position: absolute; width: 18px; height: 28px; border-radius: 80% 10% 80% 10%; background: rgba(255,159,202,.72); filter: drop-shadow(0 0 9px rgba(255,159,202,.5)); }
.petal-a { left: 72vw; top: 62vh; animation: petalDrift 10s linear infinite; }
.petal::before { content: ""; left: 46px; top: -80px; transform: rotate(44deg); opacity: .6; }
.petal::after { content: ""; left: -70px; top: -35px; transform: rotate(-28deg); opacity: .5; }

.glass-pane {
  position: absolute;
  width: min(42vw, 580px);
  padding: clamp(1.5rem, 3.4vw, 3.5rem);
  border-radius: 34px;
  border: 1px solid rgba(255,246,232,.32);
  background: linear-gradient(135deg, rgba(255,246,232,.18), rgba(139,233,244,.08) 45%, rgba(140,111,232,.13));
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 35px rgba(255,246,232,.06), 0 0 46px color-mix(in srgb, var(--glow) 25%, transparent);
}
.glass-pane h2, .confession-card h2 { margin: .3rem 0 1rem; font-family: var(--word); font-weight: 400; font-size: clamp(2.8rem, 6vw, 6.5rem); line-height: .88; color: var(--pearl); text-shadow: 0 0 18px color-mix(in srgb, var(--glow) 65%, transparent); }
.glass-pane p:not(.chapter-name) { font-size: clamp(1rem, 1.5vw, 1.32rem); line-height: 1.75; color: rgba(255,246,232,.86); }
.tilted { transform: rotate(-4deg); }
.left-pane { left: 9vw; top: 17vh; }
.right-pane { right: 9vw; top: 18vh; transform: rotate(4deg); }
.final-pane { left: 13vw; top: 20vh; transform: rotate(-2deg); }

.choice-ring { position: absolute; right: 13vw; top: 18vh; width: 34vw; height: 58vh; animation: orbitSoft 14s ease-in-out infinite; }
.shell-choice, .pearl-choice {
  position: absolute;
  min-width: 15rem;
  padding: .9rem 1.35rem;
  border: 1px solid rgba(255,246,232,.4);
  border-radius: 66% 34% 64% 36% / 45% 61% 39% 55%;
  background: linear-gradient(135deg, rgba(255,246,232,.26), rgba(255,159,202,.18), rgba(139,233,244,.12));
  color: var(--pearl);
  box-shadow: 0 0 24px rgba(139,233,244,.18), inset 0 -12px 16px rgba(7,26,47,.18);
  transition: transform .35s ease, box-shadow .35s ease;
}
.shell-choice:hover, .pearl-choice:hover { transform: scale(1.08) rotate(0deg); box-shadow: 0 0 36px var(--jelly-blush); }
.shell-choice:nth-child(1) { left: 6%; top: 4%; transform: rotate(-8deg); }
.shell-choice:nth-child(2) { right: 3%; top: 38%; transform: rotate(9deg); }
.shell-choice:nth-child(3) { left: 18%; bottom: 3%; transform: rotate(-2deg); }
.bottle-message { position: absolute; left: 42vw; bottom: 16vh; padding: .8rem 1.5rem; border-radius: 50px 14px 50px 14px; border: 1px solid rgba(255,230,109,.5); background: rgba(255,230,109,.12); color: var(--starfruit); font-family: var(--mono); transform: rotate(8deg); }

.seagrass { position: absolute; bottom: -3vh; left: 0; right: 0; height: 38vh; pointer-events: none; }
.seagrass span { position: absolute; bottom: 0; width: 7vw; height: 100%; border-radius: 100% 0; background: linear-gradient(0deg, rgba(18,61,58,.92), rgba(139,233,244,.02)); transform-origin: bottom; animation: grassSway 5s ease-in-out infinite alternate; }
.seagrass span:nth-child(1){ left: 4%; height: 92%; }
.seagrass span:nth-child(2){ left: 18%; height: 70%; animation-delay:-1s; }
.seagrass span:nth-child(3){ right: 14%; height: 84%; animation-delay:-2s; }
.seagrass span:nth-child(4){ right: 2%; height: 68%; animation-delay:-3s; }

.screentone-orb { position: absolute; left: 11vw; top: 12vh; width: 36vw; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,246,232,.16) 0 1px, transparent 2px); background-size: 18px 18px; border: 1px solid rgba(140,111,232,.32); box-shadow: 0 0 60px rgba(140,111,232,.26); animation: bubbleBreath 6s ease-in-out infinite; }
.cassette-save { position: absolute; left: 10vw; bottom: 16vh; width: 28rem; max-width: 36vw; padding: 1rem 1.3rem; border-radius: 18px; background: rgba(7,26,47,.45); border: 1px solid rgba(139,233,244,.3); box-shadow: inset 0 0 22px rgba(139,233,244,.1); font-family: var(--mono); display: grid; gap: .42rem; transform: rotate(-5deg); }
.cassette-save span { color: var(--glass-cyan); font-size: .68rem; }
.cassette-save strong { color: var(--pearl); }
.cassette-save em { color: var(--jelly-blush); font-style: normal; font-size: .78rem; }
.memory-bubbles span { position: absolute; display: grid; place-items: center; width: 88px; aspect-ratio: 1; border-radius: 50%; background: rgba(255,246,232,.14); border: 1px solid rgba(255,246,232,.28); color: var(--pearl); box-shadow: 0 0 22px rgba(140,111,232,.3); animation: smallBubble 8s ease-in-out infinite; }
.memory-bubbles span:nth-child(1){ left: 22vw; top: 25vh; }
.memory-bubbles span:nth-child(2){ left: 36vw; top: 56vh; animation-delay:-1s; }
.memory-bubbles span:nth-child(3){ left: 61vw; top: 13vh; animation-delay:-2s; }
.memory-bubbles span:nth-child(4){ left: 72vw; top: 62vh; animation-delay:-3s; }
.memory-bubbles span:nth-child(5){ left: 49vw; bottom: 10vh; animation-delay:-4s; }
.mascot-shadow { position: absolute; right: 8vw; bottom: 8vh; width: 18vw; height: 20vh; border-radius: 55% 45% 50% 50%; background: rgba(7,26,47,.38); filter: blur(.2px); }
.mascot-shadow span { position: absolute; left: 38%; top: 22%; width: 20px; height: 20px; border-radius: 50%; box-shadow: 46px 0 0 rgba(255,246,232,.65), 0 0 12px rgba(255,246,232,.5), 46px 0 12px rgba(255,246,232,.5); }

.confession-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(68vw, 920px); padding: clamp(2rem, 5vw, 5rem); border-radius: 44px; text-align: center; background: radial-gradient(circle at 50% 0%, rgba(255,159,202,.24), rgba(255,246,232,.08) 55%, rgba(139,233,244,.08)); border: 1px solid rgba(255,246,232,.34); box-shadow: 0 0 80px rgba(255,159,202,.28), inset 0 0 45px rgba(255,246,232,.08); }
.dramatic { font-family: var(--drama); font-style: italic; font-size: clamp(1.8rem, 3.5vw, 4rem); line-height: 1.15; color: var(--jelly-blush); margin: 1rem auto 2rem; }
.pearl-buttons { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.pearl-choice { position: static; min-width: 12rem; color: var(--midnight); background: linear-gradient(135deg, var(--pearl), rgba(139,233,244,.65)); }
.confession-moon { position: absolute; left: 8vw; top: 11vh; width: 18vw; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--pearl), rgba(255,159,202,.3) 45%, transparent 70%); filter: blur(.5px); opacity: .75; }
.tide-rings { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .5; }
.tide-rings circle { fill: none; stroke: rgba(139,233,244,.38); stroke-width: 1; transform-origin: 50% 50%; animation: ringPulse 5s ease-in-out infinite; }
.tide-rings circle:nth-child(2){ animation-delay:-1s; stroke: rgba(255,159,202,.34); }
.tide-rings circle:nth-child(3){ animation-delay:-2s; }
.letter-flood { position: absolute; right: 5vw; bottom: 12vh; font-family: var(--word); font-size: clamp(2.4rem, 7vw, 8rem); color: rgba(255,230,109,.22); transform: rotate(10deg); }

.after-bubble { position: absolute; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,246,232,.32); background: radial-gradient(circle at 32% 24%, rgba(255,246,232,.3), rgba(139,233,244,.1)); box-shadow: inset 0 0 35px rgba(255,246,232,.06), 0 0 40px rgba(255,246,232,.18); animation: bubbleBreath 5s ease-in-out infinite; }
.after-bubble span { width: 70%; text-align: center; font-family: var(--word); font-size: clamp(1.2rem, 2.5vw, 3rem); }
.cluster-one { right: 13vw; top: 13vh; width: 23vw; aspect-ratio: 1; }
.cluster-two { right: 29vw; bottom: 13vh; width: 17vw; aspect-ratio: 1; animation-delay:-2s; }
.starfish-sticker { position: absolute; left: 68vw; top: 52vh; font-size: 7rem; color: var(--starfruit); filter: drop-shadow(0 0 16px rgba(255,230,109,.45)); animation: stickerSpin 10s ease-in-out infinite; }
.sea-ribbon { position: absolute; left: 0; right: 0; bottom: 18vh; height: 110px; background: linear-gradient(90deg, transparent, rgba(255,159,202,.18), rgba(139,233,244,.16), transparent); clip-path: polygon(0 58%, 15% 48%, 34% 63%, 55% 36%, 74% 55%, 100% 42%, 100% 82%, 0 86%); animation: ribbonFlow 8s ease-in-out infinite alternate; }

.bubble-wipe { position: fixed; left: var(--wipe-x, 50%); top: var(--wipe-y, 50%); width: 0; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); z-index: 30; pointer-events: none; background: radial-gradient(circle, rgba(255,246,232,.42), rgba(139,233,244,.28), rgba(255,159,202,.12) 62%, transparent 70%); opacity: 0; }
.bubble-wipe.bloom { animation: wipeBloom .9s ease-out; }

.cursor-koi { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.cursor-koi span { position: absolute; width: 18px; height: 10px; border-radius: 70% 30% 60% 40%; background: linear-gradient(90deg, var(--starfruit), var(--jelly-blush)); box-shadow: 0 0 12px rgba(255,159,202,.65); transform: translate(-50%, -50%); opacity: .9; }
.cursor-koi span::after { content:""; position:absolute; right:-8px; top:1px; border-left:9px solid var(--jelly-blush); border-top:4px solid transparent; border-bottom:4px solid transparent; }

@keyframes planktonDrift { to { transform: translate3d(-90px, 130px, 0); } }
@keyframes shimmerBands { to { transform: translateX(8vw) rotate(.5deg); opacity: .55; } }
@keyframes saveFlicker { 0%, 92%, 100% { opacity: 1; } 94% { opacity: .38; } 96% { opacity: .8; } }
@keyframes bubbleBreath { 0%,100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -51.5%) scale(1.035); } }
.after-bubble, .screentone-orb { transform: none; }
@keyframes jellyBob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-24px) rotate(3deg); } }
@keyframes tentacle { to { transform: translateX(8px) rotate(8deg); height: 96px; } }
@keyframes floatNote { 50% { transform: translateY(-18px) rotate(-7deg); } }
@keyframes petalDrift { to { transform: translate(-25vw, 22vh) rotate(360deg); } }
@keyframes orbitSoft { 50% { transform: translateY(18px) rotate(3deg); } }
@keyframes grassSway { to { transform: skewX(9deg) scaleY(1.06); } }
@keyframes smallBubble { 50% { transform: translateY(-32px) scale(1.08); } }
@keyframes ringPulse { 50% { transform: scale(1.07); opacity: .35; } }
@keyframes stickerSpin { 50% { transform: rotate(12deg) scale(1.08); } }
@keyframes ribbonFlow { to { transform: translateX(4vw) scaleY(1.15); } }
@keyframes wipeBloom { 0% { width: 0; opacity: 1; } 55% { width: 160vmax; opacity: .9; } 100% { width: 180vmax; opacity: 0; } }

@media (max-width: 760px) {
  .chapter-charms { right: .4rem; gap: .35rem; }
  .charm { width: 3rem; height: 2.4rem; }
  .charm span { font-size: .42rem; }
  .giant-bubble { width: 86vw; }
  .glass-pane, .confession-card { width: 78vw; left: 8vw; right: auto; top: 18vh; transform: rotate(-2deg); }
  .choice-ring { left: 8vw; right: auto; top: 58vh; width: 72vw; height: 28vh; }
  .shell-choice { min-width: 11rem; font-size: .78rem; }
  .cassette-save { max-width: 76vw; width: 76vw; }
  .cluster-one, .cluster-two { width: 34vw; }
  body { cursor: auto; }
}
