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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3em;
    font-weight: 900;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.95;
}

.main-content {
    max-width: 900px;
    margin: 0 auto 30px auto;
}

section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

section h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #667eea;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffc107;
    animation: pulse 2s infinite;
}

.status-indicator.ready .status-dot {
    background: #4caf50;
}

.status-indicator.error .status-dot {
    background: #f44336;
    animation: none;
}

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

.smile-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
    transition: all 0.3s;
}

.smile-indicator.smiling {
    background: #4caf50;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.video-container {
    margin-bottom: 15px;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    display: block;
    transform: scaleX(-1);
}

.preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 15px;
    min-height: 400px;
    padding: 20px;
}

#previewCanvas {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    display: block;
}

.hint-box, .mobile-hint {
    padding: 12px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    font-size: 0.9em;
    color: #856404;
    margin-top: 10px;
}

.mobile-hint {
    background: #d1ecf1;
    border-color: #0c5460;
    color: #0c5460;
}

.action-buttons {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-instagram {
    background: linear-gradient(135deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: white;
}

.btn-instagram:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.4);
}

.roulette-section {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.roulette-container {
    text-align: center;
}

.roulette-display {
    font-size: 5em;
    font-weight: 900;
    color: white;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    padding: 40px;
    animation: rouletteShake 0.1s infinite;
}

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

.roulette-display.stopped {
    animation: roulettePop 0.5s;
}

@keyframes roulettePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.roulette-label {
    color: white;
    font-size: 1.3em;
    font-weight: 600;
}

.result-section {
    grid-column: 1 / -1;
}

.result-canvas-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    background: #f5f5f5;
    border-radius: 15px;
    padding: 20px;
}

#finalCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: #f44336;
}

.toast.success {
    background: #4caf50;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .video-container {
        flex-direction: column;
    }

    .roulette-display {
        font-size: 3em;
        padding: 20px;
    }

    .result-buttons {
        flex-direction: column;
    }

    section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    section {
        padding: 15px;
    }

    .btn {
        font-size: 1em;
        padding: 12px 20px;
    }

    .roulette-display {
        font-size: 2.5em;
    }
}
