:root {
    --primary: #00f2fe;
    --primary-dark: #4facfe;
    --accent: #ff0844;
    --accent-light: #ffb199;
    --bg-dark: #0f172a;
    --bg-darker: #0b1120;
    --surface: rgba(30, 41, 59, 0.85);
    --surface-light: rgba(255, 255, 255, 0.1);
    --surface-border: rgba(255, 255, 255, 0.15);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-darker);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

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

/* Background */
.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://offertabs.s3.amazonaws.com/offer/c5aj7k/69c4ad30435466.96204662.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
}

.page-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7) 0%, rgba(11, 17, 32, 0.95) 100%);
    z-index: -1;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 {
    font-size: 2rem;
    color: #fff;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Layout */
.hero {
    padding: 60px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--surface-border);
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(4px);
}

.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.form-section {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* Matchup Wizard */
.matchup-wizard {
    max-width: 800px;
    margin: 0 auto;
}

.matchup-progress {
    margin-bottom: 20px;
}

.matchup-progress span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: right;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    width: 0%;
    transition: width 0.3s ease;
}

.match-round-title {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.matchup-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.wizard-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--surface-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: center;
}

.wizard-team:hover:not(.empty) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.wizard-team.selected {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(0, 242, 254, 0.2));
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.wizard-team.empty {
    cursor: default;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    opacity: 0.5;
}

.wizard-team-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    background: #fff;
    border: 3px solid var(--surface-light);
}

.wizard-team.selected .wizard-team-image {
    border-color: var(--primary);
}

.wizard-team-name {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-head);
}

.wizard-vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-muted);
    font-style: italic;
    background: var(--surface-light);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.wizard-actions .btn {
    min-width: 160px;
}

#btn-next-match {
    margin-left: auto;
}

/* Bracket Summary UI */
.bracket-section {
    width: 100%;
}

.bracket-header {
    margin-bottom: 2rem;
}

.bracket-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.correct { background: linear-gradient(135deg, #10b981, #059669); }
.legend-color.wrong { background: linear-gradient(135deg, #ef4444, #dc2626); }
.legend-color.actual { box-shadow: inset 0 0 0 2px #10b981; background: rgba(16, 185, 129, 0.1); }

.bracket-scroll-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-dark) var(--surface-light);
}

.bracket-scroll-container::-webkit-scrollbar {
    height: 8px;
}
.bracket-scroll-container::-webkit-scrollbar-track {
    background: var(--surface-light);
    border-radius: 4px;
}
.bracket-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-dark);
    border-radius: 4px;
}

.bracket-ui {
    display: flex;
    flex-direction: row;
    gap: 30px;
    min-width: 800px;
    justify-content: space-between;
    align-items: stretch;
    min-height: 500px;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

.round-title {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 20px;
    letter-spacing: 1px;
    height: 24px;
    flex: 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-matchups {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
}

.matchup {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 1;
}

.champ-matchup {
    border: none;
    background: transparent;
    box-shadow: none;
    align-items: center;
}

.seed-slot {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 48px;
}

.seed-slot.selected {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);
}

.seed-slot.selected.pick-correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.seed-slot.selected.pick-wrong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    color: #fff;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.seed-slot.actual-winner {
    box-shadow: inset 0 0 0 2px #10b981, 0 0 10px rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.1);
}

.pick-icon {
    margin-left: auto;
    font-weight: 900;
    font-size: 1.2rem;
    padding-left: 8px;
    line-height: 1;
}

.seed-slot.empty {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    font-style: italic;
    background: transparent;
}

.seed-slot.locked {
    cursor: default;
}

.seed-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    background: #fff;
}

.seed-name {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matchup-vs {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1;
    margin: 2px 0;
}

.round-champ .seed-slot {
    padding: 20px;
    font-size: 1.2rem;
    min-height: 80px;
    justify-content: center;
    border: 2px solid var(--accent);
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.3);
}

.bracket-actions {
    margin-top: 30px;
}

/* Forms & Buttons */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #cbd5e1;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    color: #fff;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 8, 68, 0.5);
}

.btn-primary:disabled {
    background: var(--surface-light);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--surface-border);
}

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

.btn-large {
    padding: 16px 36px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: left;
}

/* Success & Share */
.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.share-panel {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--surface-border);
}

.share-controls {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.share-controls input {
    flex: 1;
}

/* Leaderboard */
.highlight-score {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--primary);
    border-radius: 99px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 2rem;
}

.table-responsive {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 16px;
    border-bottom: 1px solid var(--surface-border);
}

.leaderboard-table th {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr.current-user {
    background: rgba(0, 242, 254, 0.1);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-light);
    font-weight: 700;
    font-size: 0.9rem;
}

tr:nth-child(1) .rank-badge { background: linear-gradient(135deg, #ffd700, #daa520); color: #000; }
tr:nth-child(2) .rank-badge { background: linear-gradient(135deg, #e3e3e3, #a9a9a9); color: #000; }
tr:nth-child(3) .rank-badge { background: linear-gradient(135deg, #cd7f32, #8b4513); color: #fff; }

/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 2rem;
}

.countdown-block {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--primary-dark);
    border-radius: 12px;
    padding: 15px;
    min-width: 80px;
}

.countdown-block span {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-head);
    color: var(--primary);
    line-height: 1;
}

.countdown-block small {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Powered By */
#wbx-powered-by-slot {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Media Queries */
@media (max-width: 768px) {
    .card {
        padding: 30px 20px;
    }
    
    .hero {
        padding: 40px 15px 30px;
    }
    
    .bracket-ui {
        gap: 15px;
        min-width: 700px;
    }
    
    .share-controls {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .matchup-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .wizard-team {
        width: 100%;
        min-width: 0;
    }
    
    .wizard-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .wizard-actions .btn {
        width: 100%;
        margin-left: 0 !important;
    }
}
