/* Inky's Rainbow Letters — underwater art studio */

:root {
    --sea-deep: #073B4C;
    --sea-mid: #0A5068;
    --sea-top: #0E7490;
    --sand: #FCBF49;
    --paper: #FFFDF6;
    --ink-purple: #B565D8;
}

body {
    background: var(--sea-deep);
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ══ Scene layers ══ */

#scene { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }

#water {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, #0E7490 0%, #0A5068 38%, #073B4C 78%, #05303F 100%);
}

.light-ray {
    position: absolute;
    top: -12%;
    width: 16vw; height: 70vh;
    background: linear-gradient(180deg, rgba(207, 239, 247, 0.28), rgba(207, 239, 247, 0));
    transform: skewX(-14deg);
    animation: ray-drift 14s ease-in-out infinite alternate;
}
.ray-a { left: 16%; }
.ray-b { left: 58%; width: 10vw; animation-delay: -7s; animation-duration: 18s; }
@keyframes ray-drift {
    from { transform: skewX(-14deg) translateX(-3vw); opacity: 0.7; }
    to   { transform: skewX(-10deg) translateX(4vw); opacity: 1; }
}

#fish-layer { position: absolute; inset: 0; }
.bg-fish {
    position: absolute; width: 54px; opacity: 0.55;
    animation: fish-cross 40s linear infinite;
}
.bg-fish.f-a { top: 16%; animation-delay: 0s; }
.bg-fish.f-b { top: 26%; width: 38px; animation-delay: -17s; animation-duration: 52s; }
.bg-fish.f-c { top: 9%; width: 30px; animation-delay: -31s; animation-duration: 46s; }
@keyframes fish-cross {
    from { transform: translateX(-12vw) scaleX(-1); }
    to   { transform: translateX(112vw) scaleX(-1); }
}

#sand {
    position: absolute; left: -4%; right: -4%; bottom: -3vh; height: 15vh;
    background: linear-gradient(180deg, #E8A828 0%, var(--sand) 30%, #E8A828 100%);
    border-radius: 50% 50% 0 0 / 90% 70% 0 0;
    box-shadow: 0 -6px 24px rgba(5, 30, 40, 0.35) inset;
}

.seaweed-cluster { position: absolute; }
#seaweed-left .seaweed-cluster { left: -30px; bottom: 4vh; width: clamp(150px, 17vw, 230px); }
#seaweed-right .seaweed-cluster { right: 4vw; bottom: 5vh; width: clamp(100px, 12vw, 170px); }
.sway { transform-origin: 50% 100%; animation: weed-sway 5s ease-in-out infinite alternate; transform-box: fill-box; }
.sway.s-b { animation-delay: -1.6s; animation-duration: 6s; }
.sway.s-c { animation-delay: -3.1s; animation-duration: 4.4s; }
@keyframes weed-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

#chest-wrap #chest {
    position: absolute; right: 16vw; bottom: 3.4vh;
    width: clamp(90px, 11vw, 150px);
}

#coral-left .coral-fringe, #coral-right .coral-fringe { position: absolute; bottom: -8px; width: clamp(160px, 20vw, 280px); }
#coral-left .coral-fringe { left: -20px; }
#coral-right .coral-fringe { right: -20px; }
.coral-fringe.flip { transform: scaleX(-1); }

/* rising bubbles */
#bubble-layer { position: absolute; inset: 0; }
.rise-bubble {
    position: absolute; bottom: -40px;
    border: 2.5px solid rgba(207, 239, 247, 0.55);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.5), rgba(255,255,255,0.04) 55%);
    animation: bubble-rise linear infinite;
}
@keyframes bubble-rise {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    8%   { opacity: 0.9; }
    50%  { transform: translateY(-55vh) translateX(14px); }
    100% { transform: translateY(-110vh) translateX(-8px); opacity: 0; }
}

