@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;
    overflow: hidden;
    /* Prevent scrolling entirely */
    font-family: 'Baloo 2', sans-serif;
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-app {
    width: 100%;
    height: 100%;
    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 {
    height: calc(15% + env(safe-area-inset-bottom, 0px));
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 20;
    padding-top: 1vh;
    padding-bottom: max(2vh, 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.vo-pending #submitProfileBtn,
body.vo-pending .grid-img-btn,
body.vo-pending .p6-home-btn,
body.vo-pending .p8-home-btn,
body.vo-pending .p8-submit,
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 1 --- */
.p1-header {
    justify-content: flex-start;
    padding-top: 5vh;
}

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

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

.p1-grandma {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 72%;
    /* 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 2 --- */
.p2-content {
    justify-content: center;
    padding: 0 8%;
    text-align: center;
}

.p2-icons {
    max-height: 50%;
    width: auto;
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 2vh;
}

.p2-title {
    font-size: min(9vw, 5vh);
    font-weight: 700;
    color: #b74d06;
    margin: 0 0 2vh 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;
}

/* --- Page 3 --- */
.p3-header {
    height: 25%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 2%;
}

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

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

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

.video-container {
    position: relative;
    max-height: 90%;
    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 {
    max-height: 100%;
    width: auto;
    max-width: 100%;
    display: block;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.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: center;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.input-wrapper,
.select-wrapper {
    width: 85%;
    max-width: 400px;
    height: 20%;
    min-height: 45px;
    margin-bottom: 4%;
    position: relative;
    display: flex;
    justify-content: center;
}

.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 {
    max-height: 22%;
    margin-top: 2%;
}

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

.p5-top-zone {
    width: 100%;
    height: 35%;
    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: flex-end;
    align-items: center;
    padding-bottom: 3%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.p5-avatar-wrap {
    width: min(28vw, 130px);
    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: min(3vh, 15px);
}

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

.p5-title {
    font-size: min(5.5vw, 2.6vh);
    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-grid-zone {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: min(4vw, 15px);
    padding: 2% 8%;
    box-sizing: border-box;
    width: 100%;
    z-index: 1;
    align-content: center;
}

.grid-img-btn {
    width: 100%;
    height: 100%;
    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: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.15));
}

.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;
}

.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;
}

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

.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);
    max-height: 120px;
    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-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(360px, 50%, 520px);
    flex-shrink: 0;
    background: linear-gradient(180deg, #30a9ed, #1682d4);
    border-top-left-radius: 50% 16%;
    border-top-right-radius: 50% 16%;
    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(32px, 7vw, 72px);
    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%;
}

/* Listen Reference (Left) */
.p8-listen-btn {
    width: clamp(58px, 15vw, 82px);
    height: clamp(58px, 15vw, 82px);
    border-radius: 50%;
    background: linear-gradient(180deg, #ffcd00, #ff8c00);
    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: transform 0.2s;
    flex-shrink: 0;
}
.p8-listen-btn svg { width: 50%; fill: #fff; }
.p8-listen-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;
}
.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(92px, 24vw, 132px);
    height: clamp(92px, 24vw, 132px);
    border-radius: 50%;
    background: linear-gradient(180deg, #ffcd00, #ff8c00);
    border: clamp(5px, 1.5vw, 8px) solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.p8-record-btn.is-recording {
    animation: recordPulse 1s ease-in-out infinite;
}

@keyframes recordPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(0,0,0,0.3), 0 0 0 0 rgba(255, 196, 0, 0.65);
    }
    70% {
        transform: scale(1.08);
        box-shadow: 0 8px 26px rgba(0,0,0,0.34), 0 0 0 18px rgba(255, 196, 0, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 6px 20px rgba(0,0,0,0.3), 0 0 0 0 rgba(255, 196, 0, 0);
    }
}

.p8-record-btn img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    transition: transform 0.2s, opacity 0.2s;
}

.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 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.p8-sub-circle {
    width: clamp(46px, 12vw, 62px);
    height: clamp(46px, 12vw, 62px);
    border-radius: 50%;
    background: linear-gradient(180deg, #ffcd00, #ff8c00);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}

.p8-sub-circle svg { width: 45%; fill: #fff; }

.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);
    }
}
