/* 
   Sugarplum - Design System 
   Vibe: Soft, Girly, Cozy, Emotionally Safe
*/

:root {
    /* Palette - Default (Soft Blush/Cream) */
    --c-bg: #FFF5F5;
    /* Very light blush */
    --c-bg-gradient: linear-gradient(135deg, #FFF5F5 0%, #FFF0F5 100%);
    --c-text-main: #5D4E58;
    /* Soft charcoal/plum */
    --c-text-light: #8E7D8A;
    --c-primary: #E8A0BF;
    /* Soft pink */
    --c-primary-soft: #FBCfe8;
    --c-accent: #BA90C6;
    /* Lilac/Sugarplum */

    --c-card-bg: rgba(255, 255, 255, 0.6);
    --c-card-border: rgba(255, 255, 255, 0.8);

    --shadow-soft: 0 10px 40px -10px rgba(232, 160, 191, 0.2);
    --shadow-hover: 0 20px 50px -10px rgba(232, 160, 191, 0.4);

    --font-main: 'Quicksand', sans-serif;
    --font-body: 'Nunito', sans-serif;

    --radius-lg: 24px;
    --radius-xl: 40px;
    --radius-full: 9999px;

    --anim-slow: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    --anim-med: 0.4s ease-out;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--c-text-main);
    background: var(--c-bg);
    overflow: hidden;
    /* App-like feel */
    height: 100vh;
    width: 100vw;
    transition: background 1s ease;
}

button {
    font-family: var(--font-main);
    border: none;
    cursor: pointer;
    background: none;
    color: inherit;
    transition: all var(--anim-med);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-main);
    font-weight: 700;
    color: var(--c-text-main);
}

/* Rich Pattern Background */
.background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #fff0f5, #ffe4e1, #fff5f5);
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    /* Increased blur */
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    background: #E8A0BF;
    width: 70vh;
    height: 70vh;
    top: -20%;
    left: -20%;
}

.blob-2 {
    background: #BA90C6;
    width: 60vh;
    height: 60vh;
    bottom: -20%;
    right: -20%;
    animation-delay: -5s;
}

.blob-3 {
    background: #FBCfe8;
    width: 50vh;
    height: 50vh;
    bottom: 10%;
    left: 30%;
    animation-delay: -10s;
}

/* Attractive Intro Elements */
.soft-cta {
    margin-top: 3rem;
    padding: 1rem 4rem;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--c-primary);
    border-radius: var(--radius-full);
    box-shadow: 0 10px 30px rgba(232, 160, 191, 0.3);
    font-weight: 700;
    border: 2px solid white;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.soft-cta:hover {
    transform: translateY(-5px) scale(1.05);
    background: white;
    box-shadow: 0 15px 40px rgba(232, 160, 191, 0.5);
    color: var(--c-accent);
}

.companion-visual {
    display: flex !important;
    opacity: 1 !important;
    height: 220px !important;
    overflow: visible !important;
    width: 100%;
}


.blob-2 {
    background: var(--c-accent);
    width: 50vh;
    height: 50vh;
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
    opacity: 0.4;
}

.blob-3 {
    background: #FFE4E1;
    width: 40vh;
    height: 40vh;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

#ambient-player {
    display: none;
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Typography & Layout */
#app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Landing Layout - Responsive */
/* Landing Layout - Responsive */
.landing-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: center;
    gap: 3rem;
    /* More breathing room */
}

.landing-content {
    width: 100%;
    text-align: center;
}

