body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    /* Default background if no image is uploaded */
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    color: #fff;
    overflow-x: hidden; /* Mencegah scroll horizontal */
}

/* Base style for the container (General styles, will be overridden by media query for specific resolution) */
.container {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 90%;
    max-width: 900px; /* Default max-width for smaller screens */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

h1 {
    color: #f1c40f;
    margin-bottom: 30px;
    font-size: 3em;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
}

/* --- Admin Panel Styles (No changes needed for admin panel itself for 1920x1080) --- */
.admin-panel h1 {
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.header-logo {
    margin-bottom: 20px;
}

.tournament-logo-admin {
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.control-section {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.admin-panel label {
    font-weight: bold;
    margin-right: 5px;
    color: #ecf0f1;
}

.admin-panel input[type="text"],
.admin-panel input[type="number"],
.admin-panel input[type="file"] {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    margin-right: 10px;
    flex-grow: 1;
    max-width: 200px;
}

.admin-panel input[type="file"] {
    background-color: transparent; /* For file input, keep background clear */
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    color: #ecf0f1;
}
.admin-panel input[type="file"]::-webkit-file-upload-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.admin-panel input[type="file"]::-webkit-file-upload-button:hover {
    background-color: #2980b9;
}


.admin-panel input::placeholder {
    color: #ccc;
}

.admin-panel input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #f1c40f;
}

.image-upload-section h3 {
    color: #f1c40f;
    margin-bottom: 15px;
    font-size: 1.5em;
    width: 100%;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.upload-form form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}
.upload-form form label {
    flex-basis: 150px; /* Lebar label */
    text-align: right;
}
.upload-form form input[type="file"] {
    flex-grow: 1;
    max-width: 250px;
}
.upload-form form button {
    flex-basis: 150px;
    margin-left: 10px; /* Spasi dari input */
}


.scoreboard-control {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.team-control {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 25px;
    flex: 1;
    min-width: 300px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative; /* For server indicator positioning */
}

.team-control h2 {
    color: #f1c40f;
    margin-top: 0;
    font-size: 2em;
    margin-bottom: 15px;
}

.score-display {
    font-size: 6em;
    font-weight: bold;
    color: #3498db;
    margin: 15px 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.score-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.admin-panel button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.admin-panel button:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

.admin-panel button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.admin-panel .end-set-button {
    background-color: #e67e22;
}
.admin-panel .end-set-button:hover {
    background-color: #d35400;
}

.admin-panel .reset-all-button, .reset-points-current-set-button {
    background-color: #e74c3c;
}
.admin-panel .reset-all-button:hover, .reset-points-current-set-button:hover {
    background-color: #c0392b;
}

.game-actions {
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
}

.game-actions p {
    font-size: 1.2em;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 15px;
}

.game-actions form {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

.game-actions button {
    margin: 5px 10px;
    flex: 1;
    max-width: 200px;
}

.view-public {
    margin-top: 30px;
    font-size: 1.1em;
}

.view-public a {
    color: #f1c40f;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.view-public a:hover {
    color: #f39c12;
    text-decoration: underline;
}

/* Server Indicator (Admin Panel) */
.server-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.server-control .set-server-btn {
    background-color: #8e44ad;
}
.server-control .set-server-btn:hover {
    background-color: #9b59b6;
}

.server-indicator {
    font-size: 2.5em;
    color: rgba(255, 255, 0, 0.3);
    transition: color 0.3s ease, transform 0.2s ease;
    transform: scale(0.8);
}

.server-indicator.active {
    color: #ffe000;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.8), 0 0 5px rgba(255, 255, 0, 0.5);
    transform: scale(1.2);
}


/* --- Public Scoreboard Styles (Default for wider screens) --- */
.public-view {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    /* Ensure body takes full viewport height for TV display */
    height: 100vh;
    width: 100vw;
}

.public-scoreboard {
    padding: 50px;
    max-width: 100%; /* Allow it to expand */
    background-color: rgba(0, 0, 0, 0.6);
    /* For TV, ensure it fills available space */
    width: 90%; /* Start with 90% width */
    height: auto; /* Allow height to adjust */
    display: flex; /* Use flexbox for content distribution */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.public-scoreboard h1 {
    font-size: 4.5em;
    margin-bottom: 40px;
    color: #ecf0f1;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
}

.tournament-logo-public {
    max-width: 200px;
    height: auto;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.sets-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 30px;
    gap: 20px;
}

.set-score {
    font-size: 4em;
    font-weight: bold;
    color: #f1c40f;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.set-label {
    font-size: 1.8em;
    font-weight: bold;
    color: #ecf0f1;
    margin-top: 10px;
}

.current-set-info {
    font-size: 1.5em;
    color: #bdc3c7;
    margin-bottom: 40px;
    font-weight: bold;
}

.main-scoreboard {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 50px;
    width: 100%; /* Ensure it spans the container */
}

.team-display {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px 40px;
    flex: 1;
    min-width: 350px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.team-name {
    font-size: 2.8em;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.team-score {
    font-size: 9em;
    font-weight: bolder;
    color: #e74c3c;
    text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
}

.separator {
    font-size: 3em;
    font-weight: bold;
    color: #f1c40f;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

/* Server Indicator (Public View) */
.server-indicator-public {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 3em;
    color: rgba(255, 255, 0, 0.3);
    transition: color 0.3s ease, transform 0.2s ease;
    transform: scale(0.8);
}

.server-indicator-public.active {
    color: #ffe000;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.9), 0 0 8px rgba(255, 255, 0, 0.6);
    transform: scale(1.3);
}


/* --- Specific styles for 1920x1080 resolution --- */
@media (min-width: 1920px) and (min-height: 1080px) {
    body.public-view {
        /* Ensure no extra margins, fill the screen */
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .public-scoreboard {
        max-width: 1800px; /* Lebar maksimal mendekati full HD */
        width: 95%; /* Agak lebih lebar */
        padding: 80px 100px; /* Padding lebih besar */
        border-radius: 20px; /* Sedikit lebih membulat */
    }

    .public-scoreboard h1 {
        font-size: 6em; /* Judul lebih besar */
        margin-bottom: 60px;
    }

    .tournament-logo-public {
        max-width: 300px; /* Logo lebih besar */
        margin-bottom: 40px;
    }

    .sets-display {
        gap: 40px; /* Jarak antar elemen set lebih besar */
        margin-bottom: 50px;
    }

    .set-score {
        font-size: 5.5em; /* Ukuran skor set lebih besar */
    }

    .set-label {
        font-size: 2.5em; /* Label set lebih besar */
    }

    .current-set-info {
        font-size: 2.2em; /* Informasi set saat ini lebih besar */
        margin-bottom: 60px;
    }

    .main-scoreboard {
        gap: 80px; /* Jarak antara tim lebih lebar */
    }

    .team-display {
        padding: 50px 60px; /* Padding tim lebih besar */
        min-width: 500px; /* Lebar minimum tim lebih besar */
    }

    .team-name {
        font-size: 4em; /* Nama tim lebih besar */
        margin-bottom: 30px;
    }

    .team-score {
        font-size: 12em; /* Skor utama jauh lebih besar */
    }

    .separator {
        font-size: 5em; /* Separator 'VS' lebih besar */
    }

    .server-indicator-public {
        font-size: 4.5em; /* Indikator servis lebih besar */
        top: 25px;
        right: 25px;
    }
}


/* Responsiveness (for smaller screens, ensure these are after 1920x1080 for proper cascade) */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2.5em;
    }

    .admin-panel h1 {
        font-size: 2em;
    }

    .scoreboard-control, .main-scoreboard {
        flex-direction: column;
        gap: 25px;
    }

    .team-control, .team-display {
        width: 100%;
        min-width: unset;
    }

    .score-display {
        font-size: 5em;
    }

    .team-name {
        font-size: 2.2em;
    }

    .team-score {
        font-size: 7em;
    }

    .sets-display {
        flex-direction: column;
        gap: 10px;
    }

    .set-score {
        font-size: 3em;
    }

    .set-label {
        font-size: 1.5em;
    }

    .separator {
        font-size: 2.5em;
    }

    .admin-panel .control-section form {
        flex-direction: column;
    }
    .upload-form form {
        flex-direction: column;
    }
    .upload-form form label {
        text-align: center;
        width: 100%;
    }
    .upload-form form input[type="file"] {
        max-width: 100%;
    }
    .upload-form form button {
        margin-left: 0;
        width: 100%;
    }

    .game-actions form {
        flex-direction: column;
        gap: 15px;
    }

    .tournament-logo-public {
        max-width: 150px;
    }

    .server-indicator-public {
        font-size: 2em;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
    .admin-panel h1 {
        font-size: 1.8em;
    }
    .admin-panel input, .admin-panel button {
        width: 100%;
        margin-right: 0;
    }
    .admin-panel button {
        padding: 10px 15px;
        font-size: 1em;
    }
}