* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

body {
    background-color: #000;
    font-family: 'Teko', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #2a7fbf 0%, #1a5fa5 100%);
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* UI Elements */
#top-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, rgba(30,30,30,0.9), rgba(0,0,0,0.9));
    padding: 10px 40px;
    border-radius: 40px;
    border: 4px solid #444;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6), inset 0 2px 10px rgba(255,255,255,0.2);
    pointer-events: auto;
    z-index: 10;
}

.team-score {
    display: flex;
    align-items: center;
    color: white;
    font-size: 42px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.team-name {
    margin: 0 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.score {
    background: linear-gradient(180deg, #ffffff 0%, #dddddd 100%);
    color: black;
    padding: 5px 25px;
    border-radius: 15px;
    font-weight: 700;
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.3), 0 5px 10px rgba(0,0,0,0.5);
    border: 3px solid #ccc;
}

.timer {
    color: #ffcc00;
    font-size: 48px;
    margin: 0 40px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.5), 0 4px 0 #cc9900;
}

/* Screens */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(50px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 95, 165, 0.7);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 100;
}

.screen:not(.hidden) {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hidden {
    display: none !important;
}

.logo-thumb {
    width: 350px;
    height: 210px;
    border-radius: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 0 8px rgba(255,255,255,0.2);
    border: 6px solid #ffcc00;
    object-fit: cover;
    animation: floatTitle 4s ease-in-out infinite;
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

h1 {
    font-size: 80px;
    background: linear-gradient(180deg, #ffffff 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 0 #cc0000) drop-shadow(0 15px 20px rgba(0,0,0,0.6));
    margin-bottom: 15px;
    animation: floatTitle 3s ease-in-out infinite reverse;
}

p {
    color: #ffcc00;
    font-size: 36px;
    margin-bottom: 40px;
    text-shadow: 0 4px 0 rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.4);
    padding: 10px 40px;
    border-radius: 20px;
}

@keyframes pulseBtn {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.ui-button {
    font-family: 'Teko', sans-serif;
    background: linear-gradient(180deg, #ff3333 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 15px 70px;
    font-size: 48px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 12px 0 #880000,
        0 20px 30px rgba(0,0,0,0.6),
        inset 0 5px 0 rgba(255,255,255,0.4);
    border: 4px solid #ff9999;
    transition: all 0.1s;
    animation: pulseBtn 2s infinite;
}

.ui-button:active {
    transform: translateY(12px);
    box-shadow: 
        0 0px 0 #880000,
        0 5px 10px rgba(0,0,0,0.6),
        inset 0 5px 0 rgba(255,255,255,0.4);
    animation: none;
}

/* Power Bar */
#power-bar-container {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 30px;
    background: rgba(0,0,0,0.7);
    border: 4px solid white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 10;
}

#power-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffcc00, #ff0000);
    box-shadow: inset 0 5px 0 rgba(255,255,255,0.4);
}

/* Goal Banner */
#goal-banner {
    position: absolute;
    top: 50%;
    left: -100%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, rgba(204, 0, 0, 0.95), transparent);
    color: white;
    font-size: 150px;
    width: 100%;
    text-align: center;
    padding: 30px 0;
    text-shadow: 0 10px 0 #880000, 0 20px 30px rgba(0,0,0,0.8);
    transition: left 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 50;
}

#goal-banner.show {
    left: 0;
    animation: pulseBtn 0.5s infinite alternate;
}

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    height: 150px;
    pointer-events: none;
    z-index: 10;
}

.joystick-base {
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(0,0,0,0.2));
    border: 4px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    pointer-events: auto;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.3), 0 15px 30px rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

.joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: linear-gradient(180deg, #ffffff 0%, #cccccc 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 5px 0 #fff;
}

.action-buttons {
    position: absolute;
    bottom: 0;
    right: 20px;
    width: 250px;
    height: 200px;
    pointer-events: auto;
}

.control-btn {
    position: absolute;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Teko', sans-serif;
    color: white;
    font-weight: 700;
    box-shadow: 0 10px 0 rgba(0,0,0,0.4), 0 15px 20px rgba(0,0,0,0.5);
    transition: all 0.1s;
}

.control-btn::after {
    content: '';
    position: absolute;
    top: 5%; left: 15%; width: 70%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.6), transparent);
    border-radius: 50%;
}

.control-btn:active {
    transform: translateY(10px);
    box-shadow: 0 0px 0 rgba(0,0,0,0.4), 0 5px 10px rgba(0,0,0,0.5);
}

.shoot-btn { 
    bottom: 0; right: 0; 
    background: linear-gradient(180deg, #ff4444, #cc0000); 
    border: 4px solid #ff9999; 
    width: 90px; height: 90px; 
    font-size: 32px;
}
.pass-btn { 
    bottom: 20px; right: 110px; 
    background: linear-gradient(180deg, #4da6ff, #0066cc); 
    border: 4px solid #b3d9ff; 
    width: 75px; height: 75px;
    font-size: 26px;
}
.switch-btn { 
    bottom: 110px; right: 30px; 
    background: linear-gradient(180deg, #ffee88, #ffcc00); 
    color: black; 
    border: 4px solid #fff; 
    width: 75px; height: 75px;
    font-size: 26px;
}

/* Responsive */
@media (max-width: 768px) {
    .desktop-only { display: none; }
    h1 { font-size: 56px; }
    .team-score { font-size: 28px; }
    .timer { font-size: 32px; margin: 0 15px; }
    #top-bar { padding: 5px 20px; }
}

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}
/* CG-batch-overlay-fix */
#game-canvas, canvas#game-canvas { touch-action: none; }
#game-ui.screen,
#game-ui.screen.active { pointer-events: none !important; }
