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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    border-bottom: 2px solid #333;
}

.title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.game-input {
    padding: 15px 20px;
    font-size: 1.1rem;
    background: #222;
    border: 2px solid #444;
    border-radius: 8px;
    color: #fff;
    width: 300px;
    transition: border-color 0.3s;
}

.games-list {
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.game-card {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.spinner.spinner-small {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
    border-width: 3px;
}

.game-card:hover {
    border-color: #ff6b35;
    transform: translateY(-2px);
}

.game-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

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

.team-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.team-abbrev {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
}

.vs-symbol {
    font-size: 1.1rem;
    font-weight: bold;
    color: #888;
    align-self: center;
}

.game-score {
    color: #ff6b35;
    font-size: 1.3rem;
    font-weight: bold;
}

.game-status {
    color: #888;
    font-size: 0.9rem;
}

.broadcast-info {
    color: #f7931e;
    font-size: 0.8rem;
    font-weight: 500;
}

/* .game-excitement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
} */


.debug-info {
    text-align: center;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid #333;
    padding-top: 10px;
}


.excitement-summary{
    display: grid;
    grid-auto-flow: column;
    align-self: center;
    column-gap: 10px;
}

.game-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 5px 5px;
    border-radius: 6px;
    margin-top: "10px";
    line-height: 1;
    font-weight: 600;
    color: #fff;
    white-space: normal;
    text-align: center;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    width: fit-content;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 30px;
    margin-top: 8px;
    line-height: 1;
    font-weight: 600;
    color: #fff;
    white-space: normal;
    text-align: center;
}

.highlight {
    background: rgba(1, 84, 35, 0.176);
    border: 1px solid #27ae5fa0;
}

.detractor {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e4443274;
}

.badge-icon {

    font-size: 1.25rem;
    line-height: 1;
    height: 24px;
    width: 24px;
    padding-right: 3px;
}

.badge-icon img {
    height: 22px;
    width: 22px;

}

.badge-label {
    font-size: 10px;
    color: #fff;
    letter-spacing: 0.3px;
    font-weight: normal;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #666;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    cursor: pointer;
    margin-left: 5px;
    user-select: none;
}

.info-icon:hover {
    background: #ff6b35;
}


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 10% auto;
    padding: 20px;
    border: 2px solid #333;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    color: #fff;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #ff6b35;
}

.game-input:focus {
    outline: none;
    border-color: #ff6b35;
}

.analyze-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.analyze-btn:hover {
    transform: translateY(-2px);
}

.loading {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.info-label {
    display: block;
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b35;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.toast {
    background: #1a1a1a;
    border: 1px solid #333;
    border-left: 4px solid #ff6b35;
    border-radius: 10px;
    padding: 12px 18px;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-10px);
    animation: toast-in 0.25s forwards;
}

.toast-hide {
    animation: toast-out 0.25s forwards;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@media (max-width: 600px) {
    .toast-container {
        left: 20px;
        right: 20px;
    }
}

.hidden {
    display: none !important;;
}


.methodology-link {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #333;
}

.methodology-link a {
    color: #ff6b35;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.methodology-link a:hover {
    color: #f7931e;
    text-decoration: underline;
}

.error {
    text-align: center;
    padding: 40px;
    background: #2a1a1a;
    border: 2px solid #e74c3c;
    border-radius: 10px;
    color: #e74c3c;
}

/* NHL-style game header */
.game-header {
    margin-bottom: 30px;
}

.team-matchup {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 2px solid #333;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.away-team, .home-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    order: 1;
}

.away-team {
    order: 0;
}

.home-team {
    order: 2;
}

.team-logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
    order: 0;
}

.team-info {
    text-align: center;
    order: 1;
}

.team-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.game-status {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    min-width: 150px;
}

.period-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.period-status {
    font-size: 1.3rem;
    font-weight: bold;
    color: #f7931e;
}

.time-status {
    font-size: 1rem;
    color: #ccc;
    font-weight: 500;
}


/* Stats table */
.stats-section {
    margin-bottom: 40px;
}

.stats-table {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
}

.stats-header {
    background: #333;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-category {
    color: #ff6b35;
    font-weight: bold;
}

.main-header {
    text-align: left;
    color: #ffffff;
}


.away-header, .home-header, .badge-header {
    text-align: center;
    color: #ffffff;
}

.stat-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;   
    padding: 15px;
    align-items: center;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row.normal {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-bottom: 1px solid #333;
}


.away-stat, .home-stat {
    text-align: center;
    font-weight: bold;
    color: #ff6b35;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .input-section {
        flex-direction: column;
        align-items: center;
    }
    
    .game-input {
        width: 100%;
        max-width: 300px;
    }
    
    .team-matchup {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .away-team, .home-team {
        flex-direction: column;
        text-align: center;
    }
    
    .home-team {
        flex-direction: column;
    }
    
    .stats-header, .stat-row {
        grid-template-columns: 2fr 1fr 1fr;
        text-align: center;
    }
    
    .stat-row {
        padding: 10px;
    }
}



/* Tug of War Gauge */
.tug-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.tug-title {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-size: 0.7rem;
}

.tug-gauge {
    width: 100%;
    height: 16px;
    border-radius: 8px;
    border: 1px solid #333;
    transition: background 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.back-and-forth  {
    --tug-away: #fa6014;
    --tug-home: #d74a12;
    background: linear-gradient(90deg, var(--tug-away), var(--tug-home)) !important;
    animation: tug-pulse 1.2s ease-in-out infinite !important;
    border-color: #888 !important;
}

.tug-o-war  {
    --tug-away: #494949;
    --tug-home: #505050;
    --cut-start: 0%;
    --away-pct: 50%;
    --cut-end: 100%;
    background: linear-gradient(
        90deg, 
        var(--tug-away) var(--cut-start), 
        #888 var(--away-pct), 
        var(--tug-home) var(--cut-end)
        ) !important; 
    border-color: #888 !important;
}


.back-and-forth-label {
    position: relative;
    z-index: 1;
    font-size: 0.65rem;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    white-space: nowrap;
}

@keyframes tug-pulse {
    0%, 100% { filter: brightness(1) saturate(1); }
    50%       { filter: brightness(1.4) saturate(1.5); }
}

.tug-label {
    position: relative;
    z-index: 1;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    white-space: nowrap;
}
