@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700&display=swap');

html,
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: visible;
    /* Prevent scrolling entirely */
    font-family: 'Baloo 2', sans-serif;
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Page 10 Word Catch --- */
.page-10 {
    position: relative;
    overflow: hidden;
    background: url("./game 3/Fishing Game_1.png") center / cover no-repeat;
    font-family: 'Baloo 2', sans-serif;
    touch-action: none;
}

.p10-home-btn {
    position: absolute;
    top: clamp(22px, 5vh, 56px);
    left: clamp(20px, 6vw, 70px);
    width: clamp(52px, 12vw, 92px);
    z-index: 30;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.24));
    cursor: pointer;
}

.p10-question-wrap {
    position: absolute;
    top: clamp(88px, 12vh, 150px);
    left: 50%;
    width: min(68%, 640px);
    transform: translateX(-50%);
    z-index: 12;
}

.p10-question-img {
    display: block;
    width: 100%;
    max-height: 23vh;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(101, 56, 0, 0.22));
}

.p10-water {
    position: absolute;
    inset: 39% 0 0;
    overflow: hidden;
}

.p10-water::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 22%, rgba(255, 255, 255, 0.18), transparent 18%),
        radial-gradient(circle at 75% 38%, rgba(255, 255, 255, 0.13), transparent 20%),
        linear-gradient(180deg, rgba(25, 215, 235, 0.5), rgba(0, 128, 233, 0.18));
    pointer-events: none;
}

.p10-current {
    position: absolute;
    left: -35%;
    width: 170%;
    height: 38px;
    opacity: 0.34;
    background: repeating-linear-gradient(90deg, transparent 0 42px, rgba(255, 255, 255, 0.55) 43px 110px, transparent 112px 180px);
    filter: blur(5px);
    animation: p10-current-flow 5.4s linear infinite;
}

.p10-current-one { top: 20%; }
.p10-current-two { top: 48%; animation-duration: 7.2s; opacity: 0.22; }

.p10-status {
    position: absolute;
    top: 1%;
    left: 50%;
    z-index: 14;
    transform: translateX(-50%);
    margin: 0;
    color: #fff;
    min-height: clamp(24px, 5vw, 44px);
    font-size: clamp(16px, 3.8vw, 32px);
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 1px #245071, 0 3px 7px rgba(0, 0, 0, 0.32);
    white-space: nowrap;
}

.p10-rope-stage {
    position: absolute;
    inset: 0 0 13%;
    z-index: 32;
    pointer-events: none;
}

.p10-rope-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.p10-rope-svg path {
    fill: none;
    stroke: #f57c00;
    stroke-width: clamp(4px, 0.7vw, 7px);
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 1px rgba(111, 61, 0, 0.24));
}

.p10-rope-anchor {
    position: absolute;
    left: 0;
    top: 0;
    width: clamp(24px, 5vw, 44px);
    height: clamp(24px, 5vw, 44px);
    margin-left: 0;
    margin-top: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #ffd95a, #ff9600 62%, #ed6a00 100%);
    box-shadow: 0 4px 8px rgba(129, 72, 0, 0.25);
    z-index: 20;
    pointer-events: none;
}

.p10-magnet {
    position: absolute;
    left: 0;
    top: 0;
    width: clamp(56px, 10.5vw, 96px);
    aspect-ratio: 0.97;
    border: 0;
    background: transparent;
    z-index: 34;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

.p10-magnet.is-dragging { cursor: grabbing; }

.p10-magnet.is-returning {
    transition: transform 0.28s ease;
}

.p10-magnet img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(0, 67, 123, 0.28));
}

.p10-answer-stream {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.p10-answer-card {
    position: absolute;
    top: var(--top);
    left: -42%;
    width: clamp(124px, 24vw, 218px);
    border: 0;
    padding: 0;
    background: transparent;
    pointer-events: none;
    animation: p10-answer-drift 9.2s linear infinite;
    animation-delay: var(--delay);
    filter: drop-shadow(0 7px 8px rgba(0, 44, 91, 0.22));
}

.p10-answer-card img {
    display: block;
    width: 100%;
    max-height: clamp(68px, 11vh, 124px);
    object-fit: contain;
}

.p10-answer-card.is-wrong {
    animation-play-state: paused;
    filter: drop-shadow(0 0 12px rgba(255, 53, 66, 0.95));
}

.p10-answer-card.is-caught,
.p10-answer-card.is-muted {
    animation-play-state: paused;
    opacity: 0;
}

.p10-pop {
    position: fixed;
    width: clamp(54px, 12vw, 96px);
    z-index: 40;
    pointer-events: none;
    animation: p10-pop-feedback 0.82s ease-out forwards;
}

.p10-score-pop {
    position: fixed;
    z-index: 42;
    transform: translate(-50%, -50%);
    font-size: clamp(26px, 6vw, 54px);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22), 0 5px 10px rgba(0, 62, 101, 0.28);
    animation: p10-score-rise 0.72s ease-out forwards;
}

.p10-score-pop.is-plus {
    color: #18c441;
    -webkit-text-stroke: 2px #fff;
}

.p10-score-pop.is-minus {
    color: #ff3a44;
    -webkit-text-stroke: 2px #fff;
}

.p10-fish-layer {
    position: absolute;
    inset: 0 0 14%;
    z-index: 24;
    pointer-events: none;
}

.p10-fish {
    position: absolute;
    top: var(--top);
    left: -92px;
    width: 84px;
    height: 48px;
    border: 0;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
    animation: p10-fish-swim var(--duration) linear forwards;
}

.p10-fish-body {
    position: absolute;
    left: 18px;
    top: 8px;
    width: 48px;
    height: 30px;
    border-radius: 62% 42% 42% 62%;
    background:
        radial-gradient(circle at 72% 35%, #1c3557 0 2px, transparent 3px),
        linear-gradient(135deg, #ffc83d, #ff7b2a);
    box-shadow: inset -8px -5px 0 rgba(158, 61, 13, 0.15), 0 4px 5px rgba(0, 74, 123, 0.18);
}

.p10-fish-tail {
    content: "";
    position: absolute;
    left: 2px;
    top: 10px;
    width: 28px;
    height: 28px;
    background: #ff8935;
    clip-path: polygon(0 0, 100% 50%, 0 100%, 28% 50%);
}

.p10-fish-fin {
    content: "";
    position: absolute;
    left: 38px;
    top: 30px;
    width: 18px;
    height: 12px;
    background: rgba(255, 206, 80, 0.92);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.p10-fish.is-tapped {
    animation-play-state: paused;
    pointer-events: none;
}

.p10-fish-score {
    position: absolute;
    left: 50%;
    top: -18px;
    transform: translateX(-50%);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    text-shadow: 0 2px 3px #075087;
    animation: p10-score-rise 0.58s ease-out forwards;
}

.p10-tap-bubble,
.p10-bubble {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.16);
}

.p10-tap-bubble {
    left: 34px;
    top: 12px;
    animation: p10-tap-bubble 0.68s ease-out forwards;
}

.p10-bubble {
    bottom: -30px;
    opacity: 0.5;
    animation: p10-bubble-rise 6s linear infinite;
}

.p10-bubble-a { left: 16%; animation-delay: 0.4s; }
.p10-bubble-b { left: 48%; animation-delay: 2s; transform: scale(0.8); }
.p10-bubble-c { left: 78%; animation-delay: 3.3s; transform: scale(1.2); }

.p10-seabed {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 16%;
    z-index: 15;
    background: radial-gradient(100% 90% at 50% 100%, #f3bf4b 0 62%, #ffd76f 63% 100%);
}

.p10-coral,
.p10-shell {
    position: absolute;
    bottom: 8%;
    filter: drop-shadow(0 5px 4px rgba(74, 45, 3, 0.24));
}

.p10-coral {
    width: clamp(42px, 7vw, 72px);
    height: clamp(46px, 8vw, 84px);
}

.p10-coral::before,
.p10-coral::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 16%;
    height: 78%;
    border-radius: 999px 999px 8px 8px;
    background: #16b978;
    transform-origin: bottom center;
}

.p10-coral::before {
    left: 36%;
    box-shadow: -16px 10px 0 -2px #2fce88, 17px 14px 0 -4px #0aa86d;
}

.p10-coral::after {
    left: 58%;
    height: 62%;
    transform: rotate(28deg);
}

.p10-coral-one {
    left: 18%;
}

.p10-coral-one::before {
    transform: rotate(-18deg);
}

.p10-coral-two {
    right: 20%;
    transform: scale(0.92);
}

.p10-coral-two::before {
    transform: rotate(16deg);
}

.p10-coral-two::after {
    left: 24%;
    transform: rotate(-30deg);
}

.p10-coral-three {
    left: 58%;
    transform: scale(0.72);
}

.p10-coral-three::before {
    transform: rotate(-8deg);
}

.p10-coral-three::after {
    transform: rotate(24deg);
}

.p10-shell {
    width: clamp(28px, 4.8vw, 48px);
    height: clamp(20px, 3.4vw, 34px);
    border-radius: 999px 999px 8px 8px;
    background:
        repeating-radial-gradient(ellipse at 50% 100%, transparent 0 8px, rgba(244, 148, 60, 0.38) 9px 11px),
        #ffe7bd;
    border: 4px solid rgba(255, 255, 255, 0.88);
}

.p10-shell-one { left: 44%; bottom: 7%; }
.p10-shell-two { right: 33%; bottom: 10%; transform: scale(0.82); }
.p10-shell-three { left: 72%; bottom: 6%; transform: scale(0.72); }

.p10-hero {
    position: absolute;
    inset: 0;
    z-index: 38;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.86);
    transition: opacity 0.2s ease, transform 0.28s ease;
}

.p10-hero.is-visible {
    opacity: 1;
    transform: scale(1);
}

.p10-hero-glow {
    position: absolute;
    width: min(74%, 600px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 241, 73, 0.76), rgba(255, 241, 73, 0.22) 42%, transparent 68%);
    animation: p10-hero-pulse 0.9s ease-in-out infinite alternate;
}

