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

:root {
    --primary-color: #1E90FF;
    --secondary-color: #FFD700;
    --accent-color: #FF6B35;
    --dark-bg: #0a0e27;
    --light-text: #ffffff;
    --border-radius: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1f3a 100%);
    color: var(--light-text);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    padding: 25px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(30, 144, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.header h1 {
    font-size: 2.8em;
    margin-bottom: 5px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
    letter-spacing: 2px;
    font-weight: 900;
}

.tagline {
    font-size: 1em;
    color: rgba(255,255,255,0.9);
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    font-style: italic;
    letter-spacing: 1px;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: 600;
    position: relative;
    z-index: 1;
    background: rgba(0,0,0,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #FFD700;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background-color: #00FF00;
    animation: none;
    box-shadow: 0 0 10px #00FF00;
}

.status-dot.disconnected {
    background-color: #FF0000;
    animation: none;
    box-shadow: 0 0 10px #FF0000;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.courts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.court-card {
    background: linear-gradient(135deg, #1a2847 0%, #2a3a5a 100%);
    border: 3px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 22px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.court-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    pointer-events: none;
}

.court-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(30, 144, 255, 0.6);
    border-color: var(--primary-color);
}

.court-card.active {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, #2a4a6a 0%, #3a5a7a 100%);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
}

.court-number {
    font-size: 2.2em;
    font-weight: 900;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
    position: relative;
    z-index: 1;
}

.teams-container {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.team {
    margin-bottom: 15px;
    background: rgba(30, 144, 255, 0.1);
    padding: 14px;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    backdrop-filter: blur(10px);
}

.team.b {
    background: rgba(255, 107, 53, 0.1);
    border-left-color: var(--accent-color);
}

.team-name {
    font-size: 0.85em;
    color: #adb8e0;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.score-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 8px;
}

.score-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    background: rgba(30, 144, 255, 0.2);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: 1.9em;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
}

.score-number.secondary {
    background: rgba(255, 107, 53, 0.2);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.score-number.server {
    box-shadow: 0 0 20px rgba(30, 144, 255, 0.8);
    transform: scale(1.15);
    border-width: 3px;
}

.score-number.server.secondary {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
}

.score-separator {
    font-size: 1.8em;
    color: var(--secondary-color);
    font-weight: bold;
    margin: 0 2px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.btn-point {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4169E1 100%);
    color: white;
    border: 3px solid var(--secondary-color);
    padding: 22px;
    font-size: 2.2em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(30, 144, 255, 0.5);
    user-select: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn-point:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(30, 144, 255, 0.7);
}

.btn-point:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(30, 144, 255, 0.7);
    border-color: #fff;
}

.btn-point.secondary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #FF8C42 100%);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
}

.btn-point.secondary:hover {
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.7);
}

.btn-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.btn-secondary, .btn-action {
    flex: 1;
    min-width: 75px;
    padding: 12px;
    font-size: 0.8em;
    border: 2px solid var(--secondary-color);
    background: rgba(255, 215, 0, 0.1);
    color: var(--secondary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary:hover, .btn-action:hover {
    background: var(--secondary-color);
    color: var(--dark-bg);
    transform: scale(1.05);
}

.btn-secondary:active, .btn-action:active {
    transform: scale(0.95);
}

.game-status {
    background: rgba(255, 215, 0, 0.15);
    border: 2px dashed var(--secondary-color);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-status.finished {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4CAF50;
    color: #4CAF50;
    animation: pulse-finish 1s ease-in-out;
}

@keyframes pulse-finish {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a2847 0%, #2a3a5a 100%);
    padding: 35px;
    border-radius: var(--border-radius);
    border: 3px solid var(--primary-color);
    max-width: 420px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(30, 144, 255, 0.6);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    margin-bottom: 25px;
    color: var(--secondary-color);
    text-align: center;
    font-size: 1.6em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--secondary-color);
    background: rgba(30, 144, 255, 0.1);
    color: var(--light-text);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(30, 144, 255, 0.15);
    box-shadow: 0 0 15px rgba(30, 144, 255, 0.4);
}

.form-group input::placeholder {
    color: rgba(255,255,255,0.4);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: 3px solid var(--secondary-color);
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 144, 255, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

/* Responsivo para celulares em modo landscape */
@media (max-height: 600px) {
    .court-card {
        padding: 15px;
    }

    .score-number {
        width: 48px;
        height: 48px;
        font-size: 1.6em;
    }

    .btn-point {
        padding: 16px;
        font-size: 1.8em;
    }

    .header h1 {
        font-size: 2em;
    }
}

/* Modo escuro sempre ativo */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, var(--dark-bg) 0%, #0f1535 100%);
    }
}