/* OBS-compatible transparent background */
body {
    margin: 0;
    padding: 0;
    background: transparent !important;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main container - compact horizontal layout */
.overlay-container {
    width: 800px;
    height: 250px;
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.92) 0%, rgba(15, 20, 30, 0.95) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 120, 60, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(255, 120, 60, 0.15);
    overflow: hidden;
    position: relative;
}

/* Terran-inspired accent glow */
.overlay-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 120, 60, 0.8) 30%,
        rgba(255, 180, 100, 0.6) 50%,
        rgba(255, 120, 60, 0.8) 70%,
        transparent 100%);
    box-shadow: 0 0 20px rgba(255, 120, 60, 0.6);
}

/* Header bar with title and stats */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px 20px;
    background: linear-gradient(180deg, rgba(255, 120, 60, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 120, 60, 0.2);
}

.title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow:
        0 0 10px rgba(255, 120, 60, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Stats container */
.stats-container {
    display: flex;
    gap: 24px;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.stat-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.stat-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    text-shadow:
        0 0 8px rgba(255, 120, 60, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Current MMR - highlight with Terran orange */
.current-mmr .stat-value {
    color: #ff9d5c;
    text-shadow:
        0 0 12px rgba(255, 120, 60, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Session delta - dynamic color based on positive/negative */
.mmr-delta .stat-value.positive {
    color: #00ff88;
    text-shadow:
        0 0 10px rgba(0, 255, 136, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.mmr-delta .stat-value.negative {
    color: #ff4444;
    text-shadow:
        0 0 10px rgba(255, 68, 68, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.mmr-delta .stat-value.neutral {
    color: rgba(255, 255, 255, 0.6);
}

/* Win rate */
.win-rate .stat-value {
    color: #ffffff;
}

/* Tag legend - horizontal scrollable strip */
.tag-legend {
    display: flex;
    gap: 16px;
    padding: 4px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 22px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tag-legend::-webkit-scrollbar {
    display: none;
}

.tag-legend:empty {
    display: none;
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-icon {
    font-size: 10px;
    text-shadow: 0 0 6px currentColor;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: -1px;
}

.tag-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart container */
.chart-container {
    padding: 10px 20px 20px 20px;
    height: calc(100% - 60px);
}

/* Adjust chart height when legend is visible */
.overlay-container:has(.tag-legend:not(:empty)) .chart-container {
    height: calc(100% - 82px);
}

#mmrChart {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================================
   STREAM WIDGET - Combined game list + MMR chart
   ============================================================ */

.widget-container {
    width: 500px;
    height: 400px;
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.92) 0%, rgba(15, 20, 30, 0.95) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 120, 60, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(255, 120, 60, 0.15);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.widget-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 120, 60, 0.8) 30%,
        rgba(255, 180, 100, 0.6) 50%,
        rgba(255, 120, 60, 0.8) 70%,
        transparent 100%);
    box-shadow: 0 0 20px rgba(255, 120, 60, 0.6);
    z-index: 1;
}

/* Horizontal layout variant */
.widget-container.horizontal {
    flex-direction: row;
}

.widget-container.horizontal .widget-games {
    width: 50%;
    flex: none;
    border-right: 1px solid rgba(255, 120, 60, 0.2);
    border-bottom: none;
}

.widget-container.horizontal .widget-chart {
    flex: 1;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 8px 16px;
    background: linear-gradient(180deg, rgba(255, 120, 60, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 120, 60, 0.2);
    flex-shrink: 0;
}

.widget-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 120, 60, 0.5);
}

.widget-games {
    flex: 1;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.game-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s;
}

.game-row:hover {
    background: rgba(255, 120, 60, 0.06);
}

.game-matchup {
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    flex-shrink: 0;
}

.game-result {
    font-weight: 700;
    width: 16px;
    flex-shrink: 0;
    text-shadow: 0 0 6px currentColor;
}

.game-mmr-diff {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    width: 42px;
    text-align: right;
    flex-shrink: 0;
}

.game-map {
    color: rgba(255, 255, 255, 0.5);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-time {
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    flex-shrink: 0;
}

.widget-chart {
    height: 150px;
    padding: 8px 12px;
    flex-shrink: 0;
}

/* ============================================================
   ANALYSIS WIDGET - Post game analysis overlay
   ============================================================ */

.analysis-widget-content {
    flex: 1;
    overflow: hidden;
}

.analysis-entry {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.analysis-field {
    display: flex;
    gap: 6px;
    padding: 2px 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
}

.analysis-label {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
    min-width: 100px;
    flex-shrink: 0;
}

.analysis-value {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
}
