/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
}

/* ============================================ */
/* JOIN SCREEN */
/* ============================================ */

#join-screen {
    height: 100vh;
    width: 100vw;
    background: linear-gradient(135deg, #FF6B9D 0%, #FFA5C8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.join-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.join-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.join-title {
    font-size: 36px;
    font-weight: bold;
    color: white;
    margin: 0;
}

.join-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.code-input {
    width: 280px;
    height: 80px;
    font-size: 48px;
    font-weight: bold;
    font-family: 'Courier New', Monaco, monospace;
    text-align: center;
    letter-spacing: 8px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 15px;
    outline: none;
    margin-top: 20px;
}

.code-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 8px;
}

.join-button {
    width: 220px;
    height: 65px;
    font-size: 24px;
    font-weight: bold;
    color: #FF6B9D;
    background: white;
    border: none;
    border-radius: 32px;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s;
}

.join-button:hover {
    transform: scale(1.05);
}

.join-button:active {
    transform: scale(0.95);
}

/* ============================================ */
/* SCORE SCREEN */
/* ============================================ */

#score-screen {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Full-screen split buttons */
.score-buttons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 0;
}

.team-button {
    flex: 1;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 0;
}

.team-button:active:not(:disabled) {
    opacity: 0.8;
}

.team-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.team-a-button {
    background: #FF3B30;
}

.team-b-button {
    background: #007AFF;
}

/* Overlay for score display and controls */
.score-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.score-overlay > * {
    pointer-events: auto;
}

/* Score display box */
.score-display-box {
    display: flex;
    gap: 50px;
    padding: 30px 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    margin-bottom: auto;
    margin-top: auto;
}

.score-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: auto;
    margin-top: auto;
}

.match-ended-banner {
    font-size: 24px;
    font-weight: bold;
    color: #2C2C2E;
    padding: 10px 24px;
    background: white;
    border-radius: 12px;
}

.team-score-item {
    text-align: center;
}

.team-label {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.team-score-value {
    color: white;
    font-size: 80px;
    font-weight: bold;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Control buttons */
.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    padding-bottom: 40px;
    margin-top: auto;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-btn:hover {
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 24px;
}

.start-btn {
    background: #34C759;
}

.end-btn {
    background: white;
    color: #FF3B30; 
}

.undo-btn {
    background: #FF9500;
}

/* Hide old score screen elements */
.status {
    display: none;
}