:root {
    --progress: 0;
}

body {
    margin: 0;
    background-color: var(--arcade-bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: monospace;
    position: relative;
    transition: var(--arcade-transition);
}

/* Background preview field */
#background-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 600px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(17, 17, 17, 0.3);
    z-index: 1;
    pointer-events: none;
    transition: width 0.3s ease;
}

#background-preview::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-left: 2px dashed rgba(255, 255, 255, 0.1);
}

#background-preview::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
}

#background-preview .bg-paddle-right {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
}

/* Configuration screen styles */
#config-screen {
    position: absolute;
    background-color: var(--arcade-bg-secondary);
    border: 2px solid var(--arcade-border-strong);
    padding: 30px;
    border-radius: 10px;
    color: var(--arcade-text-primary);
    z-index: 10;
    backdrop-filter: blur(5px);
    opacity: 0.95;
}

#config-screen h2 {
    margin-top: 0;
    text-align: center;
    font-size: 28px;
}

.config-section {
    margin: 20px 0;
}

.config-section label {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.config-section select,
.config-section input[type="text"],
.config-section input[type="number"] {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    background-color: var(--arcade-bg-tertiary);
    color: var(--arcade-text-primary);
    border: 1px solid var(--arcade-border);
    border-radius: 4px;
}

.config-section input[type="radio"] {
    margin-right: 8px;
}

.radio-group {
    margin: 10px 0;
}

#start-button {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    background-color: var(--arcade-success);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    transition: var(--arcade-transition);
}

#start-button:hover {
    background-color: var(--arcade-accent-hover);
}

.hidden {
    display: none;
}

/* Game styles */
#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background-color: #111;
    border: 4px solid #fff;
    overflow: visible; /* Allow effect icons to be visible outside */
}

#game-svg {
    width: 100%;
    height: 100%;
}

#scoreboard {
    position: absolute;
    top: -50px;
    width: 100%;
    text-align: center;
    font-size: 24px;
    color: white;
    pointer-events: none;
    z-index: 5;
}

#ball-speed-display {
    position: absolute;
    top: -80px;
    width: 100%;
    text-align: center;
    font-size: 16px;
    color: #aaa;
    pointer-events: none;
    z-index: 5;
}

.score-info {
    position: absolute;
    top: -30px;
    font-size: 16px;
    color: white;
    pointer-events: none;
    z-index: 5;
}

#score-left {
    left: 20px;
    font-weight: bold;
}

#score-right {
    right: 20px;
    font-weight: bold;
}

/* Effect displays */
.effects-container {
    position: absolute;
    top: 80px;
    width: 50px;
    pointer-events: none;
    z-index: 20;
}

.effects-container.left {
    left: -80px;
}

.effects-container.right {
    right: -80px;
}

.effect-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    position: relative;
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid rgba(80, 80, 80, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.effect-progress {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    pointer-events: none;
    background: conic-gradient(#4CAF50 calc(var(--progress, 0) * 1%), transparent calc(var(--progress, 0) * 1%));
    mask: radial-gradient(circle at center, transparent 18px, black 22px);
    -webkit-mask: radial-gradient(circle at center, transparent 18px, black 22px);
    transition: background 0.1s linear;
    transform: rotate(-90deg); /* Start from top */
}

.effect-progress.debuff {
    background: conic-gradient(#F44336 calc(var(--progress, 0) * 1%), transparent calc(var(--progress, 0) * 1%));
}

/* Pause Screen */
#pause-screen {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    padding: 40px;
    border-radius: 10px;
    color: white;
    z-index: 20;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#pause-screen h2 {
    font-size: 36px;
    margin-bottom: 30px;
}

/* Game Over Screen */
#game-over-screen {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    padding: 40px;
    border-radius: 10px;
    color: white;
    z-index: 20;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#game-over-screen h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

#game-over-screen p {
    font-size: 20px;
    margin-bottom: 30px;
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.game-button {
    padding: 12px 24px;
    font-size: 16px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.play-again-button {
    background-color: #4CAF50;
}

.play-again-button:hover {
    background-color: #45a049;
}

.menu-button {
    background-color: #2196F3;
}

.menu-button:hover {
    background-color: #0b7dda;
}

/* Explosive ball effect */
.explosive-ball {
    filter: drop-shadow(0 0 8px #ff4444) drop-shadow(0 0 16px #ff6600);
    animation: explosive-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes explosive-pulse {
    from {
        filter: drop-shadow(0 0 8px #ff4444) drop-shadow(0 0 16px #ff6600);
    }
    to {
        filter: drop-shadow(0 0 12px #ff6666) drop-shadow(0 0 24px #ff8800);
    }
}

/* Menu keyboard navigation focus styling */
.menu-focused {
    outline: 2px solid #4CAF50 !important;
    outline-offset: 2px;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5) !important;
}

.menu-focused:focus {
    outline: 2px solid #4CAF50 !important;
    outline-offset: 2px;
}


