body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f0f8ff; /* AliceBlue for snow-like bg */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    user-select: none; /* Prevent text selection */
    -webkit-font-smoothing: antialiased;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    display: flex;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

#timer {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: 500;
    color: #1d1d1f;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 24px;
    border-radius: 999px; /* Pill shape */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-variant-numeric: tabular-nums;
}

#score-board {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 18px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    gap: 10px;
    align-items: center;
}

.team-blue { color: #007AFF; }
.team-red { color: #FF3B30; }

#game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    color: #1d1d1f;
    padding: 50px 80px;
    text-align: center;
    border-radius: 24px;
    pointer-events: auto;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: opacity 0.3s ease;
}

#winner-text {
    font-size: 36px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

#game-over-screen p {
    font-size: 16px;
    color: #86868b;
    margin: 0;
}

.hidden {
    opacity: 0;
    pointer-events: none !important;
}

/* New Styles */
#start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    color: #1d1d1f;
    padding: 40px 60px;
    text-align: center;
    border-radius: 24px;
    pointer-events: auto;
    z-index: 200; /* Higher than game over */
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: opacity 0.3s ease;
    min-width: 350px;
}

.instructions {
    text-align: left;
    margin: 20px 0;
    line-height: 1.6;
}

.instructions h2 {
    font-size: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.game-btn {
    background-color: #007AFF;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s, transform 0.1s;
    font-weight: 600;
}

.game-btn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.game-btn:active {
    transform: scale(0.95);
}

#stats-container {
    margin: 20px 0;
    text-align: left;
    min-width: 250px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 16px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 4px;
}

/* Kill Streak Notification */
#kill-streak-notification {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 48px;
    font-weight: 800;
    color: #FFD60A;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    pointer-events: none;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 50;
    text-align: center;
    white-space: nowrap;
}

@keyframes popIn {
    0% { transform: translateX(-50%) scale(0); opacity: 0; }
    80% { transform: translateX(-50%) scale(1.2); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.end-game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
