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

body { 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff; 
    overflow: hidden; 
}

#gameContainer { 
    position: relative; 
    width: 100vw; 
    height: 100vh; 
}

#ui { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 100; 
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 100%);
    backdrop-filter: blur(10px);
    padding: 20px; 
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.scoreboard { 
    display: grid; 
    grid-template-columns: repeat(10, 1fr); 
    gap: 8px; 
    max-width: 900px; 
    margin: 0 auto 20px; 
}

.frame { 
    border: 2px solid rgba(255,255,255,0.2); 
    padding: 8px; 
    text-align: center; 
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    min-height: 70px; 
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.frame:hover::before {
    opacity: 1;
}

.frame.current { 
    border-color: #00d9ff; 
    background: linear-gradient(145deg, rgba(0,217,255,0.3), rgba(0,217,255,0.15));
    box-shadow: 0 0 20px rgba(0,217,255,0.5), inset 0 0 20px rgba(0,217,255,0.1);
    transform: scale(1.05);
}

.frame.strike { 
    background: linear-gradient(145deg, rgba(255,107,107,0.4), rgba(255,107,107,0.2));
    border-color: #ff6b6b;
    animation: pulse 2s infinite;
}

.frame.spare { 
    background: linear-gradient(145deg, rgba(255,184,0,0.4), rgba(255,184,0,0.2));
    border-color: #ffb800;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,107,107,0.5); }
    50% { box-shadow: 0 0 25px rgba(255,107,107,0.8); }
}

.frame-num { 
    font-size: 11px; 
    opacity: 0.7; 
    color: rgba(255,255,255,0.6);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.rolls { 
    font-size: 14px; 
    margin: 8px 0;
    font-weight: 600;
    color: #ffffff;
}

.score { 
    font-size: 20px; 
    font-weight: 800;
    background: linear-gradient(135deg, #00d9ff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.controls { 
    text-align: center; 
    margin: 20px 0; 
}

.power-meter { 
    width: 350px; 
    height: 28px; 
    background: rgba(255,255,255,0.1);
    margin: 20px auto; 
    border: 2px solid rgba(255,255,255,0.3); 
    position: relative; 
    border-radius: 50px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.power-fill { 
    height: 100%; 
    background: linear-gradient(90deg, #00f260, #ffb800, #ff6b6b); 
    width: 0%; 
    transition: width 0.05s linear;
    border-radius: 50px;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    position: relative;
}

.power-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
    border-radius: 50px;
}

.power-text { 
    position: absolute; 
    top: 50%;
    left: 50%; 
    transform: translate(-50%, -50%);
    font-size: 14px; 
    color: #ffffff; 
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 1;
}

button { 
    margin: 6px; 
    padding: 12px 24px; 
    border: none; 
    border-radius: 50px; 
    background: linear-gradient(135deg, #00d9ff, #a78bfa);
    color: #ffffff; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 700;
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,217,255,0.4);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,217,255,0.6);
}

button:active {
    transform: translateY(0);
}

button:disabled { 
    background: rgba(255,255,255,0.1);
    cursor: not-allowed; 
    opacity: 0.4;
    box-shadow: none;
}

.info { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    margin: 15px 0; 
    font-size: 15px;
    flex-wrap: wrap;
}

.info span { 
    padding: 10px 20px; 
    background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
}

.info strong {
    color: #00d9ff;
    margin-left: 5px;
}

.message { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    background: linear-gradient(145deg, rgba(0,0,0,0.95), rgba(0,0,0,0.85));
    padding: 40px 60px; 
    border-radius: 25px; 
    text-align: center; 
    font-size: 24px; 
    z-index: 200; 
    display: none; 
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 100px rgba(0,217,255,0.3);
    font-weight: 700;
    white-space: pre-line;
    backdrop-filter: blur(20px);
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#pins { 
    position: absolute; 
    bottom: 30px; 
    right: 30px; 
    background: linear-gradient(145deg, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
    padding: 15px; 
    border-radius: 20px; 
    border: 2px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#pins > div:first-child {
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-align: center;
}

.pin-display { 
    display: grid; 
    grid-template-columns: repeat(4, 26px); 
    gap: 4px; 
}

.pin { 
    width: 26px; 
    height: 26px; 
    background: linear-gradient(145deg, #00d9ff, #0ea5e9);
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 12px; 
    color: #ffffff; 
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,217,255,0.4);
    transition: all 0.3s ease;
}

.pin.down { 
    background: linear-gradient(145deg, #4b5563, #374151);
    color: rgba(255,255,255,0.3);
    box-shadow: none;
    transform: scale(0.9);
}

@media (max-width: 768px) {
    .scoreboard { 
        grid-template-columns: repeat(5, 1fr); 
    }
    
    .power-meter { 
        width: 280px;
        height: 24px;
    }
    
    .info { 
        flex-direction: column; 
        gap: 8px;
        align-items: center;
    }
    
    button {
        font-size: 13px;
        padding: 10px 20px;
    }
    
    .frame {
        min-height: 60px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    #ui {
        padding: 10px;
    }
    
    .power-meter {
        width: 220px;
        height: 20px;
    }
    
    .power-text {
        font-size: 12px;
    }
    
    button {
        font-size: 12px;
        padding: 8px 16px;
        margin: 4px;
    }
    
    .frame {
        min-height: 50px;
        padding: 4px;
    }
    
    .info span {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    #pins {
        bottom: 15px;
        right: 15px;
        padding: 10px;
    }
    
    .pin {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .pin-display {
        grid-template-columns: repeat(4, 20px);
    }

    .message {
        padding: 30px 40px;
        font-size: 18px;
        margin: 20px;
        max-width: calc(100vw - 40px);
    }

    .score {
        font-size: 16px;
    }

    .rolls {
        font-size: 12px;
    }

    /* BOWLING GAME SPECIFIC STYLES - REFINED UI */

/* Override body background */
body { 
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a7b 100%);
    overflow: hidden;
}

/* Canvas positioning - CRITICAL FIX */
#gameContainer canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* UI Overlay - refined styling */
#ui { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 100; 
    background: linear-gradient(180deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.5) 100%);
    backdrop-filter: blur(8px);
    padding: 15px; 
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    pointer-events: none;
}

#ui * {
    pointer-events: auto;
}

/* Scoreboard - clean professional look */
.scoreboard { 
    display: grid; 
    grid-template-columns: repeat(10, 1fr); 
    gap: 6px; 
    max-width: 850px; 
    margin: 0 auto 15px; 
}

.frame { 
    border: 2px solid rgba(255,255,255,0.15); 
    padding: 6px; 
    text-align: center; 
    background: rgba(255,255,255,0.08);
    min-height: 65px; 
    border-radius: 8px;
    transition: all 0.3s ease;
}

.frame:hover {
    background: rgba(255,255,255,0.12);
}

.frame.current { 
    border-color: #4a9eff; 
    background: rgba(74,158,255,0.15);
    box-shadow: 0 0 15px rgba(74,158,255,0.3);
}

.frame.strike { 
    background: rgba(255,75,75,0.2); 
    border-color: #ff6b6b;
}

.frame.spare { 
    background: rgba(255,180,50,0.2); 
    border-color: #ffb432;
}

.frame-num { 
    font-size: 11px; 
    opacity: 0.6; 
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}

.rolls { 
    font-size: 13px; 
    margin: 6px 0;
    font-weight: 600;
    color: #ffffff;
}

.score { 
    font-size: 18px; 
    font-weight: 700;
    color: #4a9eff;
}

/* Controls - refined */
.controls { 
    text-align: center; 
    margin: 15px 0; 
}

.power-meter { 
    width: 320px; 
    height: 24px; 
    background: rgba(0,0,0,0.3);
    margin: 15px auto; 
    border: 2px solid rgba(255,255,255,0.2); 
    position: relative; 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}

.power-fill { 
    height: 100%; 
    background: linear-gradient(90deg, #4ade80, #fbbf24, #f87171); 
    width: 0%; 
    transition: width 0.05s linear;
    border-radius: 10px;
}

.power-text { 
    position: absolute; 
    top: 50%;
    left: 50%; 
    transform: translate(-50%, -50%);
    font-size: 13px; 
    color: #ffffff; 
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    z-index: 1;
}

/* Buttons - professional style */
button { 
    margin: 5px; 
    padding: 10px 20px; 
    border: none; 
    border-radius: 8px; 
    background: linear-gradient(135deg, #4a9eff, #3b82f6);
    color: #ffffff; 
    cursor: pointer; 
    font-size: 14px; 
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(74,158,255,0.3);
}

button:hover { 
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74,158,255,0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled { 
    background: rgba(255,255,255,0.1);
    cursor: not-allowed; 
    opacity: 0.5;
    box-shadow: none;
}

/* Game Info - clean layout */
.info { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin: 12px 0; 
    font-size: 14px;
    flex-wrap: wrap;
}

.info span { 
    padding: 8px 16px; 
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.info strong {
    color: #4a9eff;
    margin-left: 5px;
}

/* Messages - elegant popup */
.message { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    background: rgba(0,0,0,0.9);
    padding: 35px 50px; 
    border-radius: 16px; 
    text-align: center; 
    font-size: 22px; 
    z-index: 200; 
    display: none; 
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    font-weight: 700;
    white-space: pre-line;
    backdrop-filter: blur(10px);
    color: #ffffff;
}

/* Pin Display - refined widget */
#pins { 
    position: absolute; 
    bottom: 25px; 
    right: 25px; 
    background: rgba(0,0,0,0.75);
    padding: 12px; 
    border-radius: 12px; 
    border: 2px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    z-index: 100;
}

#pins > div:first-child {
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-align: center;
}

.pin-display { 
    display: grid; 
    grid-template-columns: repeat(4, 24px); 
    gap: 3px; 
}

.pin { 
    width: 24px; 
    height: 24px; 
    background: linear-gradient(135deg, #4a9eff, #3b82f6);
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 11px; 
    color: #ffffff; 
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(74,158,255,0.3);
    transition: all 0.2s ease;
}

.pin.down { 
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: rgba(255,255,255,0.4);
    box-shadow: none;
    transform: scale(0.85);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scoreboard { 
        grid-template-columns: repeat(5, 1fr); 
    }
    
    .power-meter { 
        width: 260px;
        height: 22px;
    }
    
    button {
        font-size: 13px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    #ui {
        padding: 10px;
    }
    
    .power-meter {
        width: 220px;
        height: 20px;
    }
    
    button {
        font-size: 12px;
        padding: 7px 14px;
        margin: 3px;
    }
    
    .frame {
        min-height: 50px;
        padding: 4px;
    }
    
    .pin {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .pin-display {
        grid-template-columns: repeat(4, 20px);
    }
    /* Slider controls styling */
.slider-control {
    margin: 15px auto;
    max-width: 400px;
}

.slider-control label {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 8px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(0,0,0,0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a9eff, #3b82f6);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(74,158,255,0.4);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(74,158,255,0.6);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a9eff, #3b82f6);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(74,158,255,0.4);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(74,158,255,0.6);
}

.slider::-webkit-slider-track {
    background: linear-gradient(90deg, #4ade80, #fbbf24, #f87171);
    border-radius: 5px;
    height: 8px;
}

.slider::-moz-range-track {
    background: linear-gradient(90deg, #4ade80, #fbbf24, #f87171);
    border-radius: 5px;
    height: 8px;
}

#angleSlider::-webkit-slider-track {
    background: linear-gradient(90deg, #f87171, #4a9eff, #f87171);
}

#angleSlider::-moz-range-track {
    background: linear-gradient(90deg, #f87171, #4a9eff, #f87171);
}

@media (max-width: 480px) {
    .slider-control {
        max-width: 280px;
    }
    
    .slider-control label {
        font-size: 12px;
    }
}
}
    
}