#big-bubble {
    position: absolute; left: 8%; bottom: -140px;
    width: 110px; height: 110px;
    border: 3px solid rgba(207, 239, 247, 0.4);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.35), rgba(255,255,255,0.02) 60%);
    animation: big-bubble-rise 26s linear infinite;
}
@keyframes big-bubble-rise {
    0%   { transform: translateY(0) translateX(0) scale(0.8); opacity: 0; }
    6%   { opacity: 0.8; }
    100% { transform: translateY(-130vh) translateX(9vw) scale(1.15); opacity: 0; }
}

/* ══ Play layer ══ */

#play-layer {
    position: fixed; inset: 0;
    display: flex; flex-direction: column; align-items: center;
    pointer-events: none;
}

#progress-row {
    display: flex; gap: 18px;
    margin-top: max(14px, env(safe-area-inset-top));
    z-index: 5;
    transition: opacity 0.4s;
}
.blob {
    width: 34px; height: 34px;
    border-radius: 46% 54% 52% 48% / 54% 46% 54% 46%;
    background: rgba(255, 253, 246, 0.22);
    border: 2.5px dashed rgba(255, 253, 246, 0.55);
    transition: transform 0.3s;
}
.blob.filled {
    border-style: solid; border-color: #FFF3B0;
    background: conic-gradient(#E63946, #F77F00, #FCBF49, #7CB518, #00B4D8, #B565D8, #E63946);
    animation: blob-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
    box-shadow: 0 0 16px rgba(252, 191, 73, 0.7);
}
@keyframes blob-pop { from { transform: scale(0.2) rotate(-40deg); } to { transform: scale(1) rotate(0); } }

#paper-wrap {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    padding-bottom: 2vh;
}

#paper {
    position: relative;
    height: min(74vh, 92vw, 640px);
    aspect-ratio: 100 / 118;
    background:
        radial-gradient(120% 90% at 30% 20%, #FFFFFF 0%, var(--paper) 55%, #F6EFDD 100%);
    border-radius: 26px;
    box-shadow:
        0 24px 60px rgba(3, 25, 34, 0.5),
        0 4px 14px rgba(3, 25, 34, 0.35),
        inset 0 0 0 6px rgba(176, 123, 79, 0.16);
    pointer-events: auto;
    transform: translateX(4vw);
    animation: paper-float 7s ease-in-out infinite alternate;
}
@keyframes paper-float { from { margin-top: 0; } to { margin-top: 14px; } }

body.mode-start #paper, body.mode-start #progress-row,
body.mode-hello #paper, body.mode-hello #progress-row { opacity: 0; }
#paper.slide-in { animation: paper-slide 0.55s cubic-bezier(0.2, 1.3, 0.4, 1), paper-float 7s ease-in-out infinite alternate; }
@keyframes paper-slide {
    from { transform: translateX(60vw) rotate(5deg); opacity: 0; }
    to   { transform: translateX(4vw) rotate(0); opacity: 1; }
}

#trace-svg {
    position: absolute; inset: 8px;
    width: calc(100% - 16px); height: calc(100% - 16px);
    touch-action: none;
    overflow: visible;
}

/* guide letter */
.corridor-path {
    fill: none; stroke: #EAF3F7; stroke-linecap: round; stroke-linejoin: round;
    transition: opacity 0.4s;
}
.guide-path {
    fill: none; stroke: #B9CEDA; stroke-width: 5;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 0.2 9;
    transition: opacity 0.4s;
}
#trace-svg.faded .guide-path { opacity: 0.3; }
#trace-svg.faded .corridor-path { opacity: 0.35; }

.done-path, .ink-path {
    /* stroke paint (rainbow gradient) is set as an attribute in game.js —
       url(#...) in external CSS resolves against the stylesheet, not the page */
    fill: none; stroke-width: 9.5;
    stroke-linecap: round; stroke-linejoin: round;
}
.ink-path { opacity: 0.95; }
.ink-path.fade-out { transition: opacity 0.4s; opacity: 0 !important; }
.done-path { filter: drop-shadow(0 1px 1.2px rgba(90, 60, 20, 0.25)); }