.p10-hero-card {
    position: relative;
    width: min(68%, 520px);
    max-height: 34vh;
    object-fit: contain;
    filter: drop-shadow(0 13px 10px rgba(0, 58, 101, 0.35));
}

.p10-hero-check {
    position: absolute;
    width: clamp(72px, 16vw, 128px);
    transform: translate(min(30vw, 220px), max(-12vh, -130px));
}

@keyframes p10-answer-drift {
    from { transform: translateX(0) translateY(0) rotate(-1deg); }
    45% { transform: translateX(72vw) translateY(-14px) rotate(1.2deg); }
    to { transform: translateX(150vw) translateY(10px) rotate(-0.8deg); }
}

@keyframes p10-current-flow {
    from { transform: translateX(0); }
    to { transform: translateX(18%); }
}

@keyframes p10-pop-feedback {
    0% { opacity: 0; transform: scale(0.55) rotate(-8deg); }
    28% { opacity: 1; transform: scale(1.12) rotate(4deg); }
    100% { opacity: 0; transform: translateY(-34px) scale(0.9); }
}

@keyframes p10-fish-swim {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 120px)); }
}

@keyframes p10-score-rise {
    to { opacity: 0; transform: translate(-50%, -38px) scale(1.18); }
}

@keyframes p10-tap-bubble {
    to { opacity: 0; transform: translate(var(--drift), -72px) scale(1.4); }
}

@keyframes p10-bubble-rise {
    from { transform: translateY(0) scale(0.7); opacity: 0; }
    20% { opacity: 0.65; }
    to { transform: translateY(-58vh) scale(1.25); opacity: 0; }
}

@keyframes p10-hero-pulse {
    to { transform: scale(1.08); opacity: 0.82; }
}

.mobile-app {
    width: 100%;
    height: 100%;
    height: 100dvh;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    max-width: 1024px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Page Backgrounds */
.page-1 {
    background-image: url('./Pages\ UI\ assets/1.landing\ page\ background.png');
}

.page-2 {
    background-image: url('./Pages\ UI\ assets/2.permission\ page\ background.png');
    background-position: center center;
}

.page-3,
.page-4 {
    background-image: url('./Pages\ UI\ assets/3.BACKGROUND.png');
    background-position: center top;
}

/* Generic Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(1vh);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.p1-grandma.fade-in {
    animation: fadeInGrandma 0.6s ease-out;
}

@keyframes fadeInGrandma {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1vh);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Layout Zones Guarantee 100% Height - NO SCROLL */
.header-zone {
    height: 25%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    z-index: 10;
}

.content-zone {
    flex: 1;
    /* Takes exactly remaining space */
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 0;
}

.footer-zone {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(28px, 6dvh, 70px);
    height: max(92px, calc(12dvh + env(safe-area-inset-bottom, 0px)));
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    padding-top: 0;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.btn-next {
    max-height: 70%;
    /* Scales relative to footer zone */
    height: 85px;
    width: auto;
    max-width: 80vw;
    margin-bottom: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-next:hover {
    transform: scale(1.05);
}

.btn-next:active {
    transform: scale(0.95);
}

body.vo-pending .btn-next,
body.tutorial-video-pending .page-3 .btn-next,
body.vo-pending #submitProfileBtn,
body.vo-pending .grid-img-btn,
body.vo-pending .p5-home-btn,
body.vo-pending .p5-leaderboard-btn,
body.vo-pending .p6-home-btn,
body.vo-pending .p8-home-btn,
body.vo-pending .p8-submit,
body.vo-pending .p9-home-btn,
body.vo-pending .p9-answer-option,
body.vo-pending .p7-item {
    opacity: 0.55;
}

body.vo-pending .mobile-app {
    pointer-events: none;
    user-select: none;
}

.vo-interaction-blocker {
    display: none;
}

body.vo-pending .vo-interaction-blocker {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99999;
    cursor: wait;
    background: transparent;
    touch-action: none;
}

button,
a,
img,
div,
select,
input {
    -webkit-tap-highlight-color: transparent;
}

button:focus,
a:focus,
img:focus,
div:focus {
    outline: none;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid rgba(30, 163, 237, 0.75);
    outline-offset: 3px;
}

/* --- Page 0 Start --- */
.page-0 {
    --p0-x: 50%;
    --p0-y: 45%;
    display: grid;
    place-items: center;
    padding: 0;
    background:
        radial-gradient(circle at var(--p0-x) var(--p0-y), rgba(255, 244, 173, 0.48), transparent 16%),
        radial-gradient(circle at calc(100% - var(--p0-x)) calc(var(--p0-y) + 10%), rgba(52, 216, 255, 0.24), transparent 28%),
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.5), transparent 24%),
        linear-gradient(135deg, #101a55 0%, #4931a1 38%, #7046c5 64%, #28105f 100%);
    overflow: hidden;
}

.page-0::before,
.page-0::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.page-0::before {
    z-index: 0;
    background:
        radial-gradient(circle at var(--p0-x) var(--p0-y), rgba(255,255,255,0.52), transparent 9%),
        conic-gradient(from 210deg at var(--p0-x) var(--p0-y), rgba(255,190,49,0.14), rgba(63,222,255,0.2), rgba(180,90,255,0.12), rgba(255,190,49,0.14));
    mix-blend-mode: screen;
    opacity: 0.8;
    transition: opacity 0.25s ease;
}

.page-0::after {
    z-index: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.06), transparent 28%, rgba(255,255,255,0.08) 52%, transparent 76%);
    animation: p0-gradient-drift 8s ease-in-out infinite alternate;
}

