/* Live Matches Discovery Screen */
.live-screen {
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.live-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 16px;
    flex-wrap: wrap;
}

.live-filter-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}

.live-filter-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2a3a4a;
    color: #ccc;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.live-filter-tab:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #FFD700;
}

.live-filter-tab.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: #FFD700;
    color: #FFD700;
    font-weight: 600;
}

.live-content {
    margin-top: 12px;
}

.live-loading,
.live-empty {
    text-align: center;
    color: #aaa;
    padding: 40px 20px;
}

.live-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.live-empty-title {
    font-size: 1.2rem;
    color: #ddd;
    margin-bottom: 6px;
}

.live-empty-sub {
    font-size: 0.9rem;
    color: #888;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}

.live-match-card {
    background: #14142a;
    border: 1px solid #2a3a4a;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}

.live-match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff6666, transparent);
    animation: liveBar 2s linear infinite;
}

@keyframes liveBar {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.live-match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.live-match-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #888;
}

.live-match-turn {
    margin-left: auto;
}

.live-match-spectators {
    color: #ff6666;
}

.live-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.live-badge-ranked     { background: rgba(0, 180, 255, 0.15); color: #00b4ff; border: 1px solid #00b4ff; }
.live-badge-koth       { background: rgba(155, 89, 182, 0.15); color: #c39bff; border: 1px solid #9b59b6; }
.live-badge-tournament { background: rgba(255, 215, 0, 0.15); color: #FFD700; border: 1px solid #FFD700; }

.live-match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.live-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.live-player-avatar {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
}

.live-player-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.live-player-silhouette {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a45, #14142a);
    border-radius: 50%;
}

.live-player-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-player-meta {
    font-size: 0.8rem;
    color: #888;
}

.live-vs {
    color: #666;
    font-weight: 700;
    font-size: 0.85rem;
}

.live-match-action {
    margin-top: 12px;
    text-align: center;
    color: #FFD700;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.7;
}

.live-match-card:hover .live-match-action {
    opacity: 1;
}

/* Spectator banner inside battle screen */
.spectator-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 100, 100, 0.95);
    color: #fff;
    padding: 8px 16px;
    text-align: center;
    font-weight: 600;
    z-index: 950;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.spectator-banner-leave {
    background: #fff;
    color: #c33;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.spectator-banner-count {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Spectator mode — hide all interactive battle controls.
   Spectator only sees state, not actions. */
body.spectator-mode .battle-screen {
    padding-top: 50px; /* push down for banner */
}

/* Hide the entire bottom interaction strip — hand tray, preview,
   action buttons. Spectator just observes the field. */
body.spectator-mode .battle-bottom,
body.spectator-mode .battle-hand-tray,
body.spectator-mode .battle-actions,
body.spectator-mode .hand-tray-preview {
    display: none !important;
}

/* Hide the turn indicator — it's a player-perspective badge ("YOUR TURN"
   makes no sense for a spectator). */
body.spectator-mode #turnIndicator,
body.spectator-mode .battle-turn-indicator {
    display: none !important;
}

/* Make the field cards non-clickable (no targeting / inspection actions
   that mutate state). Card hover-inspect is still allowed via separate
   read-only path in the inspect modal. */
body.spectator-mode .hand-card,
body.spectator-mode .field-card {
    pointer-events: none;
}

/* Mobile log toggle button — keep so spectators can read live log */
