/* CSS Variables - Soft Purple & Red Theme */
:root {
    --purple-soft: #9b7bb8;
    --purple-medium: #7a5a9a;
    --purple-deep: #5c3d7a;
    --red-soft: #c97b84;
    --red-medium: #b85a6a;
    --cream: #f5f0eb;
    --white: #ffffff;
    --bg-dark: #1a1520;
}

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

/* Typography */
body {
    font-family: 'Syne', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-dark);
    color: var(--white);
}

h1, h2, .bluu {
    font-family: 'Bluu Next', 'Georgia', serif;
}

/* Cloudporn Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1534088568595-a066f410bcda?w=1920&q=80');
    background-size: cover;
    background-position: center;
    z-index: -2;
}

/* Animated Purple Gradient Overlay */
.gradient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        135deg,
        rgba(155, 123, 184, 0.7) 0%,
        rgba(122, 90, 154, 0.6) 25%,
        rgba(92, 61, 122, 0.7) 50%,
        rgba(201, 123, 132, 0.5) 75%,
        rgba(155, 123, 184, 0.6) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 0%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

/* Screen Layout */
.screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
}

.hidden {
    display: none !important;
}

/* ==================== PASSWORD SCREEN ==================== */
.password-container {
    background: rgba(26, 21, 32, 0.85);
    backdrop-filter: blur(20px);
    padding: 4rem;
    border: 1px solid rgba(155, 123, 184, 0.3);
    text-align: center;
    z-index: 10;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lock-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 2rem;
    color: var(--purple-soft);
}

.password-container h2 {
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.password-container > p {
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2.5rem;
}

.password-input-wrapper {
    display: flex;
    gap: 0;
    border: 1px solid rgba(155, 123, 184, 0.5);
    width: 100%;
}

#password-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 16px; /* Prevents iOS zoom on focus */
    font-family: 'Syne', sans-serif;
    letter-spacing: 0.1em;
    background: transparent;
    border: none;
    color: var(--white);
    outline: none;
    text-align: center;
}

#password-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    font-size: 0.85rem;
}

#unlock-btn {
    padding: 1rem 1.5rem;
    background: var(--purple-soft);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#unlock-btn:hover {
    background: var(--purple-medium);
}

#unlock-btn svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.error-message {
    color: var(--red-soft);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    min-height: 1.5rem;
    margin-top: 1.5rem;
}

/* ==================== FLOATING HEARTS ==================== */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.flat-heart {
    position: absolute;
    opacity: 0.6;
    animation: floatUp 12s linear infinite;
}

.flat-heart svg {
    width: 100%;
    height: 100%;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) rotate(15deg);
        opacity: 0;
    }
}

/* ==================== CARD SCREEN ==================== */
.card {
    background: rgba(26, 21, 32, 0.9);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(155, 123, 184, 0.3);
    max-width: 900px;
    width: 100%;
    z-index: 10;
    animation: cardEntrance 0.8s ease-out;
}

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

/* Swiss Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    min-height: 600px;
}

/* Left Column */
.card-left {
    border-right: 1px solid rgba(155, 123, 184, 0.3);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.year {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--purple-soft);
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.4);
}

/* Main Content */
.card-main {
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.card-header {
    margin-bottom: 3rem;
}

.card-header h1 {
    font-size: 3.5rem;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--white);
}

.header-line {
    width: 60px;
    height: 3px;
    background: var(--red-soft);
    margin-top: 1.5rem;
}

/* Icons Section */
.icons-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(155, 123, 184, 0.2);
    border-bottom: 1px solid rgba(155, 123, 184, 0.2);
}

.icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.icon {
    width: 80px;
    height: 80px;
    color: var(--white);
    transition: transform 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

.icon:hover {
    transform: scale(1.1);
    color: var(--purple-soft);
}

.beetle-icon {
    animation: beetleWalk 4s ease-in-out infinite;
}

@keyframes beetleWalk {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.poop-icon {
    animation: poopFloat 3s ease-in-out infinite;
}

@keyframes poopFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.icon-label {
    font-family: 'Syne', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.5);
}

.heart-divider {
    width: 40px;
    height: 40px;
    color: var(--red-soft);
    animation: heartPulse 2s ease-in-out infinite;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ==================== MUSIC PLAYER ==================== */
.music-player {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(155, 123, 184, 0.3);
    background: rgba(26, 21, 32, 0.5);
}

.player-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.player-label {
    font-family: 'Syne', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--purple-soft);
    white-space: nowrap;
}

.player-line {
    flex: 1;
    height: 1px;
    background: rgba(155, 123, 184, 0.3);
}

.player-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.play-button {
    width: 48px;
    height: 48px;
    background: var(--purple-soft);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.play-button:hover {
    background: var(--purple-medium);
    transform: scale(1.05);
}

.play-button svg {
    width: 20px;
    height: 20px;
    color: var(--white);
}

.play-button .play-icon {
    margin-left: 3px;
}

.track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.track-title {
    font-family: 'Syne', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-family: 'Syne', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.sound-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sound-bars.playing {
    opacity: 1;
}

.sound-bars span {
    width: 4px;
    background: var(--red-soft);
    animation: soundBar 0.8s ease-in-out infinite;
    animation-play-state: paused;
}

.sound-bars.playing span {
    animation-play-state: running;
}

.sound-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.sound-bars span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.sound-bars span:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.sound-bars span:nth-child(4) { height: 20px; animation-delay: 0.3s; }
.sound-bars span:nth-child(5) { height: 10px; animation-delay: 0.4s; }

@keyframes soundBar {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

.progress-container {
    margin-top: 1rem;
    height: 3px;
    background: rgba(155, 123, 184, 0.2);
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--red-soft);
    transition: width 0.1s linear;
}

/* Message Section */
.message-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.message-primary {
    font-family: 'Bluu Next', 'Georgia', serif;
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--cream);
}

.message-secondary {
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* Footer */
.card-footer {
    margin-top: 2rem;
}

.footer-line {
    width: 100%;
    height: 1px;
    background: rgba(155, 123, 184, 0.3);
    margin-bottom: 1.5rem;
}

.signature {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.signature span {
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.footer-heart {
    width: 20px;
    height: 20px;
    color: var(--red-soft);
    animation: heartPulse 2s ease-in-out infinite;
}

/* Right Column */
.card-right {
    border-left: 1px solid rgba(155, 123, 184, 0.3);
    padding: 2rem 1rem;
}

.decorative-elements {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.deco-circle {
    width: 24px;
    height: 24px;
    border: 2px solid var(--purple-soft);
    border-radius: 50%;
}

.deco-line {
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, var(--purple-soft), transparent);
}

.deco-square {
    width: 16px;
    height: 16px;
    background: var(--red-soft);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .card-left, .card-right {
        display: none;
    }
    
    .card-main {
        padding: 2rem;
    }
    
    .card-header h1 {
        font-size: 2.5rem;
    }
    
    .icons-section {
        gap: 2rem;
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }
    
    .icon {
        width: 60px;
        height: 60px;
    }
    
    .message-primary {
        font-size: 1.2rem;
    }
    
    .message-secondary {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .password-container {
        padding: 2.5rem;
    }
    
    .password-container h2 {
        font-size: 1.8rem;
    }
    
    .music-player {
        padding: 1rem;
    }
    
    .play-button {
        width: 42px;
        height: 42px;
    }
    
    .track-title {
        font-size: 0.85rem;
    }
    
    .track-artist {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 0.75rem;
    }
    
    .card {
        border: none;
    }
    
    .card-main {
        padding: 1.5rem;
    }
    
    .card-header {
        margin-bottom: 1.5rem;
    }
    
    .card-header h1 {
        font-size: 2rem;
        line-height: 1.15;
    }
    
    .header-line {
        margin-top: 1rem;
    }
    
    .icons-section {
        flex-direction: row;
        gap: 1.5rem;
        padding: 1.25rem 0;
        margin-bottom: 1.25rem;
    }
    
    .icon {
        width: 50px;
        height: 50px;
    }
    
    .icon-label {
        font-size: 0.6rem;
    }
    
    .heart-divider {
        width: 28px;
        height: 28px;
        transform: none;
    }
    
    .message-section {
        gap: 1rem;
    }
    
    .message-primary {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    
    .message-secondary {
        font-size: 0.9rem;
        line-height: 1.65;
    }
    
    .music-player {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .player-label {
        font-size: 0.6rem;
    }
    
    .play-button {
        width: 40px;
        height: 40px;
    }
    
    .play-button svg {
        width: 16px;
        height: 16px;
    }
    
    .track-info {
        gap: 0.15rem;
    }
    
    .track-title {
        font-size: 0.8rem;
    }
    
    .track-artist {
        font-size: 0.65rem;
    }
    
    .sound-bars {
        height: 20px;
    }
    
    .sound-bars span {
        width: 3px;
    }
    
    .card-footer {
        margin-top: 1.5rem;
    }
    
    .footer-line {
        margin-bottom: 1rem;
    }
    
    .signature {
        gap: 0.75rem;
    }
    
    .signature span {
        font-size: 0.75rem;
    }
    
    .footer-heart {
        width: 16px;
        height: 16px;
    }
    
    /* Password screen mobile */
    .password-container {
        padding: 2rem 1.5rem;
    }
    
    .password-container h2 {
        font-size: 1.5rem;
        letter-spacing: 0.15em;
    }
    
    .password-container > p {
        font-size: 0.75rem;
        margin-bottom: 2rem;
    }
    
    .lock-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 1.5rem;
    }
    
    #password-input {
        padding: 0.85rem 1rem;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    #unlock-btn {
        padding: 0.85rem 1.25rem;
    }
    
    #unlock-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .card-main {
        padding: 1.25rem;
    }
    
    .card-header h1 {
        font-size: 1.75rem;
    }
    
    .icon {
        width: 45px;
        height: 45px;
    }
    
    .heart-divider {
        width: 24px;
        height: 24px;
    }
    
    .message-primary {
        font-size: 1rem;
    }
    
    .message-secondary {
        font-size: 0.85rem;
    }
    
    .password-container h2 {
        font-size: 1.3rem;
    }
    
    #password-input {
        padding: 0.75rem;
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* ==================== CONFETTI ==================== */
.confetti {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