.p0-card {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    align-items: center;
    padding: clamp(48px, 8vh, 96px) clamp(30px, 8vw, 78px) clamp(82px, 11vh, 128px);
    box-sizing: border-box;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.p0-brand {
    position: relative;
    z-index: 3;
    display: grid;
    place-items: center;
    align-self: center;
    width: min(78%, 520px);
}

.p0-logo {
    width: min(82%, 330px);
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 12px rgba(39, 20, 78, 0.24));
}

.p0-start-btn {
    position: relative;
    z-index: 4;
    min-width: clamp(190px, 48vw, 310px);
    min-height: clamp(72px, 13vw, 96px);
    border: 2px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    padding: clamp(10px, 2.4vw, 16px) clamp(14px, 3.2vw, 22px) clamp(10px, 2.4vw, 16px) clamp(28px, 6vw, 44px);
    cursor: pointer;
    background:
        linear-gradient(135deg, #00c9ff 0%, #1a79ff 42%, #7f4dff 100%);
    box-shadow:
        0 16px 28px rgba(12, 28, 84, 0.36),
        0 0 30px rgba(63, 222, 255, 0.28),
        inset 0 2px 0 rgba(255,255,255,0.48),
        inset 0 -7px 14px rgba(26, 18, 102, 0.34);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 4vw, 28px);
    font-family: "Baloo 2", sans-serif;
    transform: translateY(0);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.p0-start-btn::before {
    content: "";
    position: absolute;
    inset: -40% -22%;
    background: linear-gradient(110deg, transparent 22%, rgba(255,255,255,0.55) 46%, transparent 68%);
    transform: translateX(-75%) rotate(7deg);
    transition: transform 0.62s ease;
}

.p0-start-btn::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: inherit;
    border: 1px solid rgba(255,255,255,0.26);
    pointer-events: none;
}

.p0-start-text {
    position: relative;
    z-index: 2;
    display: grid;
    align-items: center;
    justify-items: start;
    line-height: 1;
    text-shadow: 0 3px 8px rgba(13, 12, 69, 0.28);
}

.p0-start-text span {
    font-size: clamp(30px, 6.8vw, 44px);
    font-weight: 800;
}

.p0-start-arrow {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(44px, 10vw, 62px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255,255,255,0.94);
    color: #2262ff;
    font-size: clamp(42px, 9vw, 64px);
    line-height: 0.72;
    font-weight: 700;
    box-shadow: 0 8px 15px rgba(5, 18, 84, 0.24);
}

.p0-start-btn:active {
    transform: translateY(5px) scale(0.98);
    box-shadow:
        0 8px 18px rgba(12, 28, 84, 0.32),
        0 0 22px rgba(63, 222, 255, 0.24),
        inset 0 2px 0 rgba(255,255,255,0.48),
        inset 0 -5px 12px rgba(26, 18, 102, 0.34);
}

.p0-start-btn:hover {
    transform: translateY(-4px) scale(1.03);
    filter: brightness(1.04);
    border-color: rgba(255,255,255,0.96);
}

.p0-start-btn:hover::before {
    transform: translateX(75%) rotate(7deg);
}

.p0-stars {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.p0-stars span {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: clamp(4px, 0.8vw, 7px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 0 8px rgba(255,255,255,0.38);
    animation: p0-star-twinkle 3.6s ease-in-out infinite;
    animation-delay: var(--d);
}

.p0-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.26;
    pointer-events: none;
    background:
        linear-gradient(26deg, transparent 13%, rgba(255,255,255,0.28) 13.2%, transparent 13.7%),
        linear-gradient(72deg, transparent 22%, rgba(255,255,255,0.22) 22.2%, transparent 22.7%),
        linear-gradient(145deg, transparent 42%, rgba(255,255,255,0.2) 42.2%, transparent 42.7%),
        linear-gradient(118deg, transparent 68%, rgba(255,255,255,0.24) 68.2%, transparent 68.7%);
}

@keyframes p0-star-twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.25); }
}

@keyframes p0-gradient-drift {
    0% { transform: translate3d(-3%, -2%, 0) scale(1.05); opacity: 0.58; }
    100% { transform: translate3d(3%, 2%, 0) scale(1.12); opacity: 0.82; }
}

/* --- Page 1 --- */
.p1-header {
    justify-content: flex-start;
    height: 31%;
    padding-top: clamp(18px, 4dvh, 48px);
    box-sizing: border-box;
}

.p1-logo {
    max-height: 31%;
    width: auto;
    margin-bottom: 2%;
}

.p1-title {
    max-height: 33%;
    width: auto;
    max-width: 80vw;
    margin-top: 2%;
}

.p1-grandma {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: min(65dvh, 67%);
    /* Fixes floating: strictly anchors to the bottom edge */
    width: auto;
    max-width: none;
    /* Allows true horizontal scaling like mockup */
    pointer-events: none;
    z-index: 1;
}

.page-1 .content-zone {
    position: static;
    /* Allows Grandma to bypass content zone relative boundary */
}

.page-1 .footer-zone {
    pointer-events: none;
}

.page-1 .footer-zone a,
.page-1 .btn-next {
    pointer-events: auto;
}

.page-1 .btn-next {
    height: clamp(58px, 8dvh, 84px);
    max-height: 80%;
}

@media (max-width: 520px) {
    .p1-header {
        height: 34%;
        padding-top: clamp(18px, 4dvh, 36px);
    }

    .p1-logo {
        max-height: 26%;
    }

    .p1-title {
        max-width: 74vw;
        max-height: 31%;
    }

    .p1-grandma {
        height: min(60dvh, 64%);
    }
}

/* --- Page 2 --- */
.p2-content {
    justify-content: flex-start;
    padding: clamp(72px, 10dvh, 118px) 8% clamp(150px, 19dvh, 230px);
    text-align: center;
    gap: clamp(16px, 2.6dvh, 30px);
    overflow: hidden;
}

.p2-icons {
    max-height: min(32dvh, 330px);
    width: auto;
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    flex: 0 1 auto;
}

.p2-copy {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: clamp(10px, 1.5dvh, 18px);
    flex: 0 0 auto;
}

.p2-title {
    font-size: min(9vw, 5vh);
    font-weight: 700;
    color: #b74d06;
    margin: 0;
    line-height: 1.2;
}

.p2-desc {
    font-size: min(4.5vw, 2.5vh);
    font-weight: 600;
    color: #b74d06;
    margin: 0 auto;
    line-height: 1.4;
    max-width: 320px;
}

@media (max-height: 760px) {
    .p2-content {
        padding-top: clamp(40px, 7dvh, 72px);
        padding-bottom: clamp(130px, 18dvh, 180px);
        gap: clamp(8px, 1.7dvh, 16px);
    }

    .p2-icons {
        max-height: min(29dvh, 260px);
    }

    .p2-title {
        font-size: min(8vw, 4.2vh);
    }

    .p2-desc {
        font-size: min(4.1vw, 2.1vh);
        line-height: 1.32;
    }
}

/* --- Page 3 --- */
.p3-header {
    height: clamp(92px, 14dvh, 150px);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: clamp(4px, 1dvh, 10px);
}

.title-tamil {
    max-height: 55%;
    width: auto;
    max-width: 80%;
}

.tut-title {
    max-height: 62%;
    width: auto;
    max-width: 80%;
    display: block;
}

.p3-content {
    justify-content: flex-start;
    padding-top: clamp(4px, 1dvh, 12px);
    padding-bottom: clamp(155px, 22dvh, 240px);
}

