* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: Arial, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    position: fixed;
}

body {
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overscroll-behavior: none;
}

.container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score-section {
    padding: 20px;
    cursor: pointer;
    transition: transform 0.1s ease;
    text-align: center;
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#home-section {
    background-color: #2196F3;
    color: white;
}

#away-section {
    background-color: #f44336;
    color: white;
}

.score-section:active {
    transform: scale(0.98);
}

h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.score {
    font-size: 4.5rem;
    font-weight: bold;
    margin: 10px 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Set display styling */
.sets-display {
    font-size: 1.3rem;
    margin: 5px 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.9);
}

#home-sets, #away-sets {
    font-weight: bold;
    color: white;
}

.controls {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 15px;
    background-color: white;
    flex-wrap: nowrap;
}

button {
    background-color: #555;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 16px;
    min-width: 80px;
    cursor: pointer;
    font-size: 1rem;
    flex: 1;
    margin: 0 5px;
}

button:hover {
    background-color: #666;
}

button:active {
    transform: scale(0.97);
}

#new-set-btn {
    background-color: #4CAF50;
}

.set-history {
    padding: 15px;
    text-align: left;
    background-color: white;
    border-top: 1px solid #eee;
    max-height: 35vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.set-history h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-align: center;
    color: #555;
    position: sticky;
    top: 0;
    background-color: white;
    padding: 5px 0;
    z-index: 1;
}

#set-list {
    overflow-y: auto;
    margin-bottom: 5px;
}

.set-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.set-item .set-number {
    font-weight: bold;
    color: #555;
    font-size: 1rem;
}

.set-item .set-score {
    display: flex;
    gap: 5px;
    font-size: 1.1rem;
}

.set-item .home-score {
    color: #2196F3;
    font-weight: bold;
}

.set-item .away-score {
    color: #f44336;
    font-weight: bold;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .container {
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    
    .score-section {
        padding: 10px;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    .score {
        font-size: 4rem;
    }
    
    .sets-display {
        font-size: 1.2rem;
    }
    
    .controls {
        padding: 10px;
    }
    
    button {
        padding: 10px;
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    .set-history {
        max-height: 30vh;
    }
    
    .set-item {
        padding: 12px 10px;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
        height: 100vh;
    }
    
    .score-section {
        width: 50%;
        height: 70vh;
    }
    
    .controls, .set-history {
        width: 100%;
    }
    
    .set-history {
        max-height: 20vh;
    }
    
    .score {
        font-size: 3.5rem;
    }
}

/* PWA display mode adjustments */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
        padding-left: env(safe-area-inset-left, 0);
        padding-right: env(safe-area-inset-right, 0);
    }
    
    .container {
        height: 100%;
    }
} 