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

:root {
    --primary: #a855f7;
    --secondary: #ec4899;
    --accent: #06b6d4;
    --bg-dark: #0f0a1f;
    --bg-card: rgba(20, 10, 40, 0.8);
    --text: #f5f5f5;
    --text-muted: #a0a0b0;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 60%);
    animation: pulseBackground 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulseBackground {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.floating-emojis {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.floating-emoji {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: floatEmoji 4s ease-in-out infinite;
}

@keyframes floatEmoji {
    0%, 100% { transform: translateY(20vh) rotate(0deg); }
    50% { transform: translateY(15vh) rotate(10deg); }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

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

.app-header {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

.app-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.app-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 300;
}

.sound-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.sound-toggle:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    position: relative;
    z-index: 10;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.progress-container {
    margin-bottom: 2rem;
    text-align: center;
}

.progress-dots {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.2);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--primary);
}

.progress-dot.current {
    background: var(--secondary);
    animation: bounce 0.6s ease-in-out infinite;
}

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

.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.question-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
}

.question-card.slide-in {
    animation: slideIn 0.4s ease-out forwards;
}

.question-card.slide-out {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50px);
    }
}

.question-text {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.option-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: rgba(168, 85, 247, 0.1);
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

.option-button:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.option-button:active {
    transform: translateY(0);
}

.option-emoji {
    font-size: 2rem;
}

.option-label {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 550px;
    animation: scaleIn 0.5s ease-out;
}

.result-card.chaos-mode {
    border-color: rgba(255, 100, 100, 0.5);
    box-shadow: 0 0 40px rgba(255, 100, 100, 0.2);
    animation: scaleIn 0.5s ease-out, chaosGlow 2s ease-in-out infinite;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes chaosGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 100, 100, 0.2); }
    50% { box-shadow: 0 0 60px rgba(255, 100, 100, 0.4); }
}

.result-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.method-name {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(1.3rem, 4vw, 1.6rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chaos-badge {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #ff6b6b;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
}

.steps-container {
    margin-bottom: 1.5rem;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(168, 85, 247, 0.05);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.step-item:hover {
    background: rgba(168, 85, 247, 0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.step-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text);
}

.extras-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.extra-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 12px;
}

.extra-label {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.extra-value {
    font-size: 0.95rem;
    color: var(--text);
}

.first-line-container {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(15, 5, 30, 0.6);
    border-radius: 12px;
}

.code-block {
    display: block;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #4ade80;
    overflow-x: auto;
}

.quote-container {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: rgba(236, 72, 153, 0.1);
    border-radius: 12px;
    border-left: 3px solid var(--secondary);
}

.quote-text {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.action-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.regenerate {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.action-btn.start-over {
    background: rgba(168, 85, 247, 0.2);
    color: var(--text);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.action-btn.copy {
    background: rgba(6, 182, 212, 0.2);
    color: var(--text);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.action-btn.share {
    background: rgba(29, 161, 242, 0.2);
    color: var(--text);
    border: 1px solid rgba(29, 161, 242, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1000;
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

.history-panel {
    margin-top: 2rem;
    width: 100%;
    max-width: 550px;
}

.history-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid rgba(168, 85, 247, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.history-item:hover {
    border-color: var(--primary);
    background: rgba(168, 85, 247, 0.1);
}

.history-name {
    font-size: 0.9rem;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

.app-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.app-footer a:hover {
    color: var(--secondary);
}

@media (max-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .option-button {
        padding: 1rem 0.75rem;
    }
    
    .option-emoji {
        font-size: 1.75rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .action-btn {
        font-size: 0.75rem;
        padding: 0.6rem 0.5rem;
    }
    
    .extras-grid {
        grid-template-columns: 1fr;
    }
    
    .result-card, .question-card {
        padding: 1.5rem;
    }
}