.video-container {
    position: relative;
    height: min(100%, calc(100dvh - clamp(92px, 14dvh, 150px) - clamp(155px, 22dvh, 240px) - 24px), calc(90vw * 16 / 9));
    aspect-ratio: 9 / 16;
    max-width: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.video-container:hover {
    transform: scale(1.02);
}

.video-frame {
    height: 100%;
    width: 100%;
    display: block;
}

.tutorial-video {
    border-radius: min(4vw, 28px);
    background: rgba(0, 98, 210, 0.58);
    object-fit: contain;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.video-container.is-playing .play-overlay,
.video-container.is-complete .play-overlay {
    opacity: 0;
}

.play-bg {
    width: 100%;
    height: auto;
    position: absolute;
}

.play-icon {
    width: 35%;
    height: auto;
    position: absolute;
    z-index: 2;
    margin-left: 8%; /* Center alignment hack for play arrow */
}

/* --- Page 4 --- */
.p4-header {
    height: 18%;
}

.p4-content {
    justify-content: flex-start;
    padding-top: 2%;
}

.avatar-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8%;
    width: 100%;
    height: 70%;
}

.avatar-container {
    position: relative;
    max-height: 100%;
    height: 100%;
    aspect-ratio: 1;
    max-width: 40vw;
    cursor: pointer;
    border-radius: 50%;
}

.avatar-btn {
    height: 100%;
    width: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: min(0.6vw, 4px) solid transparent;
    transition: all 0.2s ease-out;
}

.avatar-container:hover .avatar-btn {
    transform: scale(1.02);
}

.avatar-container.selected .avatar-btn {
    border-color: #fdbb2d;
    box-shadow: 0 0 20px rgba(253, 187, 45, 0.8);
    transform: scale(1.05);
}

.tick-icon {
    position: absolute;
    bottom: 5%;
    right: 5%;
    width: 25%;
    height: auto;
    opacity: 0;
    transition: all 0.2s ease-out;
    transform: scale(0.5);
    z-index: 10;
    pointer-events: none;
}

.avatar-container.selected .tick-icon {
    opacity: 1;
    transform: scale(1);
}

.p4-bottom-zone {
    height: 48%;
    /* Takes up larger slice of screen */
    width: 100%;
    background-color: #1ea3ed;
    border-top-left-radius: min(8vw, 40px);
    border-top-right-radius: min(8vw, 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(12px, 1.9dvh, 22px);
    padding: clamp(42px, 7.2dvh, 76px) 0 clamp(22px, 4dvh, 42px);
    box-sizing: border-box;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.input-wrapper,
.select-wrapper {
    width: 85%;
    max-width: 400px;
    height: clamp(56px, 7dvh, 74px);
    min-height: 0;
    margin-bottom: 0;
    position: relative;
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
}

.styled-input {
    width: 100%;
    height: 100%;
    border-radius: 40px;
    background-color: #fdbb2d;
    border: min(0.6vw, 4px) solid #e17c00;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.4), 0 4px 6px rgba(0, 0, 0, 0.1);
    color: #444;
    font-size: min(4vw, 2.2vh);
    font-weight: 700;
    text-align: center;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.styled-input::placeholder {
    color: #85531b;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    color: #b74d06;
    pointer-events: none;
    font-size: min(3vw, 2vh);
}

.styled-select {
    width: 100%;
    appearance: none;
    cursor: pointer;
}

.p4-bottom-zone .btn-next {
    position: relative;
    top: auto;
    height: clamp(56px, 7dvh, 74px);
    max-height: none;
    margin-top: clamp(2px, 0.8dvh, 10px);
    flex: 0 0 auto;
}

@media (max-height: 760px) {
    .p4-bottom-zone {
        gap: clamp(8px, 1.5dvh, 14px);
        padding-top: clamp(30px, 5.6dvh, 48px);
        padding-bottom: clamp(14px, 3dvh, 28px);
    }

    .input-wrapper,
    .select-wrapper,
    .p4-bottom-zone .btn-next {
        height: clamp(48px, 6.4dvh, 62px);
    }
}

/* --- Page 5 Navigation --- */
.page-5 {
    background-image: url('./Pages\ UI\ assets/3.BACKGROUND.png');
    background-position: center bottom;
}

.p5-top-zone {
    width: 100%;
    height: 36%;
    flex-shrink: 0;
    background: url('./Pages\ UI\ assets/4.Group\ 801.png') bottom center / cover no-repeat, linear-gradient(135deg, #fcd036, #f29c1f);
    border-bottom-left-radius: 50% 20%;
    border-bottom-right-radius: 50% 20%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(48px, 7dvh, 78px) 7% clamp(16px, 2.8dvh, 28px);
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.p5-avatar-wrap {
    width: clamp(82px, 22vw, 128px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, #ffe285);
    padding: 1.5%;
    box-shadow: 0 6px 15px rgba(230, 140, 20, 0.4);
    margin-bottom: clamp(10px, 1.8dvh, 18px);
}

.p5-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: min(0.6vw, 3px) solid #ffae00;
}

.p5-title {
    width: min(92%, 680px);
    font-size: clamp(22px, 5vw, 38px);
    color: #fff;
    text-align: center;
    line-height: 1.3;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 0px #1ea3ed, -1px -1px 0px #1ea3ed, 1px -1px 0px #1ea3ed, -1px 1px 0px #1ea3ed, 0px 4px 8px rgba(0,0,0,0.3);
}

.p5-home-btn,
.p5-leaderboard-btn {
    position: absolute;
    top: clamp(18px, 4.5dvh, 42px);
    width: clamp(44px, 11vw, 70px);
    height: auto;
    z-index: 6;
    object-fit: contain;
    cursor: pointer;
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.22));
    transition: transform 0.2s ease;
}

.p5-home-btn {
    right: clamp(18px, 5vw, 48px);
}

.p5-leaderboard-btn {
    left: clamp(18px, 5vw, 48px);
}

.p5-home-btn:hover,
.p5-leaderboard-btn:hover {
    transform: scale(1.04);
}

.p5-grid-zone {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: clamp(14px, 3dvh, 24px) clamp(16px, 4vw, 28px);
    padding: clamp(18px, 3dvh, 34px) 9% clamp(28px, 5dvh, 52px);
    box-sizing: border-box;
    width: 100%;
    z-index: 1;
    align-content: start;
    justify-items: center;
}

.grid-img-btn {
    width: 100%;
    height: auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.grid-img-btn:hover {
    transform: scale(1.05);
}

.grid-img-btn img {
    width: min(100%, 190px);
    max-height: 190px;
    object-fit: contain;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.15));
}

.module-tutorial-modal {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4vw, 42px);
    box-sizing: border-box;
    background: rgba(0, 73, 140, 0.58);
    backdrop-filter: blur(3px);
}

.module-tutorial-modal.is-active {
    display: flex;
}

.module-tutorial-panel {
    position: relative;
    width: min(90vw, 720px);
    max-height: min(86dvh, 900px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2dvh, 22px);
    padding: clamp(44px, 6dvh, 70px) clamp(16px, 4vw, 36px) clamp(18px, 3dvh, 32px);
    box-sizing: border-box;
    border-radius: min(5vw, 30px);
    background: linear-gradient(180deg, rgba(38, 195, 235, 0.98), rgba(12, 139, 235, 0.98));
    box-shadow: 0 16px 34px rgba(0, 44, 94, 0.38);
}

.module-tutorial-close {
    position: absolute;
    top: clamp(10px, 2dvh, 18px);
    right: clamp(10px, 2.6vw, 22px);
    width: clamp(38px, 9vw, 58px);
    aspect-ratio: 1;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.25));
}

.module-tutorial-close img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.module-tutorial-heading {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 7vw, 54px);
    line-height: 1;
    font-weight: 700;
    text-align: center;
    text-shadow: 2px 2px 0 #0067c9, -1px -1px 0 #0067c9, 0 5px 8px rgba(0, 48, 104, 0.32);
}

.module-tutorial-video {
    width: min(100%, 640px);
    max-height: min(64dvh, 680px);
    border-radius: min(3vw, 20px);
    background: #001d38;
    object-fit: contain;
    box-shadow: 0 8px 18px rgba(0, 50, 100, 0.28);
}