.shimmer-path {
    fill: none; stroke: #FFFFFF; stroke-width: 4;
    stroke-linecap: round; opacity: 0.85;
    stroke-dasharray: 16 110;
    animation: shimmer-run 0.7s ease-out forwards;
}
@keyframes shimmer-run { from { stroke-dashoffset: 126; } to { stroke-dashoffset: -110; } }

.letter-shimmer .done-path { animation: letter-glow 0.9s ease-in-out 2; }
@keyframes letter-glow {
    0%, 100% { filter: drop-shadow(0 1px 1.2px rgba(90, 60, 20, 0.25)); }
    50% { filter: drop-shadow(0 0 7px rgba(252, 191, 73, 0.95)) brightness(1.25); }
}

/* checkpoints */
.checkpoint {
    fill: rgba(0, 180, 216, 0.16);
    stroke: rgba(0, 180, 216, 0.42); stroke-width: 1;
    transition: opacity 0.3s;
}
.checkpoint.hit { animation: cp-pop 0.45s ease-out forwards; }
@keyframes cp-pop {
    0%   { fill: rgba(0, 180, 216, 0.7); transform: scale(1); opacity: 1; }
    60%  { fill: rgba(255, 243, 176, 0.9); }
    100% { transform: scale(2.1) translateY(-3px); opacity: 0; }
}
.checkpoint { transform-box: fill-box; transform-origin: center; }

/* start dots */
.start-dot { cursor: pointer; }
.start-dot circle.dot-core {
    stroke: #FFFFFF; stroke-width: 1.6;
    filter: drop-shadow(0 1.5px 2px rgba(20, 40, 30, 0.35));
}
.start-dot.active circle.dot-core { fill: #37B34A; }
.start-dot.future circle.dot-core { fill: #F2A93B; }
.start-dot text {
    fill: #FFFFFF; font-family: var(--gk-font); font-weight: bold;
    text-anchor: middle; dominant-baseline: central;
    pointer-events: none;
}
.start-dot .dot-pulse {
    fill: none; stroke: #37B34A; stroke-width: 1.4;
    animation: dot-pulse 1.4s ease-out infinite;
    transform-box: fill-box; transform-origin: center;
}
@keyframes dot-pulse {
    0%   { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(2.4); opacity: 0; }
}
.start-dot.big-pulse circle.dot-core { animation: dot-big 0.55s ease-in-out 2; transform-box: fill-box; transform-origin: center; }
@keyframes dot-big { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.55); } }

/* chevrons */
.chev { fill: #8FB8CC; opacity: 0.85; }

/* demo comet */
#comet { pointer-events: none; }
.comet-spark { fill: #FFF3B0; pointer-events: none; }
.spark-fade { animation: spark-fade 0.7s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes spark-fade {
    from { opacity: 0.95; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.2) translateY(-6px); }
}

/* finger sparkles */
.finger-spark {
    pointer-events: none;
    animation: finger-spark 0.65s ease-out forwards;
    transform-box: fill-box; transform-origin: center;
}
@keyframes finger-spark {
    from { opacity: 0.9; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.15) translateY(-8px); }
}

/* ══ Inky ══ */

#inky {
    position: fixed;
    left: max(6px, env(safe-area-inset-left));
    bottom: max(4px, env(safe-area-inset-bottom));
    width: clamp(150px, 20vw, 240px);
    height: auto; aspect-ratio: 200 / 190;
    background: none; border: none; cursor: pointer; padding: 0;
    z-index: 20;
    transition: transform 0.25s;
    -webkit-tap-highlight-color: transparent;
}
#inky svg { width: 100%; height: 100%; display: block; overflow: visible; }

body.mode-start #inky { transform: translateX(2vw) scale(0.92); }

#inky.offstage { transform: translateX(-130%) translateY(10px); transition: none; }
#inky.swim-in { animation: inky-swim 2.2s cubic-bezier(0.3, 0.8, 0.4, 1) forwards; }
@keyframes inky-swim {
    0%   { transform: translateX(-130%) translateY(20px) rotate(-8deg); }
    30%  { transform: translateX(-70%) translateY(-16px) rotate(5deg); }
    55%  { transform: translateX(-32%) translateY(8px) rotate(-4deg); }
    78%  { transform: translateX(-8%) translateY(-8px) rotate(3deg); }
    100% { transform: translateX(0) translateY(0) rotate(0); }
}

