/* Cute & Cozy Design System for Angel & Godson */

:root {
    --primary-pink: #ff85a2;
    --primary-pink-hover: #ff6b8b;
    --bg-pink: #ffccd5;
    --bg-pink-light: #fff0f3;
    
    --primary-blue: #a2d2ff;
    --primary-blue-hover: #90c2f0;
    --bg-blue-light: #e8f0fe;
    
    --pastel-purple: #e8dbfc;
    --pastel-peach: #ffe5d9;
    --pastel-green: #d8f3dc;
    
    --text-dark: #4a3728;
    --text-muted: #7d6350;
    --white: #ffffff;
    --success-color: #52b788;
    
    --font-primary: 'Nunito', sans-serif;
    --font-display: 'Fredoka', sans-serif;
    
    --card-shadow: 0 15px 35px rgba(255, 133, 162, 0.15);
    --btn-shadow: 0 8px 20px rgba(255, 133, 162, 0.25);
    --transition-speed: 0.3s;
    
    --card-bg-glass: rgba(255, 255, 255, 0.85);
    --app-bg-glass: rgba(255, 255, 255, 0.75);
    --input-bg-glass: rgba(255, 255, 255, 0.9);
    --hints-box-bg: rgba(255, 229, 217, 0.5);
    --pwd-box-bg: #fbfdff;
    --log-system-bg: #eef3fe;
    --log-system-color: #4361ee;
    --text-shadow-light: rgba(255, 255, 255, 0.8);
    --history-box-bg: #fcf8f9;
}

body.dark-theme {
    --primary-pink: #d95a7b;
    --primary-pink-hover: #e0728f;
    --bg-pink: #5a2e37;
    --bg-pink-light: #2c1a1e;
    
    --primary-blue: #5d8ab5;
    --primary-blue-hover: #72a2cf;
    --bg-blue-light: #1c2733;
    
    --pastel-purple: #3a2e4d;
    --pastel-peach: #4d2f24;
    --pastel-green: #2c4232;
    
    --text-dark: #f0e6df;
    --text-muted: #bdae9f;
    --white: #2c272a;
    --success-color: #3f9c6d;
    
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    --btn-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    
    --card-bg-glass: rgba(44, 39, 42, 0.85);
    --app-bg-glass: rgba(44, 39, 42, 0.75);
    --input-bg-glass: rgba(30, 25, 28, 0.9);
    --hints-box-bg: rgba(90, 46, 55, 0.5);
    --pwd-box-bg: #221c1f;
    --log-system-bg: #2c3a5e;
    --log-system-color: #7a98ff;
    --text-shadow-light: rgba(0, 0, 0, 0.5);
    --history-box-bg: #1c181a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-pink-light) 0%, var(--pastel-purple) 50%, var(--bg-blue-light) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    transition: background var(--transition-speed), color var(--transition-speed);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    border: none;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    transform: scale(1.15) rotate(15deg);
}

/* Floating Background Elements */
.floating-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bg-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: floatUp 15s infinite linear;
    bottom: -100px;
}

/* Helper Class for Hidden elements */
.hidden {
    display: none !important;
}

/* Glassmorphism Card Style */
.login-wrapper, .app-wrapper {
    width: 100%;
    max-width: 950px;
    padding: 20px;
    z-index: 10;
}

.login-wrapper {
    max-width: 460px;
}

.login-card {
    background: var(--card-bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid var(--white);
    border-radius: 30px;
    padding: 40px 30px;
    box-shadow: var(--card-shadow);
    text-align: center;
    animation: cardEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.card-header h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--primary-pink);
    text-shadow: 2px 2px 0px var(--text-shadow-light);
}

.sparkle-icon {
    font-size: 1.8rem;
    animation: sparkleSpin 3s infinite linear;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Form Styles */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-left: 8px;
}

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-emoji {
    position: absolute;
    left: 15px;
    font-size: 1.2rem;
}

.input-field-wrapper input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid rgba(255, 133, 162, 0.3);
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--input-bg-glass);
    transition: all var(--transition-speed);
}

.input-field-wrapper input:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 10px rgba(255, 133, 162, 0.2);
    background: var(--white);
}

.hints-box {
    background: var(--hints-box-bg);
    border-radius: 15px;
    padding: 12px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: #b05c46;
    border: 1px dashed rgba(176, 92, 70, 0.3);
}

/* Button System */
.cute-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 15px 30px;
    border: none;
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.cute-btn.primary {
    background: linear-gradient(135deg, var(--primary-pink) 0%, #ff5c8a 100%);
    color: var(--white);
    box-shadow: var(--btn-shadow);
    width: 100%;
}

.cute-btn.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(255, 133, 162, 0.35);
}

.cute-btn.primary:active {
    transform: translateY(1px) scale(0.98);
}

