:root{
    --verde:#1e8449;
    --naranja:#f8c471;
    --rojo:#c0392b;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Arial,sans-serif;
    background:#f2f2f2;
}

/* HEADER */

header{
    background:#111;
    color:white;
    padding:10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

#clock{
    font-size:26px;
    font-weight:bold;
}

.headerButtons{
    display:flex;
    gap:5px;
    align-items:center;
}

.headerButtons button{
    width:auto;
    margin:0;
    padding:4px 8px;
    font-size:11px;
    border:none;
    color:white;
    font-weight:bold;
    cursor:pointer;
}

.btn1,
.btn2{
    background:var(--verde);
}

.btnPause{
    background:var(--naranja);
    color:#111;
}

.btnReset{
    background:var(--rojo);
}

/* LAYOUT */

#main{
    display:flex;
}

#sidebar{
    width:260px;
    background:white;
    padding:10px;
    border-right:1px solid #ddd;
}

input,
select,
button{
    width:100%;
    margin:5px 0;
    padding:6px;
    box-sizing:border-box;
}

select{
    background:white;
    border:1px solid #ccc;
    padding:8px;
    cursor:pointer;
}

.btnAdd{
    background:var(--verde);
    color:white;
    border:none;
    cursor:pointer;
}

.btnDelete{
    background:var(--rojo);
    color:white;
    border:none;
    cursor:pointer;
}

/* CAMPO */

#pitchContainer{
    flex:1;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:10px;
}

#pitch{
    position:relative;
    width:900px;
    height:600px;

    background:
    repeating-linear-gradient(
        90deg,
        #2e7d32 0px,
        #2e7d32 75px,
        #276c2b 75px,
        #276c2b 150px
    );

    border:3px solid white;
    overflow:hidden;
}

#heatCanvas{
    position:absolute;
    left:0;
    top:0;
    width:100%;
    height:100%;
    z-index:1;
    pointer-events:none;
}

.midline,
.centerCircle,
.centerSpot,
.penalty,
.goalArea,
.penaltySpot,
.penaltyArc,
.cornerArc{
    z-index:2;
}

.midline{
    position:absolute;
    left:50%;
    width:2px;
    height:100%;
    background:white;
}

.centerCircle{
    position:absolute;
    width:15.25%;
    height:22.875%;
    border:2px solid white;
    border-radius:50%;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
}

.centerSpot{
    position:absolute;
    width:6px;
    height:6px;
    background:white;
    border-radius:50%;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
}

.penalty{
    position:absolute;
    top:24.8%;
    width:13.75%;
    height:50.4%;
    border:2px solid white;
}

.penalty.left{
    left:0;
    border-left:none;
}

.penalty.right{
    right:0;
    border-right:none;
}

.goalArea{
    position:absolute;
    top:38.55%;
    width:4.583%;
    height:22.9%;
    border:2px solid white;
}

.goalArea.left{
    left:0;
    border-left:none;
}

.goalArea.right{
    right:0;
    border-right:none;
}

.penaltySpot{
    position:absolute;
    width:6px;
    height:6px;
    background:white;
    border-radius:50%;
    top:50%;
    transform:translate(-50%,-50%);
}

.penaltySpot.left{
    left:9.167%;
}

.penaltySpot.right{
    left:90.833%;
}

.penaltyArc{
    position:absolute;
    width:15.25%;
    height:22.875%;
    border:2px solid white;
    border-radius:50%;
    top:50%;
    transform:translate(-50%,-50%);
    pointer-events:none;
}

.penaltyArc.left{
    left:9.167%;
    clip-path:inset(0 0 0 80%);
}

.penaltyArc.right{
    left:90.833%;
    clip-path:inset(0 80% 0 0);
}

.cornerArc{
    position:absolute;
    width:34px;
    height:34px;
    border:2px solid white;
    border-radius:50%;
}

.cornerArc.tl{
    top:-17px;
    left:-17px;
}

.cornerArc.tr{
    top:-17px;
    right:-17px;
}

.cornerArc.bl{
    bottom:-17px;
    left:-17px;
}

.cornerArc.br{
    bottom:-17px;
    right:-17px;
}

.eventPoint{
    position:absolute;
    width:8px;
    height:8px;
    border-radius:50%;
    background:red;
    transform:translate(-50%,-50%);
    z-index:5;
}

/* PANEL */

#overlayPanel{
    position:absolute;
    right:10px;
    top:10px;
    z-index:20;
    background:rgba(255,255,255,.95);
    padding:8px;
    border-radius:8px;
    width:190px;
    backdrop-filter:blur(6px);
    box-shadow:0 2px 8px rgba(0,0,0,.25);
}

#overlayHeader{
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-weight:bold;
    font-size:12px;
    margin-bottom:5px;
}

#overlayToggle{
    width:auto;
    margin:0;
    padding:2px 6px;
    background:#2c3e50;
    color:white;
    border:none;
    border-radius:4px;
    cursor:pointer;
}

#overlayContent label{
    display:block;
    font-size:11px;
    font-weight:bold;
    margin-top:6px;
}

#overlayContent select{
    width:100%;
    margin-top:2px;
    padding:4px;
    font-size:12px;
}

#overlayContent input[type="checkbox"]{
    width:auto;
    margin-right:5px;
}

#overlayPanel.collapsed{
    width:auto;
}

#overlayPanel.collapsed #overlayContent{
    display:none;
}

/* TABLA */

table{
    width:100%;
    border-collapse:collapse;
    background:white;
}

td,
th{
    border:1px solid #ccc;
    padding:4px;
    font-size:12px;
}

td button{
    background:var(--rojo);
    color:white;
    border:none;
    cursor:pointer;
}

td[contenteditable="true"]{
    background:#fffdf0;
    cursor:text;
}

/* EXPORTAR */

.exportButtons{
    padding:10px;
}

#exportBtn,
.exportImgBtn{
    width:200px;
    background:#2c3e50;
    color:white;
    padding:10px;
    margin-right:10px;
    border:none;
    border-radius:5px;
    cursor:pointer;
}

/* TOOLTIP */

#pointTooltip{
    position:absolute;
    display:none;
    white-space:nowrap;
    background:rgba(0,0,0,.85);
    color:white;
    font-size:12px;
    padding:6px 8px;
    border-radius:5px;
    pointer-events:none;
    z-index:9999;
}