@media (max-width: 520px) {
    .p5-top-zone {
        height: 35%;
        padding: clamp(44px, 6dvh, 62px) 5% clamp(14px, 2dvh, 22px);
    }

    .p5-avatar-wrap {
        width: clamp(76px, 21vw, 98px);
    }

    .p5-title {
        width: 96%;
        font-size: clamp(20px, 5.1vw, 27px);
        line-height: 1.22;
    }

    .p5-home-btn,
    .p5-leaderboard-btn {
        width: clamp(38px, 10vw, 52px);
        top: clamp(14px, 3dvh, 26px);
    }

    .p5-home-btn {
        right: clamp(14px, 4vw, 24px);
    }

    .p5-leaderboard-btn {
        left: clamp(14px, 4vw, 24px);
    }

    .p5-grid-zone {
        gap: clamp(16px, 4.2vw, 22px);
        padding: clamp(18px, 2.8dvh, 28px) 10% clamp(26px, 4dvh, 38px);
    }

    .grid-img-btn img {
        width: min(100%, 150px);
        max-height: 150px;
    }

    .module-tutorial-panel {
        width: 92vw;
        max-height: 88dvh;
        padding-top: clamp(46px, 7dvh, 62px);
    }

    .module-tutorial-video {
        max-height: 62dvh;
    }
}

.p5-footer {
    height: 12%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 15%;
    align-items: center;
}

.action-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.action-btn-wrapper:hover {
    transform: scale(1.05);
}

.action-circle {
    width: min(12vw, 45px);
    height: min(12vw, 45px);
    border-radius: 50%;
    background-color: #1ea3ed;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.4), 0 3px 6px rgba(0,0,0,0.2);
}

.action-circle svg {
    width: 50%;
    height: 50%;
    fill: #fff;
}

.action-label {
    font-size: min(3vw, 1.3vh);
    color: #888;
    font-weight: 600;
}

/* --- Page 6 Verses List --- */
.page-6 {
    background-image: url('./Pages\ UI\ assets/3.BACKGROUND.png');
    background-position: center bottom;
    flex-direction: column;
    justify-content: flex-start;
}

.p6-header {
    width: 100%;
    margin-top: 5vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.p6-home-btn {
    position: absolute;
    top: 0;
    left: 4vw;
    width: min(12vw, 50px);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
}

.p6-home-btn:hover {
    transform: scale(1.1);
}

.p6-title {
    width: 70%;
    max-width: 300px;
    margin-top: 4vh;
}

.p6-list-container {
    flex: 1;
    width: 90%;
    margin: 4vh auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
}

/* Custom Scrollbar */
.p6-list-container::-webkit-scrollbar {
    width: 6px;
}
.p6-list-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1); 
    border-radius: 10px;
}
.p6-list-container::-webkit-scrollbar-thumb {
    background: #FFD700; 
    border-radius: 10px;
}

.p6-verse-item {
    width: 100%;
    text-align: center;
    font-size: min(6.5vw, 36px);
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 0px #06406e, -2px -2px 0px #06406e, 2px -2px 0px #06406e, -2px 2px 0px #06406e, 0 4px 6px rgba(0,0,0,0.5);
    padding: 4vh 0;
    cursor: pointer;
    border-bottom: 2px solid #ffbe00;
    transition: transform 0.2s;
}

.p6-verse-item:last-child {
    border-bottom: none;
}

.p6-verse-item:hover {
    transform: scale(1.05);
}

/* Modal Styling */
.p6-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.p6-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.p6-modal-box {
    width: 85%;
    max-width: 400px;
    background: linear-gradient(180deg, #1ea3ed, #1682d4);
    border: 5px solid #fff;
    border-radius: 15px;
    padding: 25px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.p6-modal-overlay.active .p6-modal-box {
    transform: scale(1);
}

.p6-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-radius: 50%;
}

.p6-video-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    background-color: #f5f5f5;
    border: 8px solid #f29c1f;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.p6-play-icon {
    width: 50px;
    opacity: 0.9;
}

.p6-modal-text {
    font-size: min(5.5vw, 24px);
    font-weight: 700;
    color: #ffbe00;
    text-align: center;
    line-height: 1.4;
    text-shadow: 1px 1px 0px #611E02, -1px -1px 0px #611E02, 1px -1px 0px #611E02, -1px 1px 0px #611E02, 0 3px 5px rgba(0,0,0,0.4);
}

.p6-next-btn {
    margin-top: 25px;
    background: linear-gradient(180deg, #ffde00, #ff9d00);
    border: 2px solid #a65200;
    border-radius: 8px;
    padding: 10px 45px;
    color: #3b1c00;
    font-size: min(5vw, 22px);
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.6), 0 5px 10px rgba(0,0,0,0.4);
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s 0.1s, opacity 0.3s 0.1s;
}

.p6-modal-overlay.active .p6-next-btn {
    transform: scale(1);
    opacity: 1;
}

.p6-next-btn:active {
    transform: translateY(3px) scale(0.95);
}

/* --- Page 7 Self Learning List --- */
.page-7 {
    background-image: url('./Pages\ UI\ assets/3.BACKGROUND.png');
    background-position: center bottom;
    flex-direction: column;
    justify-content: flex-start;
}

.p7-list-container {
    flex: 1;
    width: 90%;
    margin: 4vh auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 10px;
}

.p7-list-container::-webkit-scrollbar { width: 6px; }
.p7-list-container::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 10px; }
.p7-list-container::-webkit-scrollbar-thumb { background: #FFD700; border-radius: 10px; }

.p7-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5vh 0;
    border-bottom: 2px solid #ffbe00;
    cursor: pointer;
    transition: transform 0.2s;
}

.p7-item.locked { opacity: 0.5; cursor: not-allowed; }
.p7-item.locked:hover { transform: none; }
.p7-item:hover { transform: scale(1.02); }

.p7-item-text { flex: 1; text-align: left; }

.p7-verse-title {
    font-size: min(6vw, 26px);
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 0px #06406e, -2px -2px 0px #06406e, 2px -2px 0px #06406e, -2px 2px 0px #06406e, 0 4px 6px rgba(0,0,0,0.5);
    margin: 0;
    line-height: 1.3;
}

.p7-verse-desc {
    font-size: min(3.5vw, 15px);
    color: #ffd859;
    font-weight: 600;
    margin-top: 3px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.p7-status-icon {
    width: min(10vw, 45px);
    height: min(10vw, 45px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 15px;
    flex-shrink: 0;
}

.p7-item.completed .p7-status-icon {
    background-color: #1ea3ed;
    border: 3px solid #fff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.p7-item.active .p7-status-icon {
    background: transparent;
}

.p7-item.active .p7-status-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0px 3px 5px rgba(0,0,0,0.4));
}

.p7-item.uncompleted .p7-status-icon {
    background-color: #555;
    border: 3px solid #888;
}