.cute-btn.secondary {
    background: var(--white);
    border: 2px solid var(--primary-blue);
    color: var(--text-dark);
}

.cute-btn.secondary:hover {
    background: var(--bg-blue-light);
    transform: translateY(-2px);
}

.cute-btn.mini {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 12px;
}

.cute-error-msg {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #e63946;
    font-weight: bold;
    min-height: 20px;
}

/* MAIN APP LAYOUT */
.app-wrapper {
    background: var(--app-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 3px solid var(--white);
    border-radius: 35px;
    box-shadow: var(--card-shadow);
    animation: cardEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed rgba(255, 133, 162, 0.2);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.user-greeting h2 {
    font-family: var(--font-display);
    color: var(--primary-pink);
    font-size: 1.8rem;
}

.user-greeting p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.main-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: center;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* CHIBI INTERACTIVE GRAPHICS */
.chibi-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 10px;
}

/* Speech Bubble */
.speech-bubble-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin-bottom: 15px;
    animation: hoverSlow 4s ease-in-out infinite alternate;
}

.speech-bubble {
    background: var(--white);
    border: 3px solid var(--primary-blue);
    border-radius: 20px;
    padding: 15px 20px;
    text-align: center;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: bold;
    color: var(--text-dark);
    position: relative;
    box-shadow: 0 6px 15px rgba(162, 210, 255, 0.2);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: var(--white) transparent;
    display: block;
    width: 0;
    z-index: 1;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -19px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 16px 16px 0;
    border-style: solid;
    border-color: var(--primary-blue) transparent;
    display: block;
    width: 0;
    z-index: 0;
}

/* Character Box */
.chibi-character-box {
    width: 320px;
    height: 360px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Ghibli Portrait & Natural Animations */
.ghibli-portrait-wrapper {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(162, 210, 255, 0.4);
    border: 5px solid white;
    background: #fdfbfb;
    margin: 0 auto;
}

.ghibli-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: bottom center;
    animation: naturalBreathing 4s ease-in-out infinite;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
}

@keyframes naturalBreathing {
    0%, 100% { transform: scaleY(1) translateY(0); }
    50% { transform: scaleY(1.02) translateY(-3px); }
}

/* State Animations - Extreme "Talking Tom" Style */
.state-pinched .ghibli-img {
    animation: tomHit 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    filter: brightness(0.9) contrast(1.1);
}

@keyframes tomHit {
    0% { transform: rotate(0deg) translateX(0); }
    15% { transform: rotate(-25deg) translateX(-30px); }
    30% { transform: rotate(15deg) translateX(20px); }
    45% { transform: rotate(-10deg) translateX(-15px); }
    60% { transform: rotate(5deg) translateX(10px); }
    100% { transform: rotate(0deg) translateX(0); }
}

.state-scratched .ghibli-img {
    animation: tomTickle 0.8s ease-in-out infinite;
    filter: brightness(1.05);
}

@keyframes tomTickle {
    0%, 100% { transform: scale(1.1, 0.9) translateY(10px); }
    25% { transform: scale(0.9, 1.1) translateY(-15px) rotate(-8deg); }
    50% { transform: scale(1.1, 0.9) translateY(10px); }
    75% { transform: scale(0.9, 1.1) translateY(-15px) rotate(8deg); }
}

.state-patted .ghibli-img {
    animation: tomPurr 1.2s ease-in-out infinite;
}

@keyframes tomPurr {
    0%, 100% { transform: scale(1.05, 0.95) translateY(15px) rotate(0deg); }
    50% { transform: scale(1.02, 0.98) translateY(5px) rotate(5deg); }
}

.state-annoyed .ghibli-img {
    animation: tomAngry 0.4s ease-in-out infinite;
    filter: sepia(1) hue-rotate(-50deg) saturate(5) contrast(1.2) brightness(0.8);
}

@keyframes tomAngry {
    0%, 100% { transform: translateX(0) scale(1.05); }
    25% { transform: translateX(-8px) rotate(-3deg) scale(1.05); }
    75% { transform: translateX(8px) rotate(3deg) scale(1.05); }
}

