* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: background 0.4s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

h1 {
    color: var(--text-primary);
    font-size: 2.2em;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1em;
}

.sport-selector {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--border-color);
}

.sport-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--accent-color);
    background: var(--bg-secondary);
    color: var(--accent-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sport-btn.active {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sport-btn:hover:not(.active) {
    transform: translateY(-2px);
    background: var(--bg-tertiary);
}

.stats {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.stat {
    flex: 1;
    min-width: 120px;
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    transition: background 0.3s ease;
}

.stat-value {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.controls {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    transition: all 0.3s ease;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
}

select, input[type="text"] {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border 0.3s;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination button {
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9em;
}

.pagination button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.pagination button:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.page-info {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.3s ease;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-btn {
    padding: 10px 18px;
    border: 2px solid var(--accent-color);
    background: var(--bg-secondary);
    color: var(--accent-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.95em;
}

.view-btn.active {
    background: var(--accent-color);
    color: white;
}

.view-btn:hover {
    transform: translateY(-2px);
}

.lang-btn {
    padding: 10px 18px;
    border: 2px solid var(--accent-color);
    background: var(--bg-secondary);
    color: var(--accent-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.95em;
}

.lang-btn:hover {
    transform: translateY(-2px);
    background: var(--accent-color);
    color: white;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.match-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.match-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.match-card.future {
    opacity: 0.5;
    filter: grayscale(1);
}

.match-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.competition-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.competition-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-competition {
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    border-radius: 0;
    font-size: 0.95em;
    font-weight: 700;
}

.match-date {
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.85em;
}

.match-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--warning-color);
    color: white;
}

.match-phase {
    font-size: 0.8em;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
    flex: 1;
}

.team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.team-name {
    font-weight: 600;
    font-size: 1em;
    color: var(--text-primary);
    flex: 1;
}

.team-name.winner {
    font-weight: 700;
    color: var(--success-color);
}

.score {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 35px;
    text-align: center;
    transition: color 0.3s ease;
}

.score.winner {
    color: var(--success-color);
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 10px;
}

@media (prefers-color-scheme: dark) {
    .broadcaster-logo {
        filter: brightness(0) invert(1);
    }
}

.broadcaster-logo {
    height: 24px;
    max-width: 60px;
    object-fit: contain;
}

.tech-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tech-badge {
    padding: 4px 10px;
    border: 1px solid var(--text-primary);
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: background 0.3s ease;
}

.matches-list {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.list-item {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
    display: grid;
    grid-template-columns: 100px 1fr 130px 60px;
    gap: 15px;
    align-items: center;
}

.list-item:hover {
    background: var(--bg-tertiary);
}

.list-item.future {
    opacity: 0.5;
    filter: grayscale(1);
}

.list-item:last-child {
    border-bottom: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: var(--accent-color);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    position: relative;
    transition: background 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.modal-title-competition {
    text-align: center;
    font-size: 0.75em;
    font-weight: 600;
}

.modal-title-phase {
    text-align: center;
    font-size: 0.6em;
    font-weight: 500;
}

.score-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.score-mobile {
    display: none;
}

.score-team-name {
    font-weight: 600;
}

.score-team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.score-value {
    font-size: 1.2em;
    font-weight: 700;
}

.score-vs {
    font-size: 1em;
    font-weight: 600;
}

.score-status-badge {
    margin-left: 10px;
}

.score-mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.score-mobile-row:last-of-type {
    margin-bottom: 0;
}

.score-mobile-team {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.score-mobile-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.score-mobile-value {
    font-size: 1.3em;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.score-mobile-status {
    margin-top: 10px;
    text-align: center;
}

@media (max-width: 768px) {
    .score-desktop {
        display: none !important;
    }
    
    .score-mobile {
        display: block !important;
    }
    
    .modal-content {
        max-width: 95%;
    }
}

.modal-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 8px;
    max-height: 475px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.3em;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
}

.detail-section {
    margin-bottom: 18px;
}

.section-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    transition: color 0.3s ease;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.detail-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85em;
    margin-bottom: 4px;
}

.detail-value {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.storage-badges {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 14px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85em;
}

.badge-success { background: var(--success-color); color: white; }
.badge-info { background: var(--info-color); color: white; }
.badge-warning { background: var(--warning-color); color: white; }

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-primary);
}

.empty-state h2 {
    font-size: 1.8em;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 1em;
    opacity: 0.9;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}