:root {
    --burgundy: #722F37;
    --burgundy-dark: #4A1F24;
    --gold: #D4AF37;
    --gold-light: #F4D03F;
    --cream: #FDF5E6;
    --neon-pink: #FF10F0;
    --neon-cyan: #00FFFF;
    --parchment: #F5E6C8;
    --twitter-blue: #1DA1F2;
}

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

body {
    font-family: 'Crimson Pro', serif;
    background: linear-gradient(135deg, #1a0a0c 0%, #2d1518 50%, #1a0a0c 100%);
    min-height: 100vh;
    color: var(--cream);
    overflow-x: hidden;
}

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

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

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

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

/* Header */
.header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(180deg, rgba(114, 47, 55, 0.4) 0%, transparent 100%);
    border-bottom: 2px solid var(--gold);
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--neon-pink), var(--neon-cyan), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.main-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 8vw, 4.5rem);
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, #8B6914 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.8)); }
}

.subtitle {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--parchment);
    margin-top: 0.5rem;
    opacity: 0.9;
}

.crime-counter {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gold);
    border-radius: 20px;
    display: inline-block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: var(--gold-light);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    gap: 2rem;
}

/* Slot Machine */
.slot-machine {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.machine-frame {
    background: linear-gradient(145deg, #3d1a1f 0%, #2a1215 50%, #1a0a0c 100%);
    border: 4px solid var(--gold);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.3),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.machine-frame::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    pointer-events: none;
}

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

.machine-light {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--neon-pink);
    box-shadow: 0 0 15px var(--neon-pink);
    animation: blink 1s infinite;
}

.machine-light:last-child {
    background: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan);
    animation-delay: 0.5s;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.machine-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.2em;
    color: var(--gold);
}

.reels-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Individual Reel */
.reel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.reel-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: var(--gold-light);
}

.reel {
    width: clamp(100px, 25vw, 160px);
    height: 150px;
    background: linear-gradient(180deg, #0a0405 0%, #1a0a0c 50%, #0a0405 100%);
    border: 3px solid var(--gold);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.reel.locked {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan);
}

.reel-window {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0;
}

.reel-item {
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    font-weight: 700;
    text-align: center;
    padding: 0.5rem;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cream);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.reel-item.selected {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    color: var(--gold-light);
    text-shadow: 0 0 10px var(--gold);
}

.reel-item.faded {
    opacity: 0.3;
    font-size: clamp(0.6rem, 1.5vw, 0.8rem);
}

.reel-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 50px;
    transform: translateY(-50%);
    border-top: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    background: rgba(212, 175, 55, 0.1);
    pointer-events: none;
}

.reel.spinning .reel-item {
    animation: blur 0.1s infinite;
}

@keyframes blur {
    0%, 100% { filter: blur(0); }
    50% { filter: blur(2px); }
}

.lock-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: var(--cream);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.1em;
}

.lock-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.lock-btn.active {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* Spin Button */
.spin-button {
    width: 100%;
    padding: 1rem 2rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, #8B6914 100%);
    border: none;
    border-radius: 10px;
    color: var(--burgundy-dark);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

.spin-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.spin-button:hover::before {
    left: 100%;
}

.spin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.6);
}

.spin-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    animation: pulse 0.5s infinite;
}

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

/* Lever */
.lever-container {
    display: flex;
    align-items: flex-start;
    padding-top: 2rem;
}

.lever {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s;
}

.lever:hover {
    transform: scale(1.05);
}

.lever.pulled .lever-arm {
    transform: rotate(45deg);
    transform-origin: top center;
}

.lever-ball {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #ff4444, #aa0000);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.lever-arm {
    width: 12px;
    height: 80px;
    background: linear-gradient(90deg, #666, #999, #666);
    border-radius: 0 0 5px 5px;
    margin-top: -5px;
    transition: transform 0.3s;
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
}

.result-display {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

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

.result-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.2rem, 5vw, 2rem);
    letter-spacing: 0.1em;
    background: linear-gradient(180deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    line-height: 1.3;
}

.result-tagline {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    color: var(--parchment);
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* Generated Art */
.art-placeholder, .art-loading {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    background: linear-gradient(145deg, #2a1215, #1a0a0c);
    border: 3px solid var(--gold);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.placeholder-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--parchment);
    text-align: center;
    padding: 2rem;
    opacity: 0.7;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--gold-light);
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.art-frame {
    width: 100%;
    max-width: 400px;
    border: 4px solid var(--gold);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-out;
}

.generated-art {
    width: 100%;
    height: auto;
    display: block;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--gold);
    color: var(--burgundy-dark);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.action-btn.build-btn {
    border-color: var(--twitter-blue);
    color: var(--twitter-blue);
    position: relative;
    overflow: hidden;
}

.action-btn.build-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(29, 161, 242, 0.2), transparent);
    animation: buildShimmer 2s infinite;
}

@keyframes buildShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.action-btn.build-btn:hover {
    background: var(--twitter-blue);
    color: #fff;
    box-shadow: 0 0 20px rgba(29, 161, 242, 0.6);
    transform: scale(1.05);
}

/* History Section */
.history-section {
    width: 100%;
    max-width: 800px;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
}

.history-title-header {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.15em;
    color: var(--gold);
    margin-bottom: 1rem;
    text-align: center;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.history-item {
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
    transform: translateY(-2px);
}

.history-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--cream);
    margin-bottom: 0.25rem;
}

.history-setting {
    font-size: 0.75rem;
    color: var(--parchment);
    opacity: 0.7;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    margin-top: auto;
}

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

.footer a:hover {
    color: var(--gold-light);
}

.footer-sub {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.disclaimer {
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0.75rem;
    opacity: 0.6;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .slot-machine {
        flex-direction: column;
        align-items: center;
    }
    
    .lever-container {
        transform: rotate(90deg);
        margin-top: -1rem;
    }
    
    .lever-arm {
        height: 60px;
    }
    
    .reels-container {
        gap: 0.5rem;
    }
    
    .reel {
        width: 90px;
        height: 130px;
    }
    
    .machine-frame {
        padding: 1rem;
    }
    
    .history-list {
        grid-template-columns: 1fr;
    }
}