/* Overlays for Interaction (Emojis) */
.overlay-item {
    position: absolute;
    font-size: 2.5rem;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

.pinch-overlay.left-pinch { left: 20px; top: 120px; transform: scaleX(-1); }
.pinch-overlay.right-pinch { right: 20px; top: 120px; }
.tickle-overlay { left: 50%; bottom: 20px; transform: translateX(-50%); animation: featherTickle 0.3s alternate infinite; }
@keyframes featherTickle { from { transform: translateX(-50%) rotate(-15deg); } to { transform: translateX(-50%) rotate(15deg); } }
.pat-overlay { left: 50%; top: 10px; transform: translateX(-50%); animation: patMotion 0.4s ease-in-out infinite alternate; }
@keyframes patMotion { from { transform: translateX(-50%) translateY(-10px); } to { transform: translateX(-50%) translateY(5px) scale(0.9); } }

.sleep-overlay { right: 30px; top: 40px; animation: zzzFloat 3s ease-in-out infinite; opacity: 0.8; font-size: 2rem; filter: drop-shadow(0 0 10px rgba(108, 92, 231, 0.5)); }
@keyframes zzzFloat { 0% { transform: translate(0, 0) scale(0.8); opacity: 0; } 50% { opacity: 1; } 100% { transform: translate(20px, -40px) scale(1.5); opacity: 0; } }

.state-sleeping .ghibli-img {
    animation: tomSleep 4s ease-in-out infinite;
    filter: brightness(0.55) sepia(0.3) hue-rotate(200deg) saturate(1.2);
}
@keyframes tomSleep {
    0%, 100% { transform: scale(1.01, 0.99) translateY(3px); }
    50% { transform: scale(0.99, 1.01) translateY(-3px); }
}

/* INTERACTION CONSOLE */
.interaction-card {
    background: var(--white);
    border-radius: 25px;
    padding: 25px;
    box-shadow: inset 0 0 20px rgba(162, 210, 255, 0.1);
    border: 2px dashed rgba(162, 210, 255, 0.5);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.love-meter-box {
    margin-bottom: 25px;
}

.love-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--primary-pink);
}

.progress-bar-bg {
    background: #f0e6e8;
    height: 18px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 133, 162, 0.2);
}

.progress-bar-fill {
    background: linear-gradient(90deg, #ffb3c1, var(--primary-pink));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.annoyance-box .love-label {
    color: #ff6b6b;
}

.annoyance-fill {
    background: linear-gradient(90deg, #ff9a9e 0%, #ff6b6b 100%);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.actions-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.cute-action-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border: none;
    border-radius: 18px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cute-action-btn.pinch {
    background: linear-gradient(135deg, #ff7096 0%, #ff85a2 100%);
    box-shadow: 0 6px 15px rgba(255, 112, 150, 0.25);
}

.cute-action-btn.pinch:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(255, 112, 150, 0.35);
}

.cute-action-btn.scratch {
    background: linear-gradient(135deg, #a2d2ff 0%, #bde0fe 100%);
    box-shadow: 0 6px 15px rgba(162, 210, 255, 0.25);
    color: #4a3728;
}

.cute-action-btn.scratch:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(162, 210, 255, 0.35);
}

.cute-action-btn.pat {
    background: linear-gradient(135deg, #e8dbfc 0%, #f3e9fe 100%);
    box-shadow: 0 6px 15px rgba(232, 219, 252, 0.25);
    color: #4a3728;
}

.cute-action-btn.pat:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(232, 219, 252, 0.35);
}

.cute-action-btn.sleep {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.25);
}

.cute-action-btn.sleep:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.35);
}

.cute-action-btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-emoji {
    font-size: 1.4rem;
}

.action-history-box {
    background: var(--history-box-bg);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 133, 162, 0.1);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.action-history-box h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 133, 162, 0.1);
    padding-bottom: 5px;
}

.log-entries {
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.log-entry {
    padding: 6px 10px;
    border-radius: 8px;
    animation: slideInUp 0.3s ease-out;
}

.log-entry.system {
    background: var(--log-system-bg);
    color: var(--log-system-color);
}

.log-entry.pinch-log {
    background: #ffeef2;
    color: #ff5c8a;
}

.log-entry.scratch-log {
    background: #edf6ff;
    color: #0077b6;
}

.log-entry.pat-log {
    background: #f8f1ff;
    color: #7209b7;
}

/* PASSWORD CONFIG BOX */
.password-change-box {
    background: var(--pwd-box-bg);
    border-radius: 18px;
    padding: 12px 18px;
    border: 1px dashed rgba(162, 210, 255, 0.4);
    margin-bottom: 20px;
    text-align: left;
}

.password-change-box h3.box-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.password-input-row {
    display: flex;
    gap: 10px;
}

.password-input-row input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 2px solid rgba(162, 210, 255, 0.3);
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-speed);
}

.password-input-row input:focus {
    border-color: var(--primary-blue);
}

.password-input-row button.mini-btn {
    padding: 8px 16px !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
    font-family: var(--font-display) !important;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary-pink) 0%, #ff5c8a 100%) !important;
    color: var(--white) !important;
}

.password-status-msg {
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 6px;
    min-height: 16px;
}

/* FOOTER */
.app-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* HEART PARTICLES */
.heart-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: burstOut 1s ease-out forwards;
    font-size: 1.5rem;
}

/* ==================================================== */
/* ANIMATIONS FOR CHIBI STATE ACTIONS */
/* ==================================================== */

