@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --accent-color: #4ade80;
    --accent-color-light: #4ade8033;
    --accent-color-dark: #4ade8066;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #0a0a0a 100%);
    min-height: 100vh;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-shadow: 0 4px 20px rgba(255,255,255,0.1);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.3rem;
    opacity: 0.8;
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
    color: #b0b0b0;
}

.team-selector {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 8px 16px rgba(255,255,255,0.05);
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.team-selector label {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

#team-select {
    width: 100%;
    max-width: 350px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #333333;
    border-radius: 16px;
    margin-bottom: 2rem;
    background: #1a1a1a;
    color: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

#team-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-color-light);
    transform: translateY(-1px);
}

#find-bandwagon {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
    color: white;
    border: none;
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--accent-color-light);
}

#find-bandwagon:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px var(--accent-color-dark);
}

#find-bandwagon:disabled {
    background: #333333;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #666666;
}

.loading {
    text-align: center;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333333;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.results {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.results h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
}

.team-step {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.step-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
}

.team-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
}

.team-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.team-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.team-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
}

.team-name {
    font-weight: 600;
    font-size: 1.15rem;
    color: #ffffff;
}

.game-info {
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 400;
}

.game-info a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.game-info a:hover {
    color: var(--accent-color);
}

.arrow {
    font-size: 1.75rem;
    color: var(--accent-color);
    opacity: 0.8;
}

#final-team {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    color: white;
    border-radius: 24px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--accent-color-light);
    box-shadow: 0 0 40px var(--accent-color-light);
}

#final-team h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    color: var(--accent-color);
}

.final-team-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.final-team-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 12px;
    box-shadow: 0 8px 24px var(--accent-color-light);
    border: 3px solid var(--accent-color-dark);
    transition: transform 0.2s ease;
}

.final-team-logo:hover {
    transform: scale(1.1);
}

.final-team-name {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.progress-display {
    margin-top: 2rem;
    text-align: center;
}

.progress-display h3 {
    margin-bottom: 2rem;
    color: #ffffff;
    font-weight: 600;
}

.team-battle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.5rem;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.team-side {
    flex: 1;
    text-align: center;
}

.team-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.team-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.battle-team-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.1);
}

.battle-team-name {
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    transition: opacity 0.3s ease;
}

.vs-divider {
    font-size: 1.5rem;
    font-weight: 700;
    color: #666666;
    padding: 0 1rem;
    opacity: 0.7;
}

.journey-container {
    position: relative;
}

.expand-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(30, 30, 30, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.expand-btn {
    background: var(--accent-color-light);
    color: var(--accent-color);
    border: 1px solid var(--accent-color-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: inherit;
}

.expand-btn:hover {
    background: var(--accent-color-dark);
    border-color: var(--accent-color);
}

.journey-info {
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 500;
}

.journey-steps {
    transition: all 0.3s ease;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes teamHighlight {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 24px var(--accent-color-dark);
    }
}

@keyframes opposingHighlight {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 24px rgba(255, 68, 68, 0.6);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.pulse {
    animation: pulse 2.5s ease-in-out infinite;
}

.randomizer-fade {
    animation: randomizerFade 0.3s ease-in-out infinite;
}

@keyframes randomizerFade {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

.team-highlight {
    animation: teamHighlight 0.8s ease-in-out;
}

.opposing-highlight {
    animation: opposingHighlight 0.8s ease-in-out;
}

@keyframes winnerGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 24px rgba(34, 197, 94, 0.8);
    }
}

@keyframes loserFade {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.95);
    }
}

.winner-glow {
    animation: winnerGlow 0.8s ease-in-out;
}

.loser-fade {
    animation: loserFade 0.8s ease-in-out;
}

.team-step:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.4);
    border-color: var(--accent-color-light);
    background: rgba(40, 40, 40, 0.9);
}

.wins-toggle {
    font-size: 0.8rem;
    color: var(--accent-color);
    cursor: pointer;
    margin-top: 0.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    user-select: none;
}

.wins-toggle:hover {
    color: var(--accent-color-dark);
    transform: translateX(2px);
}

.wins-toggle.expanded {
    color: var(--accent-color-dark);
}

