:root {
    --bg: #000000;
    --card-bg: rgba(255, 255, 255, 0.05);
    --accent: #ff2d55; /* Hot Pink / iOS style */
    --accent-blue: #007aff;
    --text: #ffffff;
    --text-dim: #8e8e93;
    --glass: rgba(255, 255, 255, 0.1);
    --font-heading: 'Syne', sans-serif;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    overflow: hidden; /* App feel */
    height: 100vh;
    width: 100vw;
}

/* --- APP CONTAINER --- */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
    max-width: 500px; /* Force mobile aspect on desktop */
    margin: 0 auto;
    background: #000;
}

/* --- HEADER --- */
header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

header h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -1px;
}

.profile-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent), #ff9500);
    border: 2px solid #fff;
}

/* --- CONTENT AREA --- */
main {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 100px 20px;
}

main::-webkit-scrollbar { display: none; }

/* Home Section */
.featured-card {
    width: 100%;
    height: 400px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.featured-card img {
    width: 100%; height: 100%; object-fit: cover;
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.featured-overlay h2 { font-size: 2rem; margin-bottom: 10px; }
.play-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

/* Horizontal Lists */
section { margin-bottom: 30px; }
section h3 { font-size: 1.1rem; margin-bottom: 15px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

.horizontal-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.horizontal-list::-webkit-scrollbar { display: none; }

.ep-card {
    min-width: 140px;
    height: 200px;
    border-radius: 16px;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.ep-card img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.7); }
.ep-card span {
    position: absolute;
    bottom: 10px; left: 10px;
    font-size: 0.8rem; font-weight: 600;
}

/* --- BOTTOM NAV --- */
nav {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    height: 85px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 0.65rem;
    transition: 0.3s;
}

.nav-item.active { color: var(--text); }
.nav-item i { font-size: 1.4rem; margin-bottom: 2px; }

/* --- STORY OVERLAY --- */
#story-view {
    position: fixed; inset: 0;
    background: #000;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.story-header {
    height: 100px;
    padding: 40px 20px 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-container {
    display: flex;
    gap: 4px;
    height: 3px;
}

.progress-bar {
    flex: 1;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: #fff;
}

.active .progress-fill { animation: storyProgress 5s linear forwards; }

@keyframes storyProgress { from { width: 0; } to { width: 100%; } }

.story-content {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.story-msg {
    position: absolute;
    bottom: 100px;
    left: 20px; right: 20px;
}

/* WP Bubble in App */
.app-bubble {
    background: rgba(32, 44, 51, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 18px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUpApp 0.5s ease-out;
}

@keyframes slideUpApp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-bubble .sender { color: var(--accent); font-weight: 800; font-size: 0.8rem; display: block; margin-bottom: 4px; }
.app-bubble .text { font-size: 0.9rem; line-height: 1.4; color: #fff; }

/* Loader Fix */
#loader { background: #000; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 5000; }
.logo-app { font-family: var(--font-heading); font-size: 2.5rem; letter-spacing: -2px; }

/* --- PARTY OVERLAY & ANIMATIONS --- */
#party-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cake-emoji { font-size: 100px; margin-bottom: 20px; animation: bounce 2s infinite; }
.blow-btn, .gift-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 71, 87, 0.3);
}

.gift-btn { background: #ffd32a; color: #000; font-size: 1.5rem; animation: pulse 1s infinite; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#fireworks-canvas { position: absolute; inset: 0; pointer-events: none; }

.photo-piece {
    position: absolute;
    width: auto;
    max-width: 180px; /* Natural aspect ratio but capped */
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 5;
}

:root {
    --bg-color: #0d0d0d;
    --card-bg: rgba(255, 255, 255, 0.05); /* Softer card bg */
    --accent: #ff8a9d; /* Softer Pastel Pink */
    --accent-alt: #fbc2eb; /* Softer Pastel Purple */
    --text-main: #f5f5f5;
    --text-dim: #b0b0b0;
    --font-main: 'Outfit', sans-serif; /* Soft modern font */
    --font-heading: 'Syne', sans-serif;
}

/* --- NOTIFICATION BADGE --- */
.nav-item { position: relative; }
.badge {
    position: absolute;
    top: -5px; right: 5px;
    background: var(--accent);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 7px;
    border-radius: 12px;
    box-shadow: 0 0 10px var(--accent);
    animation: softPulse 2s infinite ease-in-out;
}

@keyframes softPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Organized Messages Soft style */
#organized-messages {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
    z-index: 200;
    mask-image: linear-gradient(to top, black 70%, transparent 100%);
    scroll-behavior: smooth;
}

.organized-msg {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(25px); /* Much softer blur */
    width: 85%;
    max-width: 380px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: softSlideUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes softSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.organized-msg strong { color: var(--accent); display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; }
.organized-msg p { font-size: 0.8rem; line-height: 1.5; color: rgba(255,255,255,0.8); }

#final-message-box {
    position: absolute;
    top: 12%;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 300;
}

.credits-section {
    padding: 30px 15px;
    margin-top: 20px;
}

.credits-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.credits-card:hover { transform: scale(1.02); }

.dev-avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 5px 20px rgba(255, 138, 157, 0.5);
    flex-shrink: 0;
}

.dev-info { text-align: left; }
.dev-info span { 
    font-size: 0.6rem; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    color: var(--accent); 
    font-weight: 700;
}
.dev-info h4 { margin: 1px 0; font-size: 1rem; color: #fff; }
.dev-info p { font-size: 0.7rem; line-height: 1.3; color: rgba(255,255,255,0.7); margin-top: 4px; max-width: 250px; }

.mini-bubble {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 15px;
    margin: 10px 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 1s ease forwards;
}

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

/* Animations */
.fade-in { animation: fadeIn 0.8s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.hide { display: none !important; }

/* Masonry Grid */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-bottom: 20px;
}

.gallery-item {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--card-bg);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Vertical List for Episodes Tab */
.vertical-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vep-card {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 16px;
    width: 100%;
}

.vep-card img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
}

.vep-card div h4 { font-size: 1rem; margin-bottom: 4px; }
.vep-card div p { font-size: 0.7rem; color: var(--text-dim); }

@media (max-width: 600px) {
    .masonry-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 601px) {
    .masonry-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- 3. CHAT EPISODES (THE MINI SERIES) --- */
.chat-panel {
    width: 100vw;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: radial-gradient(circle at center, #111 0%, #050505 100%);
    overflow: hidden;
}

.episode-tag {
    position: absolute;
    top: 50px;
    left: 50px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.5;
}

.chat-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 90%;
    max-width: 500px;
    transform: translateZ(0); 
}

.chat-photo {
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* WP Bubble Style */
.wp-bubble {
    background: #202c33;
    padding: 15px 20px;
    border-radius: 15px 15px 15px 0;
    align-self: flex-start;
    position: relative;
    max-width: 85%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.5s;
}

.wp-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 15px;
    height: 15px;
    background: #202c33;
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

.wp-bubble .sender {
    color: #00e5ff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
}

.wp-bubble .message {
    color: #e9edef;
    font-size: 0.95rem;
    line-height: 1.5;
}

.wp-bubble .time {
    color: var(--dim);
    font-size: 0.65rem;
    text-align: right;
    display: block;
    margin-top: 5px;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive Fixes */
@media (max-width: 600px) {
    .glitch-title { font-size: 15vw; }
    .node { width: 280px; }
    .memories { padding-left: 30px; }
    .chat-container { width: 100%; }
    .episode-tag { top: 20px; left: 20px; font-size: 0.6rem; }
}