.tentacle { transform-box: fill-box; transform-origin: 50% 10%; }
.t1 { animation: tent-wig 3.2s ease-in-out infinite alternate; }
.t2 { animation: tent-wig 3.6s ease-in-out -1s infinite alternate; }
.t3 { animation: tent-wig 2.9s ease-in-out -0.5s infinite alternate; }
.t4 { animation: tent-wig 3.4s ease-in-out -1.8s infinite alternate; }
.t5 { animation: tent-wig 3.1s ease-in-out -2.4s infinite alternate; }
.t6 { animation: tent-wig 3.8s ease-in-out -0.8s infinite alternate; }
@keyframes tent-wig { from { transform: rotate(-3.5deg); } to { transform: rotate(3.5deg); } }

#inky-all { transform-box: fill-box; transform-origin: 50% 80%; animation: inky-idle 3.4s ease-in-out infinite alternate; }
@keyframes inky-idle { from { transform: translateY(0) scale(1, 1); } to { transform: translateY(-5px) scale(1.015, 0.985); } }

.inky-lid { opacity: 0; transition: opacity 0.08s; }
#inky.blinking .inky-lid { opacity: 1; }

#inky.bounce #inky-all { animation: inky-bounce 0.65s cubic-bezier(0.3, 1.6, 0.4, 1); }
@keyframes inky-bounce {
    0%   { transform: scale(1, 1); }
    30%  { transform: scale(1.14, 0.82) translateY(6px); }
    62%  { transform: scale(0.92, 1.14) translateY(-14px); }
    100% { transform: scale(1, 1); }
}

#inky.tilt #inky-all { animation: inky-tilt 1.1s ease-in-out; }
@keyframes inky-tilt {
    0%, 100% { transform: rotate(0); }
    30%, 70% { transform: rotate(-9deg) translateY(2px); }
}

#inky.spin #inky-all { animation: inky-spin 0.9s cubic-bezier(0.4, 0.2, 0.3, 1); }
@keyframes inky-spin {
    0%   { transform: rotate(0) scale(1); }
    50%  { transform: rotate(190deg) scale(1.08); }
    100% { transform: rotate(360deg) scale(1); }
}

#inky.point #inky-tent-brush { animation: inky-point 1.2s ease-in-out; transform-box: fill-box; transform-origin: 15% 85%; }
@keyframes inky-point {
    0%, 100% { transform: rotate(0); }
    25%, 75% { transform: rotate(-34deg) translateY(-8px); }
}

#inky.brush-twirl #inky-brush { animation: brush-twirl 0.9s ease-in-out; transform-box: fill-box; transform-origin: 50% 70%; }
@keyframes brush-twirl {
    0% { transform: rotate(0); } 50% { transform: rotate(330deg); } 100% { transform: rotate(360deg); }
}

#inky.beret-pop #inky-beret { animation: beret-pop 0.9s cubic-bezier(0.3, 1.4, 0.5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes beret-pop {
    0% { transform: translateY(0) rotate(0); }
    35% { transform: translateY(-26px) rotate(-14deg); }
    70% { transform: translateY(3px) rotate(4deg); }
    100% { transform: translateY(0) rotate(0); }
}

/* Inky mouth bubbles */
#inky-bubbles { position: fixed; z-index: 21; pointer-events: none; left: 0; bottom: 0; width: 0; height: 0; }
.mouth-bubble {
    position: absolute;
    border: 2px solid rgba(220, 240, 250, 0.85);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.6), rgba(255,255,255,0.05) 60%);
    animation: mouth-bubble 1.5s ease-out forwards;
}
@keyframes mouth-bubble {
    0%   { transform: translateY(0) scale(0.4); opacity: 0; }
    15%  { opacity: 0.95; }
    100% { transform: translateY(-90px) translateX(12px) scale(1.1); opacity: 0; }
}