.side-visual {
    order: -1;
    /* Top on mobile */
    height: 250px !important;
    /* Larger on mobile */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.side-visual .companion-emoji {
    font-size: 8rem;
    /* Mobile Size */
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    .landing-layout {
        flex-direction: row;
        /* Side by side on Desktop */
        justify-content: center;
        /* Center everything */
        align-items: center;
        text-align: left;
        padding: 0 5%;
        gap: 6rem;
        /* Big gap between text and bear */
    }

    .landing-content {
        flex: 1;
        text-align: left;
        max-width: none;
        padding-right: 2rem;
    }

    /* Force the screen to be wider on desktop */
    #screen-landing {
        max-width: 1200px !important;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .mood-grid {
        display: grid;
        /* Force 3 columns so it looks "spread" and not like a list */
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        width: 100%;
    }

    .breathing-text {
        text-align: left;
        margin-bottom: 2rem;
    }

    .breathing-text h1 {
        font-size: 3.5rem;
    }

    .side-visual {
        order: 1;
        /* Right side on desktop */
        flex: 0 0 auto;
        height: auto !important;
        width: auto;
    }

    .side-visual .companion-emoji {
        font-size: 15rem;
        /* HUGE on desktop (User Request) */
    }
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    max-width: 600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: opacity 0.8s ease,
        transform 0.8s ease;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 10;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

.content-center {
    margin: auto;
    text-align: center;
    width: 100%;
}

/* Landing Screen */
.breathing-text {
    animation: breathe 6s infinite ease-in-out;
    margin-bottom: 3rem;
    text-align: center;
}

.breathing-text h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #E8A0BF, #BA90C6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 10px rgba(232, 160, 191, 0.2));
}

.breathing-text h2 {
    font-size: 1.5rem;
    color: var(--c-text-light);
    font-weight: 500;
}

.mood-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.mood-grid button:last-child {
    grid-column: span 2;
}

.mood-btn {
    background: var(--c-card-bg);
    border: 1px solid var(--c-card-border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.mood-btn:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-hover);
}

.mood-btn .emoji {
    font-size: 2rem;
}

.mood-btn .label {
    font-weight: 700;
    color: var(--c-text-main);
}

/* Companion Grid */
.companion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 400px;
}

.companion-grid button:nth-last-child(1):nth-child(odd) {
    grid-column: span 2;
    /* Center last one if odd */
}

.companion-btn {
    background: var(--c-card-bg);
    border: 1px solid var(--c-card-border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.companion-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: white;
    box-shadow: var(--shadow-hover);
    border-color: var(--c-primary);
}

.companion-btn .emoji {
    font-size: 3rem;
}

.companion-btn .label {
    font-weight: 700;
    color: var(--c-text-main);
    font-size: 0.9rem;
}

.companion-btn.selected {
    background: var(--c-primary);
    color: white;
    border-color: transparent;
}

.companion-btn.selected .label {
    color: white;
}


/* Transition Vignette */
.transition-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 30%, #2C1A21 100%);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transition: opacity 1.5s ease-in-out;
}

/* Pamper Screen */
.gentle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
}

.icon-btn {
    font-size: 1.5rem;
    padding: 0.5rem;
    opacity: 0.6;
}

.icon-btn:hover {
    opacity: 1;
}

.logo {
    font-family: var(--font-main);
    font-weight: 700;
    color: var(--c-primary);
    letter-spacing: 1px;
}

.pill-btn {
    background: rgba(0, 0, 0, 0.03);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.pill-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.pamper-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    /* Hide scrollbar */
    padding-bottom: 2rem;
}

.message-area {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.5rem;
    color: var(--c-text-main);
    font-weight: 600;
    line-height: 1.4;
    padding: 1.5rem 0;
    animation: breathe 5s infinite;
}

.comfort-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 1s;
    /* Delay appearance */
}

.comfort-dashboard.visible {
    opacity: 1;
    transform: translateY(0);
}

.card {
    background: var(--c-card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--c-text-light);
}

/* --- Audio Card --- */
.audio-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-info .icon {
    font-size: 1.5rem;
    color: var(--c-primary);
}

.text-group {
    display: flex;
    flex-direction: column;
}

.text-group .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--c-text-light);
    letter-spacing: 0.5px;
}

.text-group h4 {
    margin: 0;
    font-size: 1rem;
}

.soft-caption {
    font-size: 0.9rem;
    color: var(--c-text-light);
    font-style: italic;
    margin-left: auto;
}