/* 1. IDLE BASE ANIMATIONS */
/* Head Bobbing */
#head-group {
    transform-origin: 200px 240px;
    animation: headBob 3.5s ease-in-out infinite alternate;
    transition: transform 0.3s ease-out;
}

/* Hair Ahoge Wiggle */
#hair-ahoge {
    transform-origin: 200px 100px;
    animation: ahogeWiggle 2s ease-in-out infinite alternate;
}

/* Idle Breathing Arms */
#arms-group {
    transform-origin: 200px 330px;
    animation: armBreathing 3.5s ease-in-out infinite alternate;
}

/* Body Breathing */
#body-group {
    transform-origin: 200px 380px;
    animation: bodyBreathing 3.5s ease-in-out infinite alternate;
}

/* 2. PINCH ANIMATION STATE */
.state-pinched #head-group {
    animation: none;
    transform: translateY(4px) scale(0.98, 0.94);
}

.state-pinched #cheek-l {
    transform: translate(-12px, 0px) scale(1.6, 1.2);
    transform-origin: 138px 138px;
    fill: #ff4d6d !important;
}

.state-pinched #cheek-r {
    transform: translate(12px, 0px) scale(1.6, 1.2);
    transform-origin: 262px 138px;
    fill: #ff4d6d !important;
}

.state-pinched #pinch-hands-overlay {
    display: block !important;
    animation: handSqueeze 0.8s ease-in-out infinite alternate;
}

/* 3. SCRATCH / TICKLE STATE */
.state-scratched #head-group {
    animation: giggleWiggle 0.15s ease-in-out infinite;
}

.state-scratched #body-group {
    animation: giggleBounce 0.25s ease-in-out infinite;
}

.state-scratched #tickle-feather {
    display: block !important;
    animation: featherSweep 0.5s ease-in-out infinite alternate;
}

.state-scratched #hair-ahoge {
    animation: ahogeCrazy 0.1s ease-in-out infinite;
}

/* 4. PAT STATE */
.state-patted #head-group {
    animation: none;
    transform: translateY(12px);
}

.state-patted #pat-hand {
    display: block !important;
    animation: patStroke 0.6s ease-in-out infinite alternate;
}

.state-patted #cheek-l, .state-patted #cheek-r {
    transform: scale(1.2);
    transform-origin: center;
    transition: transform 0.3s;
}


/* ==================================================== */
/* KEYFRAMES DEFINITIONS */
/* ==================================================== */

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sparkleSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes hoverSlow {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

/* Idle Keyframes */
@keyframes headBob {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-4px) rotate(0.8deg); }
}

@keyframes ahogeWiggle {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(10deg); }
}

@keyframes bodyBreathing {
    0% { transform: scaleY(1); }
    100% { transform: scaleY(1.015); }
}

@keyframes armBreathing {
    0% { transform: translateY(0); }
    100% { transform: translateY(-1.5px); }
}

/* Interaction Keyframes */
@keyframes handSqueeze {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes giggleWiggle {
    0% { transform: rotate(-1.5deg) translateY(0); }
    50% { transform: rotate(1.5deg) translateY(-1px); }
    100% { transform: rotate(-1.5deg) translateY(0); }
}

@keyframes giggleBounce {
    0% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-3px) scaleY(0.98); }
    100% { transform: translateY(0) scaleY(1); }
}

@keyframes featherSweep {
    0% { transform: translate(140px, 290px) rotate(-40deg); }
    100% { transform: translate(210px, 305px) rotate(10deg); }
}

@keyframes patStroke {
    0% { transform: translate(200px, -10px) rotate(-5deg); }
    100% { transform: translate(210px, 2px) rotate(5deg); }
}

@keyframes ahogeCrazy {
    0% { transform: rotate(-15deg) scaleY(1.2); }
    100% { transform: rotate(20deg) scaleY(0.9); }
}

@keyframes burstOut {
    0% {
        transform: translate(0, 0) scale(0.3) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1.3) rotate(var(--rot));
        opacity: 0;
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================================================== */
/* MOBILE RESPONSIVENESS */
/* ==================================================== */

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .login-wrapper, .app-wrapper {
        padding: 15px;
        border-radius: 20px;
        border-width: 2px;
    }

    .app-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .user-greeting h2 {
        font-size: 1.5rem;
    }

    .speech-bubble {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .chibi-character-box {
        width: 100%;
        height: auto;
        padding-bottom: 20px;
    }

    .ghibli-portrait-wrapper {
        width: 220px;
        height: 220px;
        border-width: 3px;
    }

    .dashboard-panel {
        padding: 15px;
    }

    .stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 12px;
    }

    .progress-bar-bg {
        height: 10px;
    }

    .control-panel button {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .password-input-row {
        flex-direction: column;
    }

    .theme-toggle-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