/* ══ Word reveal easel ══ */

#easel-wrap {
    position: fixed;
    right: max(2vw, env(safe-area-inset-right));
    bottom: 6vh;
    width: clamp(200px, 26vw, 300px);
    z-index: 15;
    pointer-events: none;
    display: flex; justify-content: center;
}
#easel-wrap.show { animation: easel-up 0.55s cubic-bezier(0.25, 1.35, 0.4, 1); }
#easel-wrap.hide { animation: easel-down 0.4s ease-in forwards; }
@keyframes easel-up { from { transform: translateY(120%); } to { transform: translateY(0); } }
@keyframes easel-down { from { transform: translateY(0); opacity: 1; } to { transform: translateY(120%); opacity: 0; } }

#easel-holder #easel-svg { width: 100%; display: block; }
#easel-content {
    position: absolute;
    top: 19.5%; left: 20%; right: 20%;
    display: flex; flex-direction: column; align-items: center;
}
#easel-art .painting { width: clamp(86px, 11vw, 128px); display: block; animation: gk-pop-in 0.4s 0.25s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
#easel-word {
    font-size: clamp(1.1rem, 2.4vw, 1.6rem);
    font-weight: bold; color: #6B4426;
    text-transform: lowercase; letter-spacing: 0.04em;
    margin-top: -2px;
}
#easel-word .first-letter { color: #E63946; text-transform: uppercase; }

/* ══ Hello title stamp ══ */

#hello-title {
    position: fixed;
    top: 22%; left: 0; right: 0;
    text-align: center;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    font-weight: bold;
}
body.mode-hello #hello-title { animation: hello-title 2.45s ease forwards; }
#hello-title .hl1 {
    display: block;
    color: #FFF3B0;
    font-size: clamp(1.4rem, 3.6vw, 2rem);
    transform: rotate(-2deg);
    text-shadow: 0 3px 0 #073B4C;
}
#hello-title .hl2 {
    display: block;
    font-size: clamp(2.4rem, 7vw, 4rem);
    background: linear-gradient(90deg, #FF7BAC, #FCBF49, #7CB518, #4CC9E8, #C88BE0);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 3px 0 rgba(7, 59, 76, 0.9));
}
@keyframes hello-title {
    0%   { opacity: 0; transform: scale(2.4) rotate(-8deg); }
    16%  { opacity: 1; transform: scale(1) rotate(0); }
    80%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.92) translateY(-26px); }
}

/* ══ Start screen ══ */

#start-screen {
    position: fixed; inset: 0; z-index: 30;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(10px, 3vh, 30px);
    padding: 12px;
    transition: opacity 0.45s, visibility 0.45s;
}
body:not(.mode-start) #start-screen { opacity: 0; visibility: hidden; pointer-events: none; }

#title-wrap { position: relative; text-align: center; }
#game-title {
    position: relative; z-index: 2;
    color: #FFFDF6;
    font-size: clamp(2rem, 6.5vw, 3.6rem);
    line-height: 1.05;
    text-shadow: 0 3px 0 #073B4C, 0 8px 24px rgba(3, 25, 34, 0.6);
    animation: title-stamp 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) backwards;
}
#game-title .t-line1 { display: block; font-size: 0.55em; color: #FFF3B0; transform: rotate(-2deg); }
#game-title .t-line2 {
    display: block;
    background: linear-gradient(90deg, #FF7BAC, #FCBF49, #7CB518, #4CC9E8, #C88BE0);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 3px 0 rgba(7, 59, 76, 0.9));
    text-shadow: none;
}
@keyframes title-stamp {
    from { transform: scale(2.2) rotate(-6deg); opacity: 0; }
    to   { transform: scale(1) rotate(0); opacity: 1; }
}
#title-splat {
    position: absolute; z-index: 1;
    inset: -34% -18%;
    background: radial-gradient(ellipse at center, rgba(181, 101, 216, 0.4) 0%, rgba(181, 101, 216, 0.22) 45%, transparent 70%);
    border-radius: 44% 56% 52% 48% / 58% 44% 56% 42%;
}