/* --- Page 8 Practice Screen --- */
.page-8 {
    background: radial-gradient(circle at center 30%, #ffffff 0%, #d6f2ff 100%);
    min-height: 100dvh;
    overflow: hidden;
}

.p8-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(18px, 5vw, 42px) clamp(16px, 5vw, 48px);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.p8-home-btn {
    width: clamp(52px, 13vw, 72px);
    height: clamp(52px, 13vw, 72px);
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

.p8-submit {
    background-color: #1ea3ed;
    color: white;
    border: 2px solid white;
    border-radius: 20px;
    padding: clamp(7px, 2vw, 10px) clamp(14px, 4vw, 22px);
    font-size: clamp(14px, 3.8vw, 18px);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
    font-family: inherit;
}

.p8-submit:hover { transform: scale(1.05); }

.p8-submit:disabled {
    opacity: 0.68;
    cursor: wait;
    transform: none;
}

.p8-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 1200;
    transform: translate(-50%, -50%) scale(0.92);
    padding: 14px 28px;
    border-radius: 18px;
    border: 3px solid #fff;
    background: linear-gradient(180deg, #23b7ff, #137bdc);
    color: #fff;
    font-size: clamp(20px, 5vw, 30px);
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.p8-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.page-8 button,
.page-8 img[onclick] {
    -webkit-tap-highlight-color: transparent;
}

.page-8 button:focus,
.page-8 button:active {
    outline: none;
}

.p8-top-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(48px, 10vh, 92px) 5% 0;
    z-index: 2;
    min-height: 0;
    box-sizing: border-box;
}

.p8-visualizer {
    width: min(72%, 320px);
    height: clamp(82px, 13dvh, 126px);
    margin-bottom: clamp(24px, 5vh, 46px);
    filter: drop-shadow(0px 5px 10px rgba(0,0,0,0.1));
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.p8-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.3vw, 8px);
}

.p8-waveform-bar {
    width: clamp(5px, 1.4vw, 8px);
    height: var(--wave-height, 24%);
    min-height: 12%;
    max-height: 96%;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff36a 0%, #ffc233 46%, #ff7f23 100%);
    transform-origin: center;
    transition: height 0.08s linear, opacity 0.16s ease;
}

.p8-waveform:not(.is-live) .p8-waveform-bar {
    animation: p8-idle-wave 1.4s ease-in-out infinite;
    animation-delay: calc(var(--bar-index, 0) * -0.06s);
}

@keyframes p8-idle-wave {
    0%, 100% { height: 24%; opacity: 0.62; }
    50% { height: calc(34% + (var(--bar-peak, 0.5) * 34%)); opacity: 0.95; }
}

.p8-verse-text {
    font-size: clamp(24px, 6.2vw, 42px);
    color: #ff9d00;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    max-width: min(88%, 680px);
    text-shadow: 2px 2px 0px #fff, -2px -2px 0px #fff, 2px -2px 0px #fff, -2px 2px 0px #fff, 0 4px 8px rgba(0,0,0,0.15);
}

.p8-verse-text span.blue-word {
    color: #1ea3ed;
}

.p8-bottom-zone {
    width: 100%;
    height: clamp(350px, 48%, 520px);
    flex-shrink: 0;
    background: url('./practice/Background.png') center top / 100% 100% no-repeat;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: clamp(34px, 7vw, 74px);
    box-sizing: border-box;
}

.p8-controls-main {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(16px, 6vw, 46px);
    margin-top: clamp(-98px, -13vw, -48px);
    width: 100%;
}

.p8-image-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    background-color: transparent;
    box-shadow: none;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.p8-listen-btn {
    width: clamp(62px, 16vw, 92px);
    height: clamp(62px, 16vw, 92px);
    border-radius: 50%;
}

.p8-listen-btn img,
.p8-record-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.p8-image-btn:hover { transform: scale(1.05); }

/* Play Preview (Right - dynamic) */
.p8-preview-btn {
    width: clamp(58px, 15vw, 82px);
    height: clamp(58px, 15vw, 82px);
    border-radius: 50%;
    background: linear-gradient(180deg, #1ea3ed, #06406e);
    border: 4px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}
.p8-preview-btn svg { width: 50%; fill: #fff; }
.p8-preview-btn:hover { transform: scale(1.05); }

/* Record Mic (Center) */
.p8-record-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    min-width: clamp(104px, 28vw, 150px);
    margin-top: clamp(-18px, -3vw, -8px);
}

.p8-record-btn {
    width: clamp(108px, 28vw, 156px);
    height: clamp(108px, 28vw, 156px);
    border-radius: 50%;
    position: relative;
    touch-action: none;
    transform-origin: center;
    filter: drop-shadow(0 7px 14px rgba(0,0,0,0.22));
    transition: transform 0.16s ease, filter 0.16s ease;
}

.p8-record-btn::before {
    content: "";
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    border: clamp(3px, 0.9vw, 5px) solid rgba(255, 218, 44, 0.58);
    opacity: 0;
    transform: scale(0.82);
    pointer-events: none;
}

.p8-record-progress {
    position: absolute;
    inset: -2%;
    border-radius: 50%;
    background: conic-gradient(#22a8ef var(--record-progress, 0deg), rgba(255,255,255,0.92) 0deg);
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.p8-record-progress::after {
    content: "";
    position: absolute;
    inset: clamp(5px, 1.3vw, 8px);
    border-radius: 50%;
    background: #fff;
}

.p8-record-btn img {
    position: relative;
    z-index: 1;
}

.p8-record-btn.is-recorded::after {
    content: "✓";
    position: absolute;
    right: 1%;
    bottom: 6%;
    z-index: 2;
    width: clamp(28px, 7vw, 40px);
    height: clamp(28px, 7vw, 40px);
    border-radius: 50%;
    background: #09b31d;
    border: 3px solid #fff;
    color: #fff;
    font-size: clamp(20px, 5vw, 30px);
    font-weight: 800;
    line-height: 1;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.22);
}

.p8-record-btn.is-recording {
    transform: scale(1.08);
    filter: drop-shadow(0 10px 22px rgba(0,0,0,0.28));
}

.p8-record-btn.is-recording::before {
    animation: recordOuterPulse 1.05s ease-out infinite;
}

.p8-record-btn.is-recording .p8-record-progress {
    opacity: 1;
    transform: scale(1);
    animation: recordProgressSpin 4s linear forwards;
}

@property --record-progress {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes recordOuterPulse {
    0% {
        opacity: 0.82;
        transform: scale(0.88);
    }
    70% {
        opacity: 0;
        transform: scale(1.28);
    }
    100% {
        opacity: 0;
        transform: scale(1.28);
    }
}

@keyframes recordProgressSpin {
    from {
        --record-progress: 0deg;
    }
    to {
        --record-progress: 360deg;
    }
}

.p8-record-hint {
    color: #fff;
    font-size: clamp(13px, 3.2vw, 16px);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 2px 5px rgba(0,0,0,0.28);
    white-space: nowrap;
}

.p8-controls-sub {
    display: flex;
    justify-content: space-evenly;
    width: min(92%, 560px);
    margin-top: clamp(36px, 6vh, 70px);
}

.p8-sub-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    background-color: transparent;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: inherit;
}

.p8-sub-btn:hover { transform: scale(1.05); }

.p8-sub-circle {
    width: clamp(50px, 13vw, 68px);
    height: clamp(50px, 13vw, 68px);
    object-fit: contain;
    display: block;
}

.p8-sub-text {
    color: #fff;
    font-size: clamp(13px, 3.5vw, 16px);
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    max-width: 96px;
}

@media (min-width: 700px) {
    .p8-top-section {
        padding-top: clamp(56px, 8vh, 100px);
    }

    .p8-bottom-zone {
        height: 46%;
        border-top-left-radius: 48% 18%;
        border-top-right-radius: 48% 18%;
    }

    .p8-controls-main {
        gap: clamp(34px, 7vw, 70px);
        margin-top: clamp(-112px, -9vw, -72px);
    }
}

/* --- Page 11 Leaderboard --- */
.page-11 {
    background:
        repeating-conic-gradient(from -10deg at 50% 0%, rgba(255,255,255,0.62) 0 9deg, rgba(226,244,250,0.72) 10deg 22deg);
    color: #fff;
    justify-content: flex-start;
}

.p11-home-btn {
    position: absolute;
    top: clamp(22px, 4.8vw, 48px);
    left: clamp(22px, 5vw, 56px);
    width: clamp(62px, 15vw, 92px);
    aspect-ratio: 1;
    object-fit: contain;
    z-index: 8;
    cursor: pointer;
    filter: drop-shadow(0 5px 6px rgba(0,0,0,0.22));
}

.p11-podium {
    position: relative;
    z-index: 4;
    height: 52%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1.18fr 1fr;
    align-items: end;
    gap: clamp(6px, 2vw, 22px);
    padding: clamp(70px, 9vh, 112px) clamp(18px, 5vw, 74px) clamp(22px, 3vh, 46px);
    box-sizing: border-box;
}

.p11-podium[data-count="1"] {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: clamp(78px, 10vh, 124px);
}

.p11-podium[data-count="2"] {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.p11-top-player {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.p11-first {
    align-self: start;
}

.p11-second,
.p11-third {
    padding-bottom: clamp(10px, 2vh, 36px);
}

.p11-avatar-ring {
    --ring-color: #f5a300;
    position: relative;
    width: clamp(112px, 24vw, 210px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    border: clamp(5px, 1.3vw, 10px) solid var(--ring-color);
    box-shadow: 0 8px 12px rgba(82,99,112,0.22);
}

.p11-first .p11-avatar-ring {
    width: clamp(138px, 27vw, 230px);
}

.p11-avatar-ring img {
    width: 92%;
    height: 92%;
    border-radius: 50%;
    object-fit: cover;
}

.p11-silver { --ring-color: #a5adb0; }
.p11-gold { --ring-color: #f5a300; }
.p11-bronze { --ring-color: #cf7c42; }

.p11-rank-medal {
    position: absolute;
    bottom: -13%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(52px, 11vw, 82px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #ffe233, #ff9000);
    border: 5px solid rgba(255,255,255,0.9);
    color: #3c2b20;
    font-size: clamp(26px, 6vw, 46px);
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 5px 7px rgba(0,0,0,0.24);
}

.p11-silver .p11-rank-medal { background: linear-gradient(180deg, #eff5f7, #a5adb0); }
.p11-bronze .p11-rank-medal { background: linear-gradient(180deg, #f9b17d, #b96d38); }
.p11-rank-medal sup { font-size: 0.42em; margin-left: 1px; }

.p11-top-player h2 {
    margin: clamp(24px, 3vh, 34px) 0 0;
    color: #24aef2;
    font-size: clamp(26px, 5.8vw, 48px);
    line-height: 1;
    text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff, 0 5px 4px rgba(0,94,176,0.42);
}

.p11-top-player strong {
    margin-top: 8px;
    color: #ff5b00;
    font-size: clamp(30px, 6.3vw, 54px);
    line-height: 1;
    text-shadow: -2px -2px 0 #ffd51d, 2px -2px 0 #ffd51d, -2px 2px 0 #ffd51d, 2px 2px 0 #ffd51d, 0 5px 5px rgba(117,48,0,0.4);
}

.p11-board {
    position: relative;
    z-index: 3;
    flex: 1;
    min-height: 0;
    width: 100%;
    margin-top: 0;
    padding: clamp(42px, 5vh, 76px) clamp(24px, 8vw, 92px) clamp(28px, 5vh, 54px);
    box-sizing: border-box;
    background: linear-gradient(180deg, #34c7e8, #0d8cf1);
    border-top-left-radius: 48% 9%;
    border-top-right-radius: 48% 9%;
    box-shadow: 0 -6px 14px rgba(0,120,190,0.18);
    overflow: hidden;
}

.p11-board::after {
    content: "";
    position: absolute;
    top: clamp(56px, 9vh, 112px);
    right: clamp(16px, 4vw, 34px);
    bottom: clamp(34px, 5vh, 58px);
    width: clamp(10px, 2vw, 20px);
    border-radius: 999px;
    background: rgba(10,110,202,0.72);
    box-shadow: inset 0 0 4px rgba(255,255,255,0.28);
}

.p11-list {
    height: 100%;
    overflow-y: auto;
    padding-right: clamp(16px, 4vw, 40px);
    padding-bottom: clamp(118px, 17vh, 168px);
    box-sizing: border-box;
    scrollbar-width: none;
}

.p11-list::-webkit-scrollbar { display: none; }

.p11-row {
    min-height: clamp(108px, 14vh, 180px);
    display: grid;
    grid-template-columns: clamp(82px, 17vw, 124px) 1fr;
    align-items: center;
    gap: clamp(14px, 4vw, 48px);
    border-bottom: clamp(4px, 0.8vw, 7px) solid #ffd21c;
    filter: drop-shadow(0 3px 3px rgba(4,68,124,0.28));
}

.p11-row-rank {
    width: clamp(52px, 11vw, 88px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    justify-self: center;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffe233, #ff9000);
    border: 5px solid #fff;
    color: #fff;
    font-size: clamp(28px, 7vw, 52px);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 3px 4px rgba(146,64,0,0.35);
}

.p11-row-rank sup { font-size: 0.38em; }

.p11-row-score span,
.p11-row-score strong {
    display: block;
    color: #fff;
    line-height: 1;
    font-weight: 700;
}

.p11-row-score span { font-size: clamp(28px, 7vw, 56px); font-weight: 600; }
.p11-row-score strong { margin-top: 8px; font-size: clamp(34px, 8vw, 66px); }

.p11-empty {
    margin: clamp(80px, 16vh, 180px) auto 0;
    width: 80%;
    color: #fff;
    font-size: clamp(28px, 6vw, 56px);
    font-weight: 800;
    text-align: center;
    text-shadow: 0 3px 5px rgba(0, 73, 130, 0.45);
}

.p11-actions {
    position: absolute;
    left: 50%;
    bottom: clamp(20px, 4vh, 42px);
    transform: translateX(-50%);
    width: min(56%, 460px);
    min-height: clamp(78px, 12vh, 128px);
    display: flex;
    justify-content: center;
    gap: clamp(22px, 6vw, 64px);
    padding: clamp(10px, 1.7vw, 18px) clamp(18px, 3.6vw, 46px);
    box-sizing: border-box;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe34a 0%, #ffb719 48%, #ff9100 100%);
    box-shadow: 0 8px 14px rgba(4,91,150,0.22), inset 0 2px 0 rgba(255,255,255,0.35);
}

.p11-action-btn {
    border: 0;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: clamp(12px, 3vw, 21px);
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.p11-action-btn:active {
    transform: scale(0.94);
}

.p11-action-btn.is-busy {
    opacity: 0.65;
    pointer-events: none;
}

.p11-action-circle {
    width: clamp(50px, 10vw, 82px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: transparent;
    position: relative;
    box-shadow: 0 4px 7px rgba(8, 75, 132, 0.18);
}

.p11-action-circle img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

@media (max-width: 520px), (max-height: 760px) {
    .p11-podium {
        height: 52%;
        min-height: 0;
        padding-top: clamp(58px, 8vh, 90px);
        padding-bottom: clamp(18px, 3vh, 34px);
    }

    .p11-podium[data-count="1"] {
        padding-top: clamp(68px, 9vh, 98px);
    }

    .p11-first .p11-avatar-ring {
        width: clamp(128px, 25vw, 196px);
    }

    .p11-top-player h2 {
        margin-top: clamp(22px, 3vh, 30px);
    }

    .p11-board {
        padding-top: clamp(34px, 4.5vh, 58px);
    }

    .p11-row {
        min-height: 104px;
        grid-template-columns: 74px 1fr;
        gap: 12px;
    }

    .p11-actions {
        width: min(78%, 430px);
        bottom: clamp(22px, 3.5vh, 34px);
    }
}

/* --- Page 9 Word Throw Game --- */
.page-9 {
    background:
        radial-gradient(circle at 50% 36%, rgba(255,255,255,0.96), rgba(214,244,255,0.72) 42%, rgba(99,204,240,0.74) 100%);
    background-position: center center;
    background-size: cover;
    color: #fff;
    isolation: isolate;
}

.p9-camera-video {
    position: absolute;
    inset: -2%;
    z-index: 0;
    width: 104%;
    height: 104%;
    object-fit: cover;
    opacity: 0;
    filter: blur(2px);
    transform: scale(1.03);
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.page-9.camera-active .p9-camera-video {
    opacity: 0.8;
}

.page-9.camera-error {
    background:
        radial-gradient(circle at 50% 30%, rgba(255,255,255,0.98), rgba(219,246,255,0.84) 42%, rgba(87,192,230,0.78) 100%);
}

.p9-screen-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.12) 42%, rgba(7,80,122,0.18) 100%);
    pointer-events: none;
}

.p9-drag-trail {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.p9-drag-trail.is-visible {
    opacity: 1;
}

.p9-drag-trail-line {
    stroke: rgba(17, 175, 233, 0.95);
    stroke-width: clamp(3px, 0.8vw, 7px);
    stroke-linecap: round;
    stroke-dasharray: 1 14;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.78));
}

.p9-header,
.p9-play-area {
    position: relative;
    z-index: 4;
}

.p9-header {
    min-height: 28%;
    padding: clamp(24px, 5vw, 52px) clamp(18px, 5vw, 54px) 0;
    box-sizing: border-box;
}

.p9-home-btn {
    position: absolute;
    top: clamp(22px, 4.8vw, 48px);
    left: clamp(22px, 5vw, 56px);
    width: clamp(66px, 18vw, 112px);
    aspect-ratio: 1;
    object-fit: contain;
    cursor: pointer;
    filter: drop-shadow(0 5px 6px rgba(0,0,0,0.28));
    transition: transform 0.2s ease;
}

.p9-home-btn:hover {
    transform: scale(1.04);
}

.p9-score {
    position: absolute;
    top: clamp(22px, 4.8vw, 48px);
    right: clamp(18px, 5vw, 54px);
    z-index: 3;
    min-width: clamp(86px, 20vw, 132px);
    padding: 6px 12px;
    border: 3px solid #fff;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffcf25, #ff8b00);
    color: #513000;
    font-size: clamp(15px, 3.8vw, 22px);
    font-weight: 700;
    text-align: center;
    box-shadow: 0 5px 8px rgba(0,0,0,0.22);
}

.p9-instruction {
    margin: clamp(72px, 11vh, 122px) auto 0;
    max-width: min(86%, 760px);
    color: #fff;
    text-align: center;
    font-size: clamp(28px, 7.2vw, 58px);
    line-height: 1.22;
    font-weight: 700;
    letter-spacing: 0;
    text-shadow:
        0 3px 0 #1d72e0,
        0 0 4px #00c9ff,
        0 5px 8px rgba(0,0,0,0.34);
}

.p9-play-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    padding: 0 clamp(14px, 4vw, 48px) max(28px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.p9-question-card {
    position: relative;
    width: min(86%, 820px);
    margin-top: clamp(12px, 2.8vh, 34px);
    filter: drop-shadow(0 8px 7px rgba(98,41,0,0.35));
}

.p9-question-image {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}

.p9-answer-fill {
    position: absolute;
    top: var(--fill-top, 50%);
    left: var(--fill-left, 50%);
    width: var(--fill-width, 24%);
    z-index: 24;
    transform: translate(-50%, -50%) scale(0.92);
    color: #302328;
    background: transparent;
    border-radius: 0;
    padding: 0;
    text-align: center;
    font-size: var(--fill-font, clamp(18px, 4.5vw, 38px));
    font-weight: 700;
    line-height: 1.1;
    opacity: 0;
    transition: opacity 0.24s ease, transform 0.24s ease;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    text-shadow: none;
}

.p9-answer-fill.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: p9FillPop 0.42s ease-out;
}

.p9-ball-burst {
    position: absolute;
    z-index: 18;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.p9-ball-burst::before {
    content: "";
    position: absolute;
    inset: -28px;
    border: 4px solid rgba(255, 233, 35, 0.62);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(255, 245, 73, 0.58);
    animation: p9BurstRing 0.72s ease-out forwards;
}

.p9-ball-burst span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(7px, 1.6vw, 13px);
    height: clamp(7px, 1.6vw, 13px);
    border-radius: 50%;
    background: radial-gradient(circle, #fff9a8 0 28%, #ffd322 34% 68%, #ff8d00 100%);
    box-shadow: 0 0 10px rgba(255, 220, 40, 0.95);
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1);
    animation: p9BurstParticle 0.78s ease-out forwards;
    animation-delay: calc(var(--i) * 0.012s);
}

.p9-status {
    min-height: 1.4em;
    margin: clamp(10px, 2.2vh, 24px) 0 0;
    color: #fff;
    font-size: clamp(18px, 4.4vw, 28px);
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.45);
}

.p9-answers {
    flex: 1;
    width: min(92%, 880px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    align-items: center;
    justify-items: center;
    gap: clamp(14px, 3vh, 34px) clamp(20px, 5vw, 72px);
    min-height: 0;
    padding-bottom: clamp(18px, 4vh, 52px);
    box-sizing: border-box;
}

.p9-answer-option {
    position: relative;
    border: 0;
    background: transparent;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 0.22s ease, opacity 0.22s ease;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.p9-answer-option:hover {
    transform: translateY(-4px);
}

.p9-answer-option:disabled {
    cursor: default;
}

.p9-answer-option.is-disabled {
    opacity: 0.45;
}

.p9-answer-option.is-dragging {
    z-index: 8;
}

.p9-answer-option.is-dragging .p9-ball-wrap {
    transition: none;
    filter: drop-shadow(0 0 20px rgba(255,232,0,0.95));
}

.p9-ball-wrap {
    position: relative;
    display: block;
    width: clamp(118px, 23vw, 210px);
    aspect-ratio: 1;
    filter: drop-shadow(0 0 13px rgba(45,211,255,0.85));
    transition: transform 0.5s cubic-bezier(.2,.9,.25,1), filter 0.22s ease;
}

.p9-answers .p9-throw-arrow,
.p9-answers .p9-ball-text {
    display: none;
}

.p9-ball {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.p9-ball-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: clamp(28px, 7.5vw, 58px);
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-shadow:
        -2px -2px 0 #4b3337,
        2px -2px 0 #4b3337,
        -2px 2px 0 #4b3337,
        2px 2px 0 #4b3337,
        0 4px 4px rgba(0,0,0,0.32);
    pointer-events: none;
}

.p9-throw-arrow {
    position: absolute;
    bottom: min(32vw, 218px);
    width: clamp(58px, 14vw, 106px);
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 5px 6px rgba(149,89,0,0.4));
    animation: p9ArrowFloat 1.6s ease-in-out infinite;
}

.p9-throw-arrow-left {
    left: 22%;
}

.p9-throw-arrow-right {
    right: 22%;
}

.p9-answer-option.is-wrong .p9-ball-wrap {
    animation: p9WrongShake 0.36s ease;
    filter: drop-shadow(0 0 13px rgba(255,75,62,0.8));
}

.p9-answer-option.is-correct .p9-ball-wrap {
    filter: drop-shadow(0 0 18px rgba(255,232,0,0.95));
}

.p9-answer-option.is-thrown .p9-ball-wrap {
    transform: translateY(clamp(-230px, -32vh, -360px)) scale(0.42);
    opacity: 0;
}

.p9-answer-option.is-thrown .p9-throw-arrow {
    opacity: 0;
}

@keyframes p9ArrowFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes p9WrongShake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    50% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-5px);
    }
}

@keyframes p9FillPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.72);
    }

    58% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.16);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes p9BurstRing {
    0% {
        opacity: 1;
        transform: scale(0.12);
    }

    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

@keyframes p9BurstParticle {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(clamp(42px, 8vw, 78px)) scale(0.22);
    }
}

@media (min-width: 700px) {
    .p9-header {
        min-height: 30%;
    }

    .p9-question-card {
        width: min(78%, 820px);
    }

    .p9-answers {
        width: min(84%, 820px);
        padding-bottom: clamp(24px, 5vh, 68px);
    }

    .p9-ball-wrap {
        width: clamp(150px, 20vw, 220px);
    }
}

@media (max-height: 760px) {
    .p9-header {
        min-height: 25%;
    }

    .p9-instruction {
        margin-top: clamp(56px, 8vh, 76px);
        font-size: clamp(24px, 6vw, 42px);
    }

    .p9-question-card {
        margin-top: 0;
        width: min(78%, 700px);
    }

    .p9-answers {
        padding-bottom: clamp(14px, 3vh, 36px);
    }

    .p9-ball-wrap {
        width: clamp(112px, 20vw, 180px);
    }
}