.no-wins {
    font-size: 0.8rem;
    color: #666666;
    margin-top: 0.25rem;
    font-style: italic;
}

.wins-submenu {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(15, 15, 15, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    animation: fadeInSubmenu 0.3s ease-out;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

@keyframes fadeInSubmenu {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

.win-game {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
}

.win-game:hover {
    background: rgba(40, 40, 40, 0.9);
    border-color: rgba(255,255,255,0.1);
    transform: translateX(3px);
}

.win-game:last-child {
    margin-bottom: 0;
}

.win-game-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.win-opponent-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 2px;
    flex-shrink: 0;
}

.win-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.win-opponent {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.win-date {
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 500;
}

.win-date a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.win-date a:hover {
    color: var(--accent-color);
}

.gameday-embed {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(15, 15, 15, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.gameday-embed h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.live-game-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.live-game-link:hover {
    color: var(--accent-color);
}

.game-card {
    background: rgba(25, 25, 25, 0.9);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.game-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.team-side {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.home-team {
    flex-direction: row-reverse;
    text-align: right;
}

.game-team-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 4px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.team-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.team-side .team-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
}

.team-record {
    font-size: 0.75rem;
    color: #a0a0a0;
}

.team-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 40px;
    text-align: center;
}

.game-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.game-status {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    text-align: center;
    background: var(--accent-color-light);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--accent-color-dark);
}

.inning-info {
    font-size: 0.75rem;
    color: #a0a0a0;
    text-align: center;
}

.win-streak-display {
    margin-top: 2rem;
}

.win-streak-display h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    text-align: center;
    color: #ffffff;
    font-weight: 700;
}

.win-streak-games {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-completed-alert {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: 2px solid #fca5a5;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
    animation: alertPulse 2s ease-in-out infinite;
}

.game-completed-alert h4 {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.game-completed-alert p {
    color: #fecaca;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

.refresh-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    color: #1f2937;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

@keyframes alertPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
    }
    50% {
        box-shadow: 0 12px 32px rgba(220, 38, 38, 0.5);
    }
}

.count-display {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.count-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.count-label {
    font-size: 0.7rem;
    color: #a0a0a0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.count-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 35px;
    text-align: center;
}

.count-item.hidden-content {
    visibility: hidden;
}

.live-game-details {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(10, 10, 10, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.current-players {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(25, 25, 25, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.player-label {
    font-size: 0.8rem;
    color: #a0a0a0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-name {
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 600;
    text-align: right;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    header p {
        font-size: 1.1rem;
    }
    
    .team-selector, .loading, .results {
        padding: 2rem;
    }
    
    .step-main {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .team-info {
        justify-content: center;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .team-battle {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .vs-divider {
        transform: rotate(90deg);
        font-size: 1.2rem;
    }
    
    .battle-team-logo {
        width: 50px;
        height: 50px;
    }
    
    .battle-team-name {
        font-size: 0.9rem;
    }
    
    .team-label {
        font-size: 0.7rem;
        margin-bottom: 0.75rem;
    }
    
    .final-team-logo {
        width: 80px;
        height: 80px;
    }
    
    .final-team-name {
        font-size: 1.8rem;
    }
    
    #final-team {
        padding: 2.5rem 1.5rem;
    }
    
    .game-matchup {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .team-side {
        justify-content: center;
        width: 100%;
    }
    
    .home-team {
        flex-direction: row;
        text-align: left;
    }
    
    .game-center {
        order: -1;
    }
    
    .win-streak-display h4 {
        font-size: 1.1rem;
    }
    
    .count-display {
        gap: 0.75rem;
    }
    
    .count-value {
        font-size: 1rem;
        min-width: 30px;
    }
    
    .live-game-details {
        padding: 1rem;
    }
    
    .player-info {
        padding: 0.4rem 0.8rem;
    }
    
    .player-label {
        font-size: 0.75rem;
    }
    
    .player-name {
        font-size: 0.8rem;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .team-selector, .loading, .results {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    #final-team {
        border-radius: 20px;
        padding: 2rem 1rem;
    }
    
    .final-team-name {
        font-size: 1.5rem;
    }
    
    .win-streak-display h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}