/* --- Panda Card & Animations --- */
.panda-card {
    text-align: center;
    background: radial-gradient(circle at center, white 0%, rgba(255, 255, 255, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Companion Visual */
.companion-visual {
    position: relative;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.companion-emoji {
    font-size: 8rem;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

/* Kiss Animation */
@keyframes kiss {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(-10deg);
    }

    50% {
        transform: scale(1.1) rotate(10deg);
    }

    75% {
        transform: scale(1.2) translateY(-5px);
    }
}

.companion-visual.panda-kissing .companion-emoji {
    animation: kiss 2s infinite ease-in-out;
}

/* Specific Modes mapped to companion */
.panda-rocking .companion-emoji {
    animation: rock 3s infinite ease-in-out;
}

.panda-hugging .companion-emoji {
    animation: squeeze 2s infinite ease-in-out;
}

.panda-slow_hug .companion-emoji {
    animation: squeeze 4s infinite ease-in-out;
}

.panda-lying_down .companion-emoji {
    transform: rotate(90deg);
    opacity: 0.8;
    animation: breathe 4s infinite;
}

.panda-sitting .companion-emoji {
    animation: sit 5s infinite;
}

.panda-overlay {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--c-text-main);
    background: rgba(255, 255, 255, 0.8);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
}

/* Specific Panda Modes */
.panda-rocking .panda-emoji {
    animation: rock 3s infinite ease-in-out;
}

.panda-hugging .panda-emoji {
    animation: squeeze 2s infinite ease-in-out;
}

.panda-slow_hug .panda-emoji {
    animation: squeeze 4s infinite ease-in-out;
}

.panda-lying_down .panda-emoji {
    transform: rotate(90deg);
    opacity: 0.8;
    animation: breathe 4s infinite;
}

.panda-sitting .panda-emoji {
    animation: sit 5s infinite;
}

@keyframes rock {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

@keyframes squeeze {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes sit {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

/* Body Map */
.body-map {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    position: relative;
    z-index: 20;
    padding-bottom: 0.5rem;
    /* Ensure space for bottom row */
    width: 100%;
}

.body-card {
    position: relative;
    z-index: 15;
}

.body-part {
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid transparent;
    font-size: 0.9rem;
    position: relative;
    z-index: 25;
    cursor: pointer;
    pointer-events: auto !important;
    user-select: none;
}

.body-part:hover,
.body-part.active {
    background: var(--c-primary);
    color: white;
    transform: scale(1.05);
}

.soft-feedback {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--c-text-main);
    font-style: italic;
    min-height: 1.5em;
    /* Prevent jump */
}

/* Suggestions using dynamic list */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.3s;
}

.suggestion:hover {
    background: rgba(255, 255, 255, 0.8);
}

.suggestion .icon {
    font-size: 1.5rem;
}

.soft-cta {
    width: 100%;
    padding: 1.2rem;
    background: white;
    color: var(--c-accent);
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.soft-cta:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Safe Mode */
.safe-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2C1A21;
    /* Dark plum */
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #E8A0BF;
    transition: opacity 1.5s ease;
}

.safe-mode.hidden {
    opacity: 0;
    pointer-events: none;
}

.breathing-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(232, 160, 191, 0.2);
    box-shadow: 0 0 40px rgba(232, 160, 191, 0.1);
    animation: breathe 5s infinite ease-in-out;
}

.ghost-btn {
    margin-top: 3rem;
    opacity: 0.5;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
}

.ghost-btn:hover {
    opacity: 1;
    border-color: currentColor;
}

/* Utility */
.hidden-delayed {
    opacity: 0;
}

.hidden-delayed.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Big Feelings Mode additions */

.big-feelings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: var(--c-bg-gradient);
    /* Inherits mood */
    transition: opacity 1s ease;
    overflow: hidden;
}

.big-feelings-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.big-text-container {
    z-index: 10;
    text-align: center;
    max-width: 800px;
    min-height: 200px;
    /* Prevent layout shifts */
    display: flex;
    align-items: center;
    justify-content: center;
}

.big-text-container h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.2;
    font-weight: 800;
    color: var(--c-text-main);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.big-text-container h2.show {
    opacity: 1;
    transform: translateY(0);
}

/* Floating Emojis */
#floating-emojis-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.float-emoji {
    position: absolute;
    font-size: clamp(2rem, 6vw, 5rem);
    opacity: 0.15;
    animation: floatingUp 15s linear infinite;
    user-select: none;
}

@keyframes floatingUp {
    0% {
        transform: translateY(110vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.2;
    }

    90% {
        opacity: 0.2;
    }

    100% {
        transform: translateY(-10vh) rotate(20deg);
        opacity: 0;
    }
}

/* Voice Toggle */
.voice-toggle {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--c-text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    opacity: 0.8;
}

.voice-toggle:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    opacity: 1;
}

.voice-toggle.active {
    background: var(--c-primary);
    color: white;
    border-color: transparent;
    opacity: 1;
    box-shadow: 0 4px 15px rgba(232, 160, 191, 0.4);
}

.voice-toggle .icon {
    font-size: 1.1rem;
}

/* Utility */
.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.visible {
    opacity: 1;
    pointer-events: auto;
}

.hidden-delayed {
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease 1s;
    /* Delay hiding */
}

/* Activity Screen (Interactive Relief) */
.activity-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.activity-ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass to canvas */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
}

