:root {
    --raffle-bg: #060811;
    --raffle-text: #f4f7ff;
    --raffle-muted: #9aa8c8;
    --raffle-dim: #61708f;
    --raffle-cyan: #00d9ff;
    --raffle-purple: #8b5cf6;
    --raffle-gold: #fbbf24;
    --raffle-green: #34d399;
    --raffle-red: #f43f5e;
    --raffle-card: rgba(12, 17, 31, 0.68);
    --raffle-border: rgba(255, 255, 255, 0.1);
    --raffle-border-strong: rgba(255, 255, 255, 0.18);
    --raffle-radius: 28px;
    --raffle-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --raffle-gradient: linear-gradient(135deg, var(--raffle-cyan), var(--raffle-purple));
    --raffle-prize-gradient: linear-gradient(135deg, #fff7cc, var(--raffle-gold), #fb7185);
    --raffle-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(circle at 18% -10%, rgba(0, 217, 255, 0.16), transparent 32rem),
        radial-gradient(circle at 92% 12%, rgba(139, 92, 246, 0.18), transparent 34rem),
        radial-gradient(circle at 50% 100%, rgba(251, 191, 36, 0.08), transparent 32rem),
        var(--raffle-bg);
    color: var(--raffle-text);
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
        radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, 0.42) 100%);
    background-size: 68px 68px, 68px 68px, auto;
    mask-image: linear-gradient(to bottom, black, transparent 92%);
}

#webCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1240px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

h1,
h2,
h3 {
    font-weight: 900;
    letter-spacing: -0.045em;
    background: linear-gradient(135deg, #ffffff 20%, #d8f8ff 54%, #bba7ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

h1 {
    position: relative;
    display: inline-block;
    font-size: clamp(2.5rem, 7vw, 5rem);
    line-height: 0.96;
    margin-bottom: 1rem;
    animation: fadeInUp 0.75s var(--raffle-ease);
}

h1::after {
    content: "PRIZE DROP";
    display: block;
    margin-top: 0.8rem;
    color: var(--raffle-gold);
    -webkit-text-fill-color: var(--raffle-gold);
    font-size: 0.18em;
    font-weight: 900;
    letter-spacing: 0.32em;
}

h2 {
    margin: 1.75rem 0 1rem;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
}

h3 {
    font-size: 1.45rem;
}

.raffle-card {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at top right, rgba(0, 217, 255, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
        var(--raffle-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--raffle-radius);
    padding: 1.7rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--raffle-border);
    box-shadow: var(--raffle-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: transform 0.32s var(--raffle-ease), border-color 0.32s var(--raffle-ease), box-shadow 0.32s var(--raffle-ease), background 0.32s var(--raffle-ease);
    overflow: hidden;
}

.raffle-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    background: radial-gradient(540px circle at 82% 18%, rgba(251, 191, 36, 0.12), transparent 38%);
    opacity: 0;
    transition: opacity 0.32s var(--raffle-ease);
}

.raffle-card:hover {
    transform: translateY(-7px);
    border-color: rgba(0, 217, 255, 0.28);
    box-shadow: var(--raffle-shadow), 0 0 40px rgba(0, 217, 255, 0.12);
}

.raffle-card:hover::before {
    opacity: 1;
}

.prize {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.18rem;
    background: var(--raffle-prize-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 900;
    margin: 0.55rem 0;
}

.prize::before {
    content: "◆";
    color: var(--raffle-gold);
    -webkit-text-fill-color: var(--raffle-gold);
    font-size: 0.8em;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.35));
}

.deadline {
    font-family: 'Consolas', 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.28);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.46rem 0.82rem;
    border-radius: 999px;
    font-size: 0.86rem;
    margin: 0.8rem 0;
    color: var(--raffle-muted);
    border: 1px solid var(--raffle-border);
}

.deadline::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--raffle-cyan);
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.55);
}

.countdown {
    font-weight: 900;
    color: #bff6ff;
    text-shadow: 0 0 14px rgba(0, 217, 255, 0.34);
}

