:root {
    --bg: #07080f;
    --bg-elevated: #0d1019;
    --surface: rgba(16, 20, 34, 0.72);
    --surface-strong: #12182a;
    --surface-soft: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f5f7ff;
    --muted: #97a0ba;
    --primary: #8b5cf6;
    --primary-2: #6366f1;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --discord: #5865f2;
    --discord-hover: #4752c4;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --gold: #fbbf24;
    --silver: #d1d5db;
    --bronze: #d97706;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --glass: blur(18px) saturate(140%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

a {
    color: inherit;
}

.ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #07080f;
    overflow: hidden;
}

.page-bg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

.page-bg-overlay {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(7, 8, 15, 0.15) 0%, rgba(7, 8, 15, 0.45) 100%);
}

body.has-page-bg .orb {
    opacity: 0.1;
}

body.has-page-bg .grid-overlay {
    opacity: 0.2;
}

body.has-page-bg .section-card {
    background: rgba(12, 16, 28, 0.82);
    backdrop-filter: blur(16px) saturate(130%);
}

body.has-page-bg .hero.has-image {
    background: transparent;
    backdrop-filter: none;
}

body.has-page-bg .header {
    background: rgba(7, 8, 15, 0.55);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: float 14s ease-in-out infinite;
}

.orb-1 {
    width: 420px;
    height: 420px;
    top: -80px;
    left: -60px;
    background: #7c3aed;
}

.orb-2 {
    width: 360px;
    height: 360px;
    top: 20%;
    right: -80px;
    background: #4f46e5;
    animation-delay: -4s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    bottom: -60px;
    left: 35%;
    background: #06b6d4;
    animation-delay: -8s;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(24px) scale(1.04); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: var(--glass);
    background: rgba(7, 8, 15, 0.72);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-logo {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
    border-radius: 12px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    box-shadow: 0 10px 30px var(--primary-glow);
}

.brand-text {
    font-size: 1.05rem;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.35rem 0.8rem 0.35rem 0.35rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.username {
    font-size: 0.9rem;
    font-weight: 600;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.main {
    padding: 2rem 0 4.5rem;
    display: grid;
    gap: 1.5rem;
}

.main > * {
    animation: fadeUp 0.6s ease both;
}

.main > *:nth-child(2) { animation-delay: 0.05s; }
.main > *:nth-child(3) { animation-delay: 0.1s; }
.main > *:nth-child(4) { animation-delay: 0.15s; }
.main > *:nth-child(5) { animation-delay: 0.2s; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.78rem 1.2rem;
    border-radius: 14px;
    border: none;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 1.6rem;
    font-size: 1.02rem;
    border-radius: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    box-shadow: 0 14px 40px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 18px 48px rgba(99, 102, 241, 0.45);
}

.btn-discord {
    background: var(--discord);
    color: white;
    box-shadow: 0 12px 32px rgba(88, 101, 242, 0.28);
}

.btn-discord .fa-discord {
    font-size: 1.2rem;
    line-height: 1;
}

.btn-discord.btn-lg .fa-discord {
    font-size: 1.35rem;
}

.btn-discord:hover {
    background: var(--discord-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: var(--glass);
}

.alert::before {
    font-size: 1.1rem;
}

.alert-success { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.alert-success::before { content: '✓'; color: var(--success); }
.alert-error { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.alert-error::before { content: '!'; color: var(--danger); }
.alert-info { border-color: rgba(96, 165, 250, 0.35); background: rgba(96, 165, 250, 0.08); }
.alert-info::before { content: 'i'; color: #60a5fa; }
.alert-warning { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.alert-warning::before { content: '⚠'; color: var(--warning); }

.hero {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(18, 24, 42, 0.92), rgba(10, 12, 20, 0.88));
    box-shadow: var(--shadow);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), transparent 45%, rgba(6, 182, 212, 0.08));
    pointer-events: none;
}

.hero-layout {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 460px;
}

.hero.has-image {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.12);
}

.hero.has-image::before {
    display: none;
}

.hero.has-image .hero-visual {
    padding: 0;
    background: #080a12;
    min-height: 500px;
}

.hero.has-image .hero-visual img {
    width: 100%;
    height: 100%;
    min-height: 500px;
    max-height: none;
    object-fit: contain;
    object-position: center center;
    border-radius: 0;
}

.hero.has-image .hero-visual-overlay {
    background: linear-gradient(90deg, transparent 68%, rgba(10, 12, 20, 0.97) 100%);
}

.hero.has-image .hero-content {
    background: rgba(10, 12, 20, 0.96);
    backdrop-filter: blur(14px);
}

.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 460px;
    overflow: hidden;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.15);
}

.hero-visual img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 440px;
    object-fit: contain;
    object-position: center center;
    display: block;
    border-radius: 12px;
    box-shadow: none;
    transition: transform 0.4s ease;
}

.hero:hover .hero-visual img {
    transform: scale(1.02);
}

.hero-visual-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 55%, rgba(12, 16, 28, 0.85) 100%);
}

.hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 320px;
    background:
        radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.25), transparent 50%),
        linear-gradient(160deg, #151b30, #0b0f1a);
    font-size: 4rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.2rem;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-live {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-live::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulseDot 1.4s ease infinite;
}

.badge-ended {
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-off {
    background: rgba(151, 160, 186, 0.12);
    color: var(--muted);
    border: 1px solid var(--border);
}

.hero-tag {
    color: var(--muted);
    font-size: 0.88rem;
}

.hero-content h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 0.85rem;
}

.description {
    color: var(--muted);
    font-size: 1.02rem;
    margin-bottom: 1.6rem;
    max-width: 56ch;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.05rem;
    font-weight: 700;
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.6rem;
}

.countdown-item {
    position: relative;
    padding: 1rem 0.55rem;
    border-radius: var(--radius-sm);
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    overflow: hidden;
}

.countdown-item::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    opacity: 0.7;
}

.countdown-item span {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.countdown-item small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.actions .hint {
    margin-top: 0.85rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.actions .hint.warning {
    color: #fcd34d;
}

.joined-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    font-weight: 700;
    border: 1px solid rgba(52, 211, 153, 0.28);
    box-shadow: 0 12px 30px rgba(52, 211, 153, 0.12);
}

.section-card {
    padding: 1.6rem 1.8rem 1.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: var(--glass);
    box-shadow: var(--shadow);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.section-head h2 {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.section-sub {
    color: var(--muted);
    font-size: 0.92rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.step-card {
    position: relative;
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-size: 0.85rem;
    font-weight: 800;
}

.step-card h3 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.step-card p {
    color: var(--muted);
    font-size: 0.9rem;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.prize-card {
    position: relative;
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    overflow: hidden;
}

.prize-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.prize-card.place-1::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.prize-card.place-2::before { background: linear-gradient(90deg, #e5e7eb, #9ca3af); }
.prize-card.place-3::before { background: linear-gradient(90deg, #d97706, #b45309); }

.prize-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.prize-card h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.prize-card .prize-name {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: 1.35;
}

.prize-card .count {
    color: var(--muted);
    font-size: 0.9rem;
}

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: end;
}

.podium-slot {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.podium-slot.rank-1 {
    order: 2;
    min-height: 220px;
    border-color: rgba(251, 191, 36, 0.35);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(255,255,255,0.02));
}

.podium-slot.rank-2 {
    order: 1;
    min-height: 180px;
}

.podium-slot.rank-3 {
    order: 3;
    min-height: 160px;
}

.podium-rank {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.podium-slot img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 0.6rem;
    border: 3px solid rgba(255,255,255,0.12);
}

.podium-slot.rank-1 img {
    width: 78px;
    height: 78px;
    border-color: rgba(251, 191, 36, 0.45);
}

.podium-name {
    font-weight: 700;
}

.podium-label {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.winner-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
}

.winner-list li,
.participant-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.winner-list li:hover,
.participant-list li:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.winner-list img,
.participant-list img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.14);
    color: #c4b5fd;
    font-size: 0.85rem;
    font-weight: 700;
}

.participant-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
}

.winner-subsection {
    margin-top: 1.25rem;
}

.winner-subsection h3 {
    margin-bottom: 0.75rem;
    color: var(--muted);
}

.footer {
    border-top: 1px solid var(--border);
    padding: 1.6rem 0 2.2rem;
    background: rgba(7, 8, 15, 0.5);
}

.footer-inner {
    text-align: center;
}

.footer-sub {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.85rem;
}

@media (max-width: 960px) {
    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero.has-image .hero-visual,
    .hero.has-image .hero-visual img {
        min-height: 300px;
    }

    .hero.has-image .hero-visual img {
        max-height: 320px;
    }

    .hero-visual-overlay,
    .hero.has-image .hero-visual-overlay {
        background: linear-gradient(180deg, transparent 50%, rgba(10, 12, 20, 0.96) 100%);
    }

    .steps-grid,
    .prize-grid,
    .podium {
        grid-template-columns: 1fr;
    }

    .podium-slot.rank-1,
    .podium-slot.rank-2,
    .podium-slot.rank-3 {
        order: unset;
        min-height: auto;
    }

    .stats-row,
    .countdown {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .user-chip .user-meta {
        display: none;
    }

    .hero-content {
        padding: 1.4rem;
    }

    .section-card {
        padding: 1.2rem;
    }

    .stats-row,
    .countdown {
        grid-template-columns: 1fr 1fr;
    }
}