#btn-start {
    position: relative;
    width: clamp(200px, 26vw, 280px);
    aspect-ratio: 240 / 170;
    background: none; border: none; cursor: pointer; padding: 0;
    filter: drop-shadow(0 12px 26px rgba(3, 25, 34, 0.55));
    transition: transform 0.2s;
}
#btn-start:hover { transform: scale(1.06); }
#btn-start:active { transform: scale(0.94); }
@keyframes start-throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
#btn-start svg { width: 100%; height: 100%; display: block; animation: start-throb 1.8s ease-in-out infinite; }
#btn-start:active svg { animation: none; }
.start-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #FFFDF6;
    font-size: clamp(1.7rem, 3.6vw, 2.4rem);
    font-weight: bold;
    text-shadow: 0 3px 0 rgba(140, 20, 30, 0.75);
    pointer-events: none;
}

#level-row { display: flex; gap: clamp(12px, 3vw, 34px); align-items: flex-end; }
.shell-btn {
    position: relative;
    width: clamp(96px, 12vw, 128px);
    height: clamp(107px, 13.4vw, 143px);
    border: none; cursor: pointer; padding: 0;
    background: none;
    transition: transform 0.2s;
}
.shell-btn:hover { transform: translateY(-4px) scale(1.05); }
.shell-btn:active { transform: scale(0.94); }
.shell-btn svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 14px rgba(3, 25, 34, 0.5)); }
.shell-btn .shell-letter {
    font-family: var(--gk-font); font-weight: bold;
    fill: #8A5C36; text-anchor: middle;
}
.shell-btn .shell-stars { font-size: 15px; text-anchor: middle; }
.shell-btn.locked svg { filter: drop-shadow(0 6px 14px rgba(3, 25, 34, 0.5)) saturate(0.25) brightness(0.75); }
.shell-btn.selected svg .shell-body { stroke: #FFF3B0; stroke-width: 5; }
.shell-btn.selected { transform: translateY(-6px) scale(1.08); }
.shell-btn.selected:hover { transform: translateY(-6px) scale(1.08); }

/* ══ Grown-ups ══ */

#info-btn {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    z-index: 35;
    width: 56px; height: 56px;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 12px rgba(3, 25, 34, 0.4);
    font-size: 1.5rem; cursor: pointer;
    transition: transform 0.15s;
}
#info-btn:hover { transform: scale(1.1); }
#info-btn:active { transform: scale(0.9); }

#info-overlay {
    position: fixed; inset: 0; z-index: 960;
    background: rgba(7, 59, 76, 0.6);
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
    animation: gk-fade-in 0.25s ease-out;
}
#info-card { max-width: 560px; max-height: 86vh; overflow-y: auto; }
#info-card h2 { color: var(--gk-purple); margin-bottom: 10px; }
#info-card p { margin: 10px 0; line-height: 1.45; font-size: 1.02rem; }
#info-card .gk-btn { margin-top: 8px; width: 100%; }

/* ══ Responsive ══ */

@media (max-width: 850px) and (orientation: portrait) {
    #paper { height: auto; width: min(88vw, 66vh * 0.847); transform: translateX(0); }
    @keyframes paper-slide {
        from { transform: translateX(60vw) rotate(5deg); opacity: 0; }
        to   { transform: translateX(0) rotate(0); opacity: 1; }
    }
    #paper-wrap { align-items: flex-start; padding-top: 3vh; }
    #inky { width: clamp(120px, 24vw, 180px); }
    #easel-wrap { bottom: 3vh; width: clamp(180px, 30vw, 240px); }
}

@media (prefers-reduced-motion: reduce) {
    .light-ray, .bg-fish, .rise-bubble, #big-bubble, .sway,
    #paper, .tentacle, #inky-all, #btn-start { animation: none !important; }
}
