@font-face {
    font-family: "PadelFont";
    src: url("/static/font.ttf") format("truetype");
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "PadelFont", Arial, sans-serif;
}

/* CONTROL / REFEREE */

.control-body {
    background: white;
    color: black;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
}

.control-wrapper {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.court-title {
    text-align: center;
    font-size: 34px;
    letter-spacing: 2px;
    margin-top: 8px;
    color: black;
}

.score-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    margin: 24px 0;
}

.score-column {
    text-align: center;
    background: #f5f5f5;
    border-radius: 22px;
    padding: 20px 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.control-score {
    font-size: 96px;
    line-height: 1;
}

.team-label {
    font-size: 22px;
    margin-top: 8px;
    letter-spacing: 2px;
}

.blue {
    color: #0F0069;
}

.red {
    color: #D2003C;
}

.score-divider {
    font-size: 70px;
    color: black;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.score-button {
    border: none;
    border-radius: 22px;
    color: white;
    font-family: inherit;
    font-weight: bold;
    box-shadow: 0 8px 0 rgba(0,0,0,0.25);
    cursor: pointer;
}

.score-button:active {
    transform: translateY(5px);
    box-shadow: 0 3px 0 rgba(0,0,0,0.25);
}

.plus {
    height: 180px;
    font-size: 125px;
}

.minus {
    height: 95px;
    font-size: 70px;
}

.blue-button {
    background: #0F0069;
}

.red-button {
    background: #D2003C;
}

.reset-button {
    margin-top: 30px;
    height: 80px;
    border-radius: 20px;
    border: 4px solid #D2003C;
    background: white;
    color: #D2003C;
    font-family: inherit;
    font-size: 34px;
    letter-spacing: 2px;
    cursor: pointer;
}

.reset-button:active {
    background: #D2003C;
    color: white;
}

/* SCREEN / DISPLAY */

:root {
    --event-logo-width: 760px;
    --score-font-size: 680px;
    --score-y: 36%;
    --blue-score-x: 16%;
    --red-score-x: 84%;
    --buzzer-number-size: 1050px;
    --buzzer-text-size: 245px;

    --idle-court-font-size: 215px;
    --idle-court-x: 30px;
    --idle-logo-x: -30px;
    --idle-logo-max-width: 70%;
    --idle-logo-max-height: 55%;
    --event-logo-y: 35%;

    --buzzer-number-y: 32%;
    --buzzer-text-y: 83%;

    --idle-court-y: 0px;
    --idle-logo-y: 0px;
}

.screen-body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-image: url("/static/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.screen-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.screen-logo {
    position: absolute;
    left: 50%;
    top: var(--event-logo-y);
    transform: translate(-50%, -50%);
    width: var(--event-logo-width);
    height: auto;
}

.screen-score-row {
    position: absolute;
    left: 0;
    top: var(--score-y);
    width: 100%;
    height: 0;
}

.screen-score {
    font-size: var(--score-font-size);
    line-height: 0.8;
    text-align: center;
    width: 520px;
}

.screen-score.blue {
    position: absolute;
    left: var(--blue-score-x);
    transform: translateX(-50%);
}

.screen-score.red {
    position: absolute;
    left: var(--red-score-x);
    transform: translateX(-50%);
}

.screen-separator {
    display: none;
}

/* BUZZER ANIMATION */

.animation-layer {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    background-image: url("/static/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.impact-flash {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    z-index: 25;
}

.flash-active .impact-flash {
    animation: impactFlash 0.18s ease-out;
}

.transition-logo {
    position: absolute;
    left: 50%;
    top: 35%;
    width: var(--event-logo-width);
    height: auto;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    z-index: 30;
}

.logo-zoom-out {
    animation: logoZoomOut 0.52s cubic-bezier(.12,.88,.18,1) forwards;
}

.logo-zoom-back {
    animation: logoZoomBack 0.65s cubic-bezier(.12,.88,.18,1.15) forwards;
}

.buzzer-content {
    position: absolute;
    inset: 0;
    z-index: 28;
    opacity: 1;
}

.buzzer-number {
    position: absolute;
    left: 50%;
    top: var(--buzzer-number-y);
    transform: translate(-50%, -50%) scale(1);
    font-size: var(--buzzer-number-size);
    line-height: 0.7;
}

.buzzer-label {
    position: absolute;
    left: 50%;
    top: var(--buzzer-text-y);
    transform: translate(-50%, -50%) scale(1);
    font-size: var(--buzzer-text-size);
    line-height: 1;
}

.blue-buzzer .buzzer-number,
.blue-buzzer .buzzer-label {
    color: #0F0069;
}

.red-buzzer .buzzer-number,
.red-buzzer .buzzer-label {
    color: #D2003C;
}

.buzzer-reveal {
    animation: buzzerReveal 0.28s ease-out forwards;
}

.buzzer-pulse-number {
    animation: buzzerNumberPulse 0.85s ease-in-out infinite;
}

.buzzer-pulse-label {
    animation: buzzerLabelPulse 0.85s ease-in-out infinite;
}

.score-return-bounce {
    animation: scoreReturnBounce 0.55s ease-out;
}

@keyframes impactFlash {
    0% { opacity: 0; }
    35% { opacity: 0.55; }
    100% { opacity: 0; }
}

@keyframes logoZoomOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    55% {
        transform: translate(-50%, -50%) scale(7.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(13);
        opacity: 0;
    }
}

@keyframes logoZoomBack {
    0% {
        transform: translate(-50%, -50%) scale(13);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    72% {
        transform: translate(-50%, -50%) scale(0.88);
        opacity: 1;
    }
    88% {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes buzzerReveal {
    0% {
        opacity: 0;
        transform: scale(0.88);
    }
    70% {
        opacity: 1;
        transform: scale(1.08);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes buzzerNumberPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    45% { transform: translate(-50%, -50%) scale(1.09); }
    60% { transform: translate(-50%, -50%) scale(1.04); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes buzzerLabelPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    45% { transform: translate(-50%, -50%) scale(1.11); }
    60% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes scoreReturnBounce {
    0% {
        transform: scale(0.88);
        opacity: 0.4;
    }
    65% {
        transform: scale(1.06);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* IDLE SCREEN */

.idle-layer {
    position: fixed;
    inset: 0;
    z-index: 15;
    background-image: url("/static/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.idle-left,
.idle-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.idle-court-name {
    font-size: var(--idle-court-font-size);
    color: black;
    letter-spacing: 4px;
    transform: translate(
        var(--idle-court-x),
        var(--idle-court-y)
    );
}

.idle-sponsor-logo {
    max-width: var(--idle-logo-max-width);
    max-height: var(--idle-logo-max-height);
    object-fit: contain;
    transform: translate(
        var(--idle-logo-x),
        var(--idle-logo-y)
    );
}

.idle-show .idle-court-name {
    animation: idleCourtIn 0.45s ease-out forwards;
}

.idle-show .idle-sponsor-logo {
    animation: idleLogoIn 0.45s ease-out forwards;
}

.idle-hide .idle-court-name {
    animation: idleCourtOut 0.35s ease-in forwards;
}

.idle-hide .idle-sponsor-logo {
    animation: idleLogoOut 0.35s ease-in forwards;
}

@keyframes idleCourtIn {
    0% {
        opacity: 0;
        transform: translateX(-220px);
    }
    100% {
        opacity: 1;
        transform: translateX(var(--idle-court-x));
    }
}

@keyframes idleLogoIn {
    0% {
        opacity: 0;
        transform: translateX(220px);
    }
    100% {
        opacity: 1;
        transform: translateX(var(--idle-logo-x));
    }
}

@keyframes idleCourtOut {
    0% {
        opacity: 1;
        transform: translateX(var(--idle-court-x));
    }
    100% {
        opacity: 0;
        transform: translateX(-220px);
    }
}

@keyframes idleLogoOut {
    0% {
        opacity: 1;
        transform: translateX(var(--idle-logo-x));
    }
    100% {
        opacity: 0;
        transform: translateX(220px);
    }
}

/* ========================= */
/* OPERATOR */
/* ========================= */

.operator-body{
    margin:0;
    background:#f5f5f5;
    font-family:Arial,Helvetica,sans-serif;
}

.operator-wrapper{
    max-width:1500px;
    margin:auto;
    padding:40px;
}

.operator-header{
    margin-bottom:40px;
}

.operator-header h1{
    margin:0;
    font-size:42px;
    color:#222;
}

.operator-header p{
    margin-top:8px;
    color:#777;
    font-size:22px;
}

.operator-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:30px;
}

.operator-card{
    background:white;
    border-radius:18px;
    padding:35px;
    box-shadow:0 8px 25px rgba(0,0,0,.08);
}

.operator-court-name{
    font-size:34px;
    font-weight:bold;
    color:#444;
    margin-bottom:35px;
}

.operator-score{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:35px;
}

.operator-blue{
    color:#0F0069;
    font-size:110px;
    font-weight:bold;
}

.operator-red{
    color:#D2003C;
    font-size:110px;
    font-weight:bold;
}

.operator-divider{
    font-size:80px;
    color:#777;
    font-weight:bold;
}

.operator-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-button {
    display: inline-block;
    padding: 16px 26px;
    border-radius: 14px;
    background: #111;
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}

.admin-button:hover {
    background: #333;
}

.admin-card {
    background: white;
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
}

.admin-card h2 {
    margin-top: 0;
    font-size: 30px;
}

.admin-card label {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
    color: #555;
}

.admin-input,
.admin-select {
    width: 100%;
    max-width: 420px;
    padding: 16px;
    font-size: 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
}

/* ==========================
   ADMIN
========================== */

.admin-topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:40px;
}

.admin-button{
    background:#111;
    color:white;
    padding:14px 28px;
    border-radius:10px;
    text-decoration:none;
    font-weight:700;
    transition:.2s;
}

.admin-button:hover{
    background:#333;
}

.admin-section-title{
    font-size:28px;
    font-weight:800;
    margin-top:45px;
    margin-bottom:18px;
    color:#222;
    letter-spacing:1px;
    text-transform:uppercase;
}

.admin-card{
    background:#fff;
    border-radius:16px;
    padding:28px;
    margin-bottom:30px;
    box-shadow:0 8px 30px rgba(0,0,0,.08);
}

.admin-grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:28px 40px;
}

.admin-card label{
    display:block;
    font-weight:700;
    margin-bottom:8px;
    color:#444;
}

.admin-card input[type=range]{
    width:100%;
}

.admin-value{
    margin-top:6px;
    font-size:14px;
    color:#666;
    font-weight:700;
}

.admin-select{
    width:100%;
    padding:12px;
    border-radius:10px;
    border:1px solid #ddd;
    font-size:15px;
    background:white;
}