* {
    box-sizing: border-box;
}
.livescore-container,
.ls-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 10px 40px;
}
.ls-header {
    text-align: center;
    margin-bottom: 15px;
}
.ls-header h1 {
    font-size: 22px;
    margin: 0;
    color: var(--accent);
}
.ls-header .ls-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}
.ls-favorites-header,
.ls-live-header,
.ls-fixture-header,
.ls-league-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 4px;
    padding: 6px 12px;
    width: 100%;
    box-sizing: border-box;
}
.ls-favorites-header {
    border-bottom: 2px solid #FFD700;
    background: linear-gradient(90deg, #3a3a2a, var(--bg-surface));
    border-radius: 6px 6px 0 0;
}
.ls-favorites-header i {
    color: #FFD700;
    font-size: 18px;
}
.ls-favorites-header .ls-league-name {
    color: #FFD700;
    font-size: 13px;
    font-weight: bold;
}
.ls-favorites-header .ls-match-count {
    color: #FFD700;
    margin-left: auto;
    font-size: 11px;
}
.ls-live-header {
    border-bottom: 2px solid var(--accent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--bg-body)), var(--bg-surface));
    border-radius: 6px 6px 0 0;
}
.ls-live-header i {
    color: var(--accent);
    font-size: 18px;
}
.ls-live-header .ls-league-name {
    color: var(--accent);
    font-size: 13px;
    font-weight: bold;
}
.ls-fixture-header {
    border-bottom: 2px solid #FF9800;
    background: linear-gradient(90deg, #3a3a2a, var(--bg-surface));
    border-radius: 6px 6px 0 0;
}
.ls-fixture-header i {
    color: #FF9800;
    font-size: 18px;
}
.ls-fixture-header .ls-league-name {
    color: #FF9800;
    font-size: 13px;
    font-weight: bold;
}
.ls-league-header {
    border-bottom: 1px solid var(--border);
    position: relative;
}
.ls-league-logo {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: contain;
    background: #444;
}
.ls-league-header .ls-league-name {
    font-size: 13px;
    font-weight: bold;
    color: var(--accent);
}
.ls-league-country {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}
.ls-hide-button {
    margin-left: 5px;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    color: var(--text-muted);
    width: 22px;
    text-align: center;
}
.ls-hide-button:hover {
    color: var(--accent);
}
.ls-league-matches.ls-hidden {
    display: none;
}
.ls-match-card,
.football-match-card {
    background: var(--bg-surface);
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    border-left: 4px solid transparent;
    transition: background 0.2s;
    cursor: pointer;
    line-height: 1;
    width: 100%;
    box-sizing: border-box;
}
.ls-match-card:hover,
.football-match-card:hover {
    background: color-mix(in srgb, var(--text) 8%, var(--bg-surface));
}
.ls-match-card.ls-live {
    border-left-color: var(--accent);
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, var(--bg-body)), var(--bg-surface));
}
.ls-match-card.ls-finished,
.football-match-card.finished {
    border-left-color: var(--text-muted);
    opacity: 0.95;
}
.ls-match-card.ls-fixture,
.football-match-card.fixture {
    border-left-color: #FF9800;
}
.ls-match-card.ls-special {
    border-left-color: #f44336;
    background: linear-gradient(90deg, #3a2a2a, var(--bg-surface));
}
.ls-match-card.ls-favorite-match {
    border-left-color: #FFD700;
    background: linear-gradient(90deg, #3a3a2a, var(--bg-surface));
}
.ls-team-section,
.team-section {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0;
}
.ls-team-home,
.ls-team-away,
.team-home,
.team-away {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
}
.ls-team-home,
.team-home {
    justify-content: flex-end;
}
.ls-team-away,
.team-away {
    justify-content: flex-start;
}
.ls-team-name,
.team-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 13px;
    color: var(--text);
    margin: 0;
    line-height: 24px;
}
.ls-team-logo,
.team-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: contain;
    background: #444;
    flex-shrink: 0;
}
.ls-red-card-icon {
    color: #ff4444;
    font-size: 12px;
    margin: 0 2px;
    filter: drop-shadow(0 0 3px #ff0000);
    flex-shrink: 0;
}
.ls-score-container,
.score-container,
.ls-fixture-time,
.fixture-time,
.ls-special-status,
.match-center {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.ls-fixture-time,
.fixture-time {
    font-family: monospace;
    font-size: 13.5px;
    font-weight: 600;
    color: #FF9800;
}
.ls-special-status {
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    padding: 2px 4px;
    border-radius: 12px;
}
.ls-score,
.score {
    font-weight: bold;
    font-size: 15px;
    padding: 0 4px;
    color: var(--text);
}
.ls-score.ls-home,
.ls-score.ls-away {
    color: var(--accent-2);
}
.ls-score-dash,
.score-dash {
    color: var(--text-muted);
    font-weight: bold;
    font-size: 15px;
}
.ls-time-display,
.status-time {
    font-family: monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    text-align: center;
    margin-left: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
}
.ls-time-display.ls-live,
.status-time.ls-live {
    background: var(--accent);
    color: var(--text);
    animation: ls-pulse 1.5s infinite;
}
.ls-time-display.ls-finished,
.status-time.finished {
    background: var(--text-muted);
    color: var(--text);
}
.ls-time-display.ls-special {
    background: #f44336;
    color: var(--text);
}
.ls-time-display.ls-fixture,
.status-time.fixture {
    background: transparent;
    color: transparent;
}
@keyframes ls-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}
.ls-score.ls-blink-home,
.ls-score.ls-blink-away {
    animation: ls-blinkGoal 0.8s ease-in-out 10;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700;
}
@keyframes ls-blinkGoal {
    0% { color: #FFD700; text-shadow: 0 0 10px #FFD700; transform: scale(1.2); }
    50% { color: #FFD700; text-shadow: 0 0 20px #FFA500; transform: scale(1.4); }
    100% { color: #FFD700; text-shadow: 0 0 10px #FFD700; transform: scale(1.2); }
}
.ls-star-icon {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    margin-right: 2px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}
.ls-star-icon:hover,
.ls-star-icon.ls-favorited {
    color: #FFD700;
}
@media (max-width: 640px) {
    .ls-team-name,
    .team-name {
        font-size: 12px;
    }
}
#ls-popup-container {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 350px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.ls-popup-item {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 2px solid white;
    animation: ls-slideDown 0.3s ease-out;
}
.ls-popup-header {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.2);
}
.ls-popup-icon {
    font-size: 19px;
    min-width: 45px;
    text-align: center;
}
.ls-popup-title {
    font-size: 18px;
    font-weight: bold;
    color: white;
    flex: 1;
}
.ls-popup-body {
    padding: 12px;
    background: rgba(0,0,0,0.1);
}
.ls-popup-team-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin: 0 4px;
    vertical-align: middle;
}
.ls-popup-score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    width: auto;
    min-width: 0;
    max-width: none;
}
.ls-popup-team-score {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
}
.ls-popup-team-score.ls-left { justify-content: flex-end; }
.ls-popup-team-score.ls-right { justify-content: flex-start; }
.ls-popup-team-name {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
.ls-popup-score-number {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    margin: 0 4px;
}
.ls-popup-score-number.ls-blink-green {
    color: #4ade80;
    animation: ls-blinkGreen 1s ease-in-out 3;
}
.ls-popup-score-number.ls-white { color: white; }
.ls-popup-score-dash {
    font-size: 28px;
    color: rgba(255,255,255,0.5);
    font-weight: bold;
    margin: 0 4px;
}
.ls-popup-red-card-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
}
.ls-popup-red-card-display .ls-popup-team-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ls-popup-red-card-display .ls-popup-team-item .ls-popup-team-name.ls-blink-red-team {
    color: #f87171;
    animation: ls-blinkRedTeam 1s ease-in-out 3;
}
.ls-popup-info {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    text-align: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.2);
}
@keyframes ls-blinkGreen {
    0% { color: #4ade80; transform: scale(1); }
    50% { color: #fff; transform: scale(1.2); text-shadow: 0 0 20px #4ade80; }
    100% { color: #4ade80; transform: scale(1); }
}
@keyframes ls-blinkRedTeam {
    0% { color: #f87171; transform: scale(1); }
    50% { color: #fff; transform: scale(1.1); text-shadow: 0 0 20px #f87171; }
    100% { color: #f87171; transform: scale(1); }
}
@keyframes ls-slideDown {
    from { transform: translateY(-100%) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes ls-slideUp {
    to { transform: translateY(-20px); opacity: 0; }
}
.ls-popup-timer {
    height: 3px;
    background: rgba(0,0,0,0.3);
    width: 100%;
}
.ls-popup-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
    animation: ls-timer 3s linear forwards;
}
@keyframes ls-timer {
    from { width: 100%; }
    to { width: 0%; }
}
.ls-popup-GOAL { background: linear-gradient(135deg, #2E7D32, var(--accent)) !important; }
.ls-popup-RED_CARD { background: linear-gradient(135deg, #B71C1C, #f44336); }
.ls-popup-HALF_TIME { background: linear-gradient(135deg, #374151, #4b5563); }
.ls-ws-status {
    position: fixed;
    bottom: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1000;
}
.ls-ws-connected { background: var(--accent); color: var(--text); }
.ls-ws-disconnected { background: #f44336; color: var(--text); }
.ls-info-bar {
    background: var(--bg-surface);
    padding: 5px 10px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 11px;
    display: none !important;
    justify-content: space-between;
    color: var(--text-muted);
}
.ls-match-count { color: var(--accent); font-weight: bold; }
.ls-no-matches {
    text-align: center;
    padding: 30px 15px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
}