.activity-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--c-primary);
    opacity: 0.7;
    margin-top: 2rem;
}

.fixed-bottom {
    align-self: center;
    margin-bottom: 2rem;
    pointer-events: auto !important;
    /* Button clickable */
    position: relative;
    z-index: 10;
}

/* 1. Breathe Mode */
.breathe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
}

.breathe-blob {
    width: 200px;
    height: 200px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    box-shadow: 0 0 60px var(--c-primary);
    animation: organicBreathe 10s infinite ease-in-out;
    transition: all 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.breathe-instruction {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--c-text-main);
    z-index: 10;
    opacity: 0.8;
    pointer-events: none;
    letter-spacing: 1px;
}

@keyframes organicBreathe {
    0% {
        transform: scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    40% {
        /* Inhale Peak */
        transform: scale(2);
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    60% {
        /* Hold */
        transform: scale(2);
        border-radius: 65% 35% 30% 70% / 60% 30% 70% 40%;
    }

    100% {
        /* Exhale Finish */
        transform: scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

/* --- Interactive Activities Styles --- */

/* 1. Breathe Mode (Pain) */
.breathe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
}

.breathe-blob {
    width: 200px;
    height: 200px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    box-shadow: 0 0 60px var(--c-primary);
    animation: organicBreathe 10s infinite ease-in-out;
    transition: all 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.breathe-instruction {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--c-text-main);
    z-index: 10;
    opacity: 0.8;
    pointer-events: none;
    letter-spacing: 1px;
}

@keyframes organicBreathe {
    0% {
        transform: scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    40% {
        /* Inhale Peak */
        transform: scale(2);
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    60% {
        /* Hold */
        transform: scale(2);
        border-radius: 65% 35% 30% 70% / 60% 30% 70% 40%;
    }

    100% {
        /* Exhale Finish */
        transform: scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

/* 2. Release Tap Dots (Pain) */
.pressure-dot {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: float 4s infinite ease-in-out;
}

.pressure-dot:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

/* 3. Comic Bubbles (Irritated) */
.comic-bubble {
    position: absolute;
    background: white;
    border: 3px solid black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.2);
}

.comic-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20%;
    width: 20px;
    height: 20px;
    background: white;
    border-right: 3px solid black;
    border-bottom: 3px solid black;
    transform: rotate(45deg);
}

.pop-effect {
    position: fixed;
    font-size: 2rem;
    font-weight: 900;
    color: var(--c-primary);
    animation: popScale 0.3s ease-out forwards;
    pointer-events: none;
    text-shadow: 2px 2px 0 white;
    z-index: 9999;
}

@keyframes popScale {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   ACTION BUTTONS (Craving & Chat Buddy)
   ============================================ */

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 600px;
}

.action-btn {
    flex: 1;
    background: var(--c-card-bg);
    border: 2px solid var(--c-card-border);
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 1rem;
    color: var(--c-text-main);
}

.action-btn:hover {
    transform: translateY(-3px);
    background: white;
    box-shadow: var(--shadow-hover);
    border-color: var(--c-primary);
}

.action-btn .emoji {
    font-size: 1.8rem;
}

.action-btn .label {
    font-family: var(--font-main);
}

/* ============================================
   CHAT BUDDY SCREEN
   ============================================ */

#screen-chat {
    max-width: 700px;
    padding: 1.5rem;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    gap: 1rem;
}

/* Companion Visual in Chat */
.chat-companion-visual {
    text-align: center;
    padding: 1rem 0;
    animation: breathe 6s infinite ease-in-out;
}

.chat-companion-visual .companion-emoji {
    font-size: 5rem;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    scrollbar-width: thin;
    scrollbar-color: var(--c-primary-soft) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--c-primary-soft);
    border-radius: 3px;
}

/* Message Bubbles */
.message-bubble {
    max-width: 80%;
    padding: 0.9rem 1.2rem;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Messages (Right-aligned) */
.message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(232, 160, 191, 0.3);
}

/* Chat Buddy Messages (Left-aligned) */
.message-buddy {
    align-self: flex-start;
    background: white;
    color: var(--c-text-main);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(232, 160, 191, 0.2);
}

/* Typing Indicator */
.typing-indicator {
    align-self: flex-start;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--c-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

#chat-input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    background: white;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--c-text-main);
    transition: all 0.3s ease;
    outline: none;
}

#chat-input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(232, 160, 191, 0.1);
}

#chat-input::placeholder {
    color: var(--c-text-light);
    opacity: 0.6;
}

.chat-send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(232, 160, 191, 0.4);
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(232, 160, 191, 0.6);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn span {
    font-size: 1.5rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .action-buttons {
        flex-direction: column;
    }

    .chat-companion-visual .companion-emoji {
        font-size: 4rem;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 0.9rem;
    }
}

/* --- Cloud Drift Mode --- */
.drift-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: background 2s ease;
    z-index: 0;
}

