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

:root {
    --primary: #1E40AF;
    --primary-hover: #1D4ED8;
    --secondary: #F97316;
    --bg: #0F172A;
    --surface: #1E293B;
    --surface-hover: #334155;
    --border: #334155;
    --text: #F8FAFC;
    --text-muted: #94A3B8;
    --text-secondary: #CBD5E1;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--info);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 600;
    font-size: 18px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.main {
    flex: 1;
}

.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
}

.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.card-image {
    height: 160px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: rgba(30, 64, 175, 0.2);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.2);
    color: #64748B;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.tournament-card {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 24px;
}

.tournament-image {
    width: 200px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.tournament-info {
    flex: 1;
}

.tournament-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tournament-game {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 12px;
}

.tournament-meta {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.tournament-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 16px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--text);
}

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--surface);
    color: var(--text);
}

.bracket-viewer {
    overflow-x: auto;
    padding: 20px 0;
}

.bracket {
    display: flex;
    gap: 60px;
    min-width: max-content;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 220px;
}

.round-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
}

.match-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.match-card:hover {
    border-color: var(--primary);
}

.match-card.completed {
    border-color: var(--success);
}

.match-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.match-team:first-child {
    border-bottom: 1px solid var(--border);
}

.team-name {
    font-size: 14px;
    font-weight: 500;
}

.team-name.winner {
    color: var(--success);
}

.team-name.tbd {
    color: var(--text-muted);
    font-style: italic;
}

.team-score {
    font-size: 16px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--surface-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    fill: none;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-muted);
}

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-link:hover {
    color: var(--text);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tournament-card {
        grid-template-columns: 1fr;
    }

    .tournament-image {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 16px;
    }

    .nav {
        flex-direction: column;
        gap: 16px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 32px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-inner {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .nav-links.open {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 20px;
        border-top: 1px solid var(--border);
    }
}
