body {
    margin: 0;
    overflow: hidden;
    background-color: #87CEEB; /* Sky blue */
    font-family: 'Arial', sans-serif;
}

canvas {
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 20px;
    box-sizing: border-box;
}

#status {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#leaderboard {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 8px;
    min-width: 220px;
    z-index: 1500; /* Ensure it's on top */
    border: 2px solid #444;
    font-family: 'Courier New', monospace; /* Monospace for alignment */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.horse-rank {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 2px;
}
#betting-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 4px solid #ffd700;
    z-index: 1000;
    min-width: 300px;
}

#betting-overlay h2 {
    font-size: 3em;
    color: #ffd700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

#timer {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
}

#time-left {
    color: #ff4444;
}

.instructions {
    font-size: 1.5em;
    color: #ccc;
}

#winner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    border: 2px solid gold;
    z-index: 1000;
}   animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#winner-name {
    font-size: 60px;
    margin: 0;
    text-transform: uppercase;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

#bet-notifications {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.bet-notification {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
    border-left: 5px solid white;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#setup-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* Enable clicks */
    z-index: 9999; /* Ensure it's always on top of everything */
}

.setup-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.setup-content h1 {
    margin-top: 0;
    color: #333;
}

#channel-input {
    padding: 10px;
    font-size: 18px;
    border: 2px solid #ccc;
    border-radius: 5px;
    margin-bottom: 20px;
    width: 200px;
}

#start-btn {
    padding: 10px 20px;
    font-size: 18px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

#start-btn:hover {
    background: #45a049;
}

/* Ticker Styles */
#ticker-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 50px; /* Adjust height as needed */
    background-color: rgba(0, 0, 0, 0.9);
    box-sizing: border-box;
    display: none; /* Hidden by default */
    z-index: 3000;
    border-top: 2px solid gold;
}

#ticker {
    display: inline-block;
    height: 50px;
    line-height: 50px;
    white-space: nowrap;
    box-sizing: border-box;
    animation: ticker 12s linear infinite; /* Faster speed */
    color: white;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    color: #ffd700; /* Gold */
}

.ticker-label {
    color: white;
    margin-right: 10px;
}

@keyframes ticker {
    0% { transform: translate3d(100vw, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}
