* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
}

#gameContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* Menu Screen */
#menu {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-align: center;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.logo-image {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 300px;
    margin-bottom: 2rem;
}

.developer-credit {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2rem;
}

.developer-link {
    color: #81C784;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.developer-link:hover {
    color: #A5D6A7;
    text-decoration: underline;
}

.btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover, .btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: rgba(255,255,255,0.3);
}

/* Game Screen */
#gameScreen {
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    padding: 0;
    justify-content: flex-start;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 20px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.score-display {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
    font-weight: bold;
}

.court-container {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: 
        linear-gradient(90deg, transparent 49%, rgba(255,255,255,0.8) 49%, rgba(255,255,255,0.8) 51%, transparent 51%),
        linear-gradient(0deg, transparent 20%, rgba(255,255,255,0.8) 20%, rgba(255,255,255,0.8) 21%, transparent 21%),
        linear-gradient(0deg, transparent 79%, rgba(255,255,255,0.8) 79%, rgba(255,255,255,0.8) 80%, transparent 80%),
        linear-gradient(0deg, transparent 35%, rgba(255,255,255,0.6) 35%, rgba(255,255,255,0.6) 36%, transparent 36%),
        linear-gradient(0deg, transparent 64%, rgba(255,255,255,0.6) 64%, rgba(255,255,255,0.6) 65%, transparent 65%),
        #2E7D32;
    background-size: 100% 100%;
}

.court-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.mizano-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: rgba(255,255,255,0.3);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 4px;
    transform: rotate(0deg);
}

#gameCanvas {
    position: relative;
    z-index: 2;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: transparent;
}

.game-controls {
    padding: 20px;
    text-align: center;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.control-instructions {
    font-size: 1rem;
    opacity: 0.9;
}

/* Scores Screen */
#scoresScreen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
}

.screen-header h2 {
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.scores-list {
    width: 100%;
    max-width: 400px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    max-height: 500px;
    overflow-y: auto;
}

.scores-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.scores-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scores-section h3 {
    margin: 0 0 15px 0;
    color: #FFD700;
    font-size: 16px;
    text-align: center;
    border-bottom: 2px solid rgba(255, 215, 0, 0.4);
    padding-bottom: 8px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.score-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}



.score-item.stats {
    border-left-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.score-item:last-child {
    border-bottom: none;
}

.score-rank {
    font-weight: bold;
    color: #FFD700;
    min-width: 80px;
}

/* Instructions Screen */
#instructionsScreen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.instructions-content {
    width: 100%;
    max-width: 400px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.instructions-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Game Over Screen */
#gameOverScreen {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.game-over-content {
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    max-width: 350px;
    width: 100%;
}

.game-over-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.final-score {
    margin-bottom: 2rem;
}

.final-score p {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.new-record {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.5rem;
    animation: pulse 1s infinite;
}

.hidden {
    display: none;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Round Complete Screen Styles */
.round-complete-content {
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.round-stats {
    margin: 30px 0;
    font-size: 1.2rem;
}

.round-stats p {
    margin: 10px 0;
    color: #fff;
}

.best-time {
    color: #ffd700;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.round-complete-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

/* Responsive adjustments */
@media (max-height: 600px) {
    .logo {
        font-size: 3rem;
        margin-bottom: 2rem;
    }
    
    .mizano-text {
        font-size: 2rem;
    }
}

@media (max-width: 350px) {
    .logo {
        font-size: 2.5rem;
    }
    
    .mizano-text {
        font-size: 1.8rem;
    }
    
    #gameCanvas {
        width: 300px;
        height: 500px;
    }
}

/* Mobile-specific background fixes */
@media (max-width: 768px) {
    #racketSelectionScreen {
        background: #000000 !important;
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
    
    #contactScreen {
        background: #000000 !important;
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
    
    .screen {
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
}

/* Contact Screen Styles */
#contactScreen {
    background: #000000;
}

.contact-content {
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.contact-intro {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: left;
}

.contact-item {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.contact-item strong {
    color: #4CAF50;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 8px;
}

.contact-link {
    color: #81C784;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    display: inline-block;
    margin-top: 8px;
}

.contact-link:hover {
    color: #A5D6A7;
    text-decoration: underline;
}

/* Touch feedback */
.btn:active, .btn-small:active {
    transform: scale(0.95);
}

/* Racket Selection Screen */
#racketSelectionScreen {
    background: #000000;
}

.racket-selection-content {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.racket-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 10px;
}

.racket-option {
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.racket-option:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.racket-option.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.racket-preview {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.racket-option p {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    margin: 0;
}

.racket-option.selected p {
    color: #4CAF50;
}

#startGameWithRacket:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#startGameWithRacket:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Loading animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen.active {
    animation: fadeIn 0.5s ease-out;
}