.sky-day {
    background: linear-gradient(to bottom, #A1C4FD 0%, #C2E9FB 100%);
    /* Soft Pastel Blue */
}

.sky-night {
    background: linear-gradient(to bottom, #0F2027 0%, #203A43 50%, #2C5364 100%);
    /* Deep Navy/Indigo */
}

/* Clouds - Fluffy & Soft */
.cloud {
    background: #fff;
    width: 200px;
    height: 60px;
    border-radius: 200px;
    position: absolute;
    opacity: 0.9;
    filter: blur(8px);
    /* Soft glow/fluff */
    transition: opacity 1s ease;
}

.cloud::after,
.cloud::before {
    content: '';
    position: absolute;
    background: #fff;
    width: 100px;
    height: 80px;
    top: -15px;
    left: 10px;
    border-radius: 100px;
    transform: rotate(30deg);
}

.cloud::after {
    width: 120px;
    height: 120px;
    top: -55px;
    left: auto;
    right: 15px;
}

/* Cloud Positions & Animation */
.cloud-1 {
    top: 15%;
    left: -20%;
    transform: scale(1.2);
    animation: drift 60s linear infinite;
}

.cloud-2 {
    top: 40%;
    left: -20%;
    transform: scale(0.8);
    animation: drift 80s linear infinite;
    animation-delay: -20s;
}

.cloud-3 {
    top: 25%;
    left: -20%;
    transform: scale(1.5);
    animation: drift 100s linear infinite;
    animation-delay: -50s;
}

/* Slower */
.cloud-4 {
    top: 60%;
    left: -20%;
    transform: scale(1);
    opacity: 0.8;
    animation: drift 70s linear infinite;
    animation-delay: -10s;
}

.sky-night .cloud {
    opacity: 0.15;
    /* Transparent in night */
    background: #B0C7D9;
    /* Blueish tint */
}

.sky-night .cloud::after,
.sky-night .cloud::before {
    background: #B0C7D9;
}

@keyframes drift {
    0% {
        left: -30%;
    }

    100% {
        left: 120%;
    }
}

/* Moon */
.moon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #FFF9C4;
    /* Soft yellow */
    box-shadow: 0 0 40px #FFF9C4;
    position: absolute;
    top: 10%;
    right: 15%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 2s ease;
}

.sky-night .moon {
    opacity: 1;
    transform: translateY(0);
}

/* Stars */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 4s infinite ease-in-out;
}

