/* Pool Dive: a cross-section of a pool with toys stacked between Alanna and the treasure. */
.pool { background: #bfe9ff; }
.pool .pl-stage { flex: 1; position: relative; min-height: 0; overflow: hidden; background: #0f6ea8; }
.pool .pl-world { position: absolute; left: 0; right: 0; top: 0; transition: transform .8s cubic-bezier(.4, 0, .3, 1); }
.pool .pl-sky { position: absolute; left: 0; right: 0; top: 0; height: 120px; background: linear-gradient(#8fdcff, #d9f5ff); }
.pool .pl-sun { position: absolute; right: 5%; top: 8%; font-size: 48px; }
.pool .pl-umbrella { position: absolute; right: 16%; bottom: 0; font-size: 64px; }
.pool .pl-palm { position: absolute; right: 26%; bottom: 0; font-size: 80px; }
.pool .pl-deck { position: absolute; left: 0; right: 0; top: 106px; height: 14px; background: #f2e3c9; border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); z-index: 2; }
.pool .pl-board-dive { position: absolute; left: 4%; bottom: 100%; width: 22%; height: 16px; background: #3fa9f5; border: 3px solid var(--ink); border-radius: 0 10px 10px 0; transform-origin: left center; }
.pool .pl-board-dive::after { content: ''; position: absolute; left: 4px; top: 12px; width: 18px; height: 40px; background: #9aa3c7; border: 3px solid var(--ink); }
.pool .pl-ladder { position: absolute; right: 8%; top: -40px; width: 50px; height: 120px; border: 6px solid #c4cad6; border-bottom: 0; border-radius: 26px 26px 0 0; }
.pool .pl-water { position: absolute; left: 0; right: 0; top: 120px; bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 48px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 48px),
    linear-gradient(#5fd6f2, #1fa3d6 40%, #0d5e93); }
.pool .pl-caustics { position: absolute; inset: 0; opacity: .35; mix-blend-mode: screen;
  background: radial-gradient(ellipse 60px 18px at 20% 20%, #fff, transparent), radial-gradient(ellipse 80px 20px at 70% 35%, #fff, transparent),
    radial-gradient(ellipse 50px 14px at 40% 60%, #fff, transparent), radial-gradient(ellipse 70px 16px at 85% 75%, #fff, transparent);
  animation: pl-shimmer 6s ease-in-out infinite alternate; }
.pool .pl-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: repeating-linear-gradient(90deg, #e9f7fb 0 40px, #cdeef6 40px 80px); border-top: 4px solid #8fd0e3; }
.pool .pl-depths span { position: absolute; left: 10px; background: #fff; color: #1d5f8a; border: 3px solid var(--ink); border-radius: 8px; padding: 0 6px; font-weight: 800; font-size: 15px; z-index: 1; }

/* toys */
.pool .pl-toys { position: absolute; inset: 0; z-index: 2; }
.pool .pl-toy { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; transition: transform .7s cubic-bezier(.4, 0, .3, 1), opacity .7s; translate: -50% -50%; opacity: .55; filter: saturate(.7); }
.pool .pl-toy.current { opacity: 1; filter: none; z-index: 2; }
.pool .pl-toy.pushed { opacity: 0; }
.pool .pl-toy .pl-tag { margin-top: -4px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 0 12px; font-size: 26px; font-weight: 800; letter-spacing: 2px; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); white-space: nowrap; }
.pool .pl-toy.current .pl-tag { font-size: 34px; background: #fff8d6; box-shadow: 0 0 0 4px var(--sun), 0 3px 0 rgba(0, 0, 0, .25); }
/* Long sentences (level 9) wrap onto two lines between words and stay one size. */
.pool .pl-toy .pl-tag.long, .pool .pl-toy.current .pl-tag.long { font-size: 28px; letter-spacing: 1px; white-space: normal; max-width: min(460px, 46vw); text-align: center; text-wrap: balance; line-height: 1.25; padding: 2px 14px; }
.pool .pl-tag span.done { color: var(--good); }
.pool .pl-tag span.now { color: var(--coral-dark); text-decoration: underline 4px var(--coral); text-underline-offset: 5px; }
.pool .pl-toy:not(.pushed) > :first-child { animation: pl-bob 2.4s ease-in-out infinite; }
.pool .pl-emoji { font-size: 70px; line-height: 1; }
.pool .pl-emoji.big { font-size: 90px; }
.pool .pl-noodle { display: block; width: 260px; height: 34px; border-radius: 17px; background: linear-gradient(var(--c), color-mix(in srgb, var(--c) 70%, #000)); border: 3px solid var(--ink); position: relative; }
.pool .pl-noodle::after { content: ''; position: absolute; right: 6px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: rgba(58, 42, 74, .4); }
.pool .pl-ball { display: block; width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 50%, #fff 0 12%, transparent 13%), conic-gradient(#ff5a5f 0 60deg, #fff 60deg 120deg, #3fa9f5 120deg 180deg, #fff 180deg 240deg, #ffd23f 240deg 300deg, #fff 300deg); }
.pool .pl-board { display: block; width: 150px; height: 46px; border-radius: 22px 22px 10px 10px; background: var(--c); border: 3px solid var(--ink); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .15); }
.pool .pl-tube { display: block; width: 110px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(ellipse at 50% 50%, transparent 0 28%, var(--ink) 29% 31%, var(--c) 32%); }
.pool .pl-arms { display: flex; gap: 18px; }
.pool .pl-arms b { display: block; width: 44px; height: 54px; border-radius: 18px; background: linear-gradient(#ffb347, #ff8c1a); border: 3px solid var(--ink); }

/* treasure */
.pool .pl-chest { position: absolute; left: 0; top: 0; translate: -50% -100%; width: 96px; height: 70px; z-index: 1; }
.pool .pl-chest-box { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: #a8653a; border: 4px solid var(--ink); border-radius: 6px; box-shadow: inset 0 0 0 6px #e0a020; }
.pool .pl-chest-lid { position: absolute; left: 0; right: 0; top: 0; height: 30px; background: #c47a45; border: 4px solid var(--ink); border-radius: 40px 40px 4px 4px; transform-origin: bottom left; transition: transform .5s cubic-bezier(.2, 1.4, .4, 1); z-index: 1; }
.pool .pl-gem { position: absolute; left: 50%; top: 18px; translate: -50% 0; font-size: 34px; opacity: 0; transition: transform .6s, opacity .3s; }
.pool .pl-chest.open .pl-chest-lid { transform: rotate(-70deg); }
.pool .pl-chest.open .pl-gem { opacity: 1; transform: translateY(-50px) scale(1.4); filter: drop-shadow(0 0 12px #fff); }
.pool .pl-chest::after { content: '✨'; position: absolute; right: -14px; top: -10px; font-size: 22px; animation: twinkle 1.6s ease-in-out infinite; }

/* Alanna */
.pool .pl-hero { position: absolute; left: 0; top: 0; width: 100px; z-index: 3; transition: transform .6s cubic-bezier(.4, 0, .3, 1); transform-origin: 50% 50%; }
.pool .pl-hero .avatar-svg { width: 100px; height: 160px; }
.pool .pl-hero.on-board { translate: 0 -100%; }
.pool .pl-hero.jumping { animation: pl-jump .65s ease-in forwards; }
.pool .pl-hero.swimming .avatar-svg { animation: pl-swim 1.2s ease-in-out infinite; }
.pool .pl-hero.surfacing { transition: transform 1.2s cubic-bezier(.3, 0, .2, 1); }
.pool .hud-time.low { background: #ffd6d8; }

/* splashes and bubbles */
.pool .pl-bubbles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.pool .pl-bubble { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .2); animation: pl-rise 2.2s ease-in forwards; }
.pool .pl-drop { position: absolute; width: 12px; height: 16px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #bdf0ff; border: 2px solid #3cc6e8; animation: pl-drop .8s ease-out forwards; }

@keyframes pl-shimmer { from { transform: translateX(-20px) scaleY(1); } to { transform: translateX(30px) scaleY(1.2); } }
@keyframes pl-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes pl-swim { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-4px); } }
@keyframes pl-jump { 0% { translate: 0 -100%; } 40% { translate: 60px -190%; } 100% { translate: 120px 0; } }
@keyframes pl-rise { to { transform: translateY(var(--rise)) translateX(10px); opacity: 0; } }
@keyframes pl-drop { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

@media (max-width: 980px) {
  .pool .pl-noodle { width: 180px; }
  .pool .pl-toy.current .pl-tag { font-size: 26px; }
  .pool .pl-palm, .pool .pl-umbrella { display: none; }
}
