html {
    scrollbar-gutter: stable;
}

h1 {
    color: white;
    text-align: center;
}

a {
  text-decoration: none;
  color: #3367e1
}

.box {
    box-sizing: border-box;
    background-color: #000000a0;
    border: 2px solid #3367e1;
    border-radius: 10px;
    color: #fff;
    padding: 20px;
    margin-bottom: 20px;
}

.body-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    gap: 20px;
    align-items: flex-start;
}

.main {
    flex: 3 1 650px;
}

.sidebar {
    flex: 0 1 320px;
    min-width: 320px;
}

/* Clock Widget */
#clock-widget {
    text-align: center;
}
#clock-widget-time {
    font-size: 3em;
    font-weight: 600;
    color: #fff;
    letter-spacing: 2px;
}
#clock-widget p {
    margin-top: -10px;
    color: #ccc;
}

/* Steam Widget */
#steam-widget h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    text-align: center;
}
.steam-game {
    display: flex;
    align-items: center;
    gap: 15px;
}
.steam-game img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
}
.steam-game-info h3 {
    font-weight: bold;
    font-size: 1.1em;
    margin: 0;
}
.steam-game-info p {
    font-size: 0.9em;
    color: #ccc;
    margin: 0;
}
.steam-live-indicator {
    color: #1DB954; 
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 5px;
}

/* Spotify Widget */
#spotify-widget h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    text-align: center;
}
.spotify-now-playing-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}
.spotify-album-art img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.spotify-song-info {
    flex: 1;
    min-width: 0; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.spotify-title-container {
    flex: 1;
    min-width: 0;
}
.spotify-title-container.is-scrolling,
.spotify-artist.is-scrolling {
    -webkit-mask-image: linear-gradient(to right, transparent, black 3%, black 97%, transparent);
    mask-image: linear-gradient(to right, transparent, black 3%, black 97%, transparent);
}
#spotify-widget .spotify-status {
    margin-bottom: 0.25rem;
}
#spotify-widget .spotify-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
#spotify-widget .spotify-controls svg {
    width: 20px;
    height: 20px;
    fill: #1DB954;
    flex-shrink: 0;
}
#spotify-widget .spotify-progress-wrapper {
    flex: 1;
    min-width: 0;
}
#spotify-widget h3 {
    font-weight: bold;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    min-width: 0;
    flex: 1;
}
#spotify-widget .spotify-artist {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0;
    min-width: 0;
}
#spotify-widget .spotify-progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #444;
    border-radius: 3px;
    overflow: hidden;
}
#spotify-widget .spotify-progress-bar {
    height: 100%;
    background-color: #1DB954;
    border-radius: 3px;
    transition: width 0.5s ease-out;
}
#spotify-widget .spotify-progress-time {
    font-size: 0.8em;
    color: #aaa;
    margin-top: 0.25rem;
}
#spotify-widget .spotify-device {
    font-size: 0.8em;
    color: #aaa;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
}
#spotify-widget .spotify-device svg {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    fill: currentColor;
}

/* Chat Widget */
#chat-widget {
    text-align: center;
}

#chat-container {
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
    height: 250px; 
    background: black;
    border: 1px solid #3367e1;
    border-radius: 10px;
    color: #0f0;
    text-align: left;
    font-family: monospace;
    font-size: 14px;
    overflow-y: auto;
    padding: 10px;
}

.chat-input-container {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

#chat-input {
    flex-grow: 1;
    padding: 8px 8px;
    font-family: monospace;
    font-size: 14px;
    background: black;
    text-align: left;
    color: #0f0;
    border: 1px solid #3367e1;
    border-radius: 10px;
}

#chat-send {
    padding: 8px 12px;
    font-family: monospace;
    font-size: 14px;
    background: black;
    color: #0f0;
    border: 1px solid #3367e1;
    border-radius: 10px;
    cursor: pointer;
}

/* Scrolling text for Spotify widget */
@keyframes scroll-bidi {
    0%, 15% {
        transform: translateX(4px);
    }
    50%, 65% {
        transform: translateX(calc(var(--container-width) - var(--text-width) - 4px));
    }
    100% {
        transform: translateX(4px);
    }
}

/* This class is added by JavaScript when the text overflows */
#spotify-widget h3.scrolling,
#spotify-widget .spotify-artist.scrolling {
    overflow: visible;
    flex: none;
}

#spotify-widget h3.scrolling span,
#spotify-widget .spotify-artist.scrolling span {
    display: inline-block;
    animation: scroll-bidi linear infinite;
}