.participate-form,
.form-admin,
.avatar-upload,
.raffle-admin,
.participants-list,
.empty {
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--raffle-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.participate-form,
.form-admin,
.avatar-upload {
    border-radius: 22px;
    padding: 1.2rem;
    margin-top: 1.2rem;
}

input,
textarea,
select,
button {
    font-family: inherit;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--raffle-border);
    border-radius: 16px;
    padding: 0.78rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.22s var(--raffle-ease), box-shadow 0.22s var(--raffle-ease), background 0.22s var(--raffle-ease), transform 0.22s var(--raffle-ease);
    width: 100%;
    margin-bottom: 0.8rem;
}

input::placeholder,
textarea::placeholder {
    color: rgba(154, 168, 200, 0.72);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(0, 217, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1), 0 0 22px rgba(0, 217, 255, 0.14);
    background: rgba(255, 255, 255, 0.075);
}

button.btn {
    width: auto;
    padding: 0.78rem 1.35rem;
    border: none;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    background: var(--raffle-gradient);
    box-shadow: 0 14px 30px rgba(0, 217, 255, 0.2);
}

button.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(0, 217, 255, 0.28);
}

.btn.small {
    padding: 0.48rem 0.9rem;
    font-size: 0.8rem;
    margin: 0 0.2rem;
}

.btn.danger {
    background: linear-gradient(135deg, var(--raffle-red), #b91c1c);
    box-shadow: 0 12px 28px rgba(244, 63, 94, 0.22);
}

.raffle-admin {
    border-radius: 24px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.inline-form input,
.inline-form select,
.inline-form button {
    width: auto;
    flex: 1 1 auto;
    margin-bottom: 0;
}

.participants-list {
    margin-top: 1rem;
    font-size: 0.86rem;
    border-radius: 18px;
    padding: 0.9rem;
    color: var(--raffle-muted);
}

.winner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-left: 4px solid var(--raffle-gold);
    padding: 0.72rem 0.85rem;
    margin-top: 0.85rem;
    border-radius: 16px;
}

.alert {
    border-radius: 18px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid var(--raffle-border);
    border-left: 5px solid;
    animation: fadeInRight 0.42s var(--raffle-ease);
}

.alert.success { border-left-color: var(--raffle-green); color: #a7f3d0; }
.alert.error { border-left-color: var(--raffle-red); color: #fecaca; }
.alert.info { border-left-color: var(--raffle-cyan); color: #bfdbfe; }

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

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

.raffle-card,
.raffle-admin {
    animation: fadeInUp 0.58s var(--raffle-ease) backwards;
    animation-delay: calc(var(--order, 0) * 0.08s);
}

.captcha {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.captcha-img {
    border-radius: 14px;
    border: 1px solid rgba(0, 217, 255, 0.28);
    background: #0f172a;
    height: 48px;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.08);
}

.empty {
    text-align: center;
    padding: 3rem;
    border-radius: 26px;
    color: var(--raffle-muted);
    font-size: 1.1rem;
}

.raffle-image {
    text-align: center;
    margin-bottom: 1rem;
}

.raffle-image img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    border: 1px solid var(--raffle-border-strong);
}

.completed-section {
    margin-top: 3.2rem;
}

.completed-section h2 {
    margin-bottom: 1.5rem;
}

.raffle-card.completed {
    opacity: 0.94;
    border-color: rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.08), transparent 42%),
        rgba(12, 17, 31, 0.6);
}

.raffle-card.completed:hover {
    border-color: rgba(251, 191, 36, 0.34);
}

.raffle-card.completed h3 {
    font-size: 1.45rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff, #d1d5db);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.completed-date {
    color: var(--raffle-dim);
}

.raffle-card.completed .winner {
    font-size: 1.04rem;
    font-weight: 800;
}

.raffle-card.completed .winner i {
    color: var(--raffle-gold);
    margin-right: 0.4rem;
}

::-webkit-scrollbar {
    width: 8px;
    background: #070b15;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--raffle-cyan), var(--raffle-purple));
    border-radius: 10px;
}

@media (max-width: 760px) {
    .container {
        padding: 1.4rem 1rem 3rem;
    }

    h1 {
        font-size: 2.55rem;
    }

    .raffle-card,
    .raffle-admin {
        border-radius: 22px;
        padding: 1.2rem;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form input,
    .inline-form select,
    .inline-form button,
    button.btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}