.sky-night .star {
    opacity: 0.8;
    /* Base opacity */
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Shooting Star */
/* Shooting Star */
.shooting-star {
    position: absolute;
    height: 2px;
    background: linear-gradient(-45deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
    animation: shoot 2s ease-out forwards;
    opacity: 0;
    width: 0;
    z-index: 1;
}

@keyframes shoot {
    0% {
        transform: translateX(0) translateY(0) rotate(-45deg);
        opacity: 1;
        width: 0;
    }

    30% {
        opacity: 1;
        width: 150px;
    }

    100% {
        transform: translateX(-300px) translateY(300px) rotate(-45deg);
        opacity: 0;
        width: 0;
    }
}

/* Toggle Button */
.drift-toggle-btn {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.drift-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sky-day .drift-toggle-btn {
    color: #4A6FA5;
    background: rgba(255, 255, 255, 0.6);
}

/* --- Rage Room Mode --- */
.rage-room-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #607D8B 0%, #263238 100%);
    /* Dim, concrete-like */
    overflow: hidden;
    perspective: 1000px;
    z-index: 1;
}

.rage-floor {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30%;
    background: #37474F;
    transform-origin: bottom;
    transform: rotateX(20deg) scale(1.2);
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
}

.rage-object {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
    transform-style: preserve-3d;
}

.rage-object:active {
    transform: scale(0.95);
}

/* Object Types */
.obj-bottle {
    width: 40px;
    height: 120px;
    background: rgba(129, 212, 250, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px 10px 5px 5px;
    /* neck */
}

.obj-bottle::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 10px;
    width: 20px;
    height: 30px;
    background: inherit;
    border: inherit;
    border-bottom: none;
}

.obj-plate {
    width: 100px;
    height: 100px;
    background: #ECEFF1;
    border-radius: 50%;
    border: 4px solid #CFD8DC;
    background: radial-gradient(circle at 30% 30%, #fff, #ECEFF1);
}

.obj-box {
    width: 120px;
    height: 100px;
    background: #8D6E63;
    border: 4px solid #5D4037;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.obj-box::after {
    /* Tape */
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 10px;
    height: 100%;
    background: #BCAAA4;
    transform: translateX(-50%);
    opacity: 0.8;
}

.obj-tv {
    width: 140px;
    height: 100px;
    background: #212121;
    border-radius: 10px;
    border: 4px solid #424242;
    position: relative;
    overflow: hidden;
}

.obj-tv::before {
    /* Screen */
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: #000;
    border-radius: 4px;
    box-shadow: inset 0 0 10px #fff;
    opacity: 0.3;
}

/* Debris */
.debris {
    position: absolute;
    pointer-events: none;
    animation: shatter-fly 0.8s ease-out forwards;
}

@keyframes shatter-fly {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0);
        opacity: 0;
    }
}

.rage-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
    z-index: 10;
}

/* --- Comfort Gift Mode --- */
.gift-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
}

.gift-container:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.gift-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 85%;
    background: #F8BBD0;
    /* Soft Pink */
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(232, 160, 191, 0.4);
}

.gift-body::before {
    /* Ribbon V */
    content: '';
    position: absolute;
    left: 50%;
    width: 20px;
    height: 100%;
    background: #F06292;
    transform: translateX(-50%);
}

.gift-lid {
    position: absolute;
    top: 0;
    left: -5%;
    width: 110%;
    height: 25%;
    background: #F48FB1;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform-origin: top left;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.gift-lid::before {
    /* Ribbon V on Lid */
    content: '';
    position: absolute;
    left: 50%;
    width: 20px;
    height: 100%;
    background: #E91E63;
    transform: translateX(-50%);
}

.gift-bow {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 30px;
}

.gift-bow::before,
.gift-bow::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 5px solid #E91E63;
    top: 0;
}

.gift-bow::before {
    left: 0;
    transform: skew(10deg);
}

.gift-bow::after {
    right: 0;
    transform: skew(-10deg);
}


/* Open Animation State */
.gift-container.open .gift-lid {
    transform: rotateZ(110deg) translate(-10px, -20px);
    opacity: 0;
}

.gift-container.open .gift-body {
    height: 0;
    opacity: 0;
    transition: all 0.5s ease 0.2s;
}

.gift-container.open .gift-bow {
    opacity: 0;
    transition: opacity 0.2s;
}

/* Plush Reveal */
.plush-reveal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s;
    z-index: 5;
    pointer-events: none;
    /* Let text be selectable if needed, but clicks pass through */
}

.gift-container.open+.plush-reveal {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
}

.reveal-emoji {
    font-size: 8rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    animation: plush-breathe 4s infinite ease-in-out;
}

@keyframes plush-breathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Hug Animation */
.plush-hug {
    animation: plush-hug-anim 3s ease-in-out forwards !important;
}

@keyframes plush-hug-anim {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.8) translateY(-20px);
    }

    /* Leans in */
    100% {
        transform: scale(1.2);
    }

    /* Settles closer */
}

/* Affirmation Text */
.affirmation-text {
    margin-top: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-primary);
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 1s ease;
    width: 300px;
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(232, 160, 191, 0.15);
}

.affirmation-text.show {
    opacity: 1;
    transform: translateY(0);
}
