:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --ig-gradient-hover: linear-gradient(45deg, #f09433 10%, #e6683c 35%, #dc2743 60%, #cc2366 85%, #bc1888 100%);
    --accent: #ec4899;
    --success: #10b981;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs for Glassmorphism */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: #bc1888;
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: #f09433;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 30px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    z-index: 1;
}

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

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: var(--ig-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideUp 0.5s forwards;
}

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

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-align: center;
}

/* Inputs */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

input[type="url"] {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="url"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

/* Checkbox */
.options {
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
    color: var(--text-main);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -2px;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent);
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--ig-gradient);
    border-color: transparent;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 8px;
    top: 4px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1.1rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--ig-gradient);
    color: white;
    box-shadow: 0 10px 20px -10px rgba(220, 39, 67, 0.5);
}

.btn-primary:hover {
    background: var(--ig-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(220, 39, 67, 0.6);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-draw {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 1.2rem;
    padding: 1.25rem;
    box-shadow: 0 10px 20px -10px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.btn-draw:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    transform: translateY(-2px) scale(1.02);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Spinners & Loaders */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.btn.loading .btn-text {
    display: none;
}

.btn.loading .spinner {
    display: block;
}

.loading-section {
    text-align: center;
}

.loader-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.instagram-loader {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--ig-gradient);
    position: relative;
    animation: pulse-loader 1.5s infinite alternate;
}

.instagram-loader::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 4px solid var(--bg-dark);
    border-radius: 50%;
}

.instagram-loader::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 6px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 50%;
}

@keyframes pulse-loader {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

.stats {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin-top: 1rem;
}

/* Ready Section */
.stats-box {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--ig-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Winner Section */
.winner-section {
    text-align: center;
}

.winner-header h2 {
    font-size: 2rem;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.winner-card {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.winner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--ig-gradient);
}

.winner-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.winner-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-dark);
    box-shadow: 0 0 0 3px var(--accent);
}

.crown {
    position: absolute;
    top: -15px;
    right: -10px;
    font-size: 1.8rem;
    color: #fbbf24;
    transform: rotate(15deg);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    animation: crownBounce 2s infinite ease-in-out;
}

@keyframes crownBounce {
    0%, 100% { transform: rotate(15deg) translateY(0); }
    50% { transform: rotate(15deg) translateY(-5px); }
}

.winner-username {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.winner-comment {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    font-style: italic;
    color: var(--text-main);
    border-left: 4px solid var(--accent);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
}
