*{
    box-sizing:border-box;
    margin:0;
    padding:0;
    font-family:Arial, Helvetica, sans-serif;
}

body{
    background:#0f1117;
    color:white;
    overflow:hidden;
}

.operator-layout{
    display:grid;
    grid-template-columns: 1fr 2fr;
    height:100vh;
}

/* =========================
   OPERATOR PANEL
==========================*/
.controls{
    background:#171b25;
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    grid-template-rows:auto auto auto auto 1fr;
    align-content:stretch;
    gap:10px 14px;
    padding:14px;
    overflow:hidden;
    border-right:3px solid #262d3f;
}

.controls h2{
    margin-bottom:4px;
    color:#5fd1ff;
}

.controls > h2{
    grid-column:1 / -1;
}

.controls > h3{
    align-self:center;
}

.controls > input{
    align-self:center;
}

.control-section{
    margin-bottom:0;
    padding:12px;
    border-bottom:1px solid #2f3548;
    background:#111722;
    border-radius:8px;
}

.fighter-controls{
    grid-column:1 / -1;
    margin-bottom:0;
    padding:10px;
    border-radius:8px;
}

.control-section:last-child{
    grid-column:1 / -1;
    /*display:grid;*/
    grid-template-columns:repeat(10, minmax(0, 1fr));
    gap:8px;
    align-items:end;
}

.control-section:last-child h2{
    grid-column:1 / -1;
}

.control-section:last-child h3{
    grid-column:5;
    align-self:center;
}

#category{
    grid-column:1 / 3;
}

#nextFight{
    grid-column:3 / 5;
}

#minutes{
    grid-column:6;
}

#seconds{
    grid-column:7;
}

.aka-controls{
    background:#aa1010;
}

.shiro-controls{
    background:#30343f;
}

input{
    width:100%;
    padding:7px 8px;
    margin-top:4px;
    margin-bottom:4px;
    border:none;
    border-radius:6px;
    background:#10141c;
    color:white;
}

.hidden-time-input{
    display:none;
}

.fight-time-text{
    align-self:center;
    padding:7px 8px;
    border:1px solid rgba(255, 255, 255, 0.16);
    border-radius:6px;
    background:#10141c;
    color:#58d5ff;
    font-weight:bold;
    text-align:center;
}

button{
    padding:8px 10px;
    margin:0;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-weight:bold;
    transition:0.2s;
}

button:hover{
    transform:scale(1.03);
}

.login-required-message{
    position:fixed;
    right:16px;
    bottom:16px;
    z-index:1000;
    max-width:min(360px, calc(100vw - 32px));
    padding:14px 16px;
    border:1px solid rgba(255, 255, 255, 0.28);
    border-left:6px solid #ff8c00;
    border-radius:8px;
    background:#171b25;
    color:#fff;
    box-shadow:0 16px 40px rgba(0, 0, 0, 0.45);
    line-height:1.35;
}

.login-required-message a{
    color:#58d5ff;
    font-weight:bold;
}

.btn-red{
    background:#d62f2f;
    color:white;
}

.btn-white{
    background:#d9d9d9;
    color:black;
}

.btn-blue{
    background:#2493ff;
    color:white;
}

.btn-green{
    background:#1fa54a;
    color:white;
}

.btn-orange{
    background:#ff8c00;
    color:white;
}

.btn-dark{
    background:#444;
    color:white;
}

.history-controls{
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

button:disabled{
    cursor:not-allowed;
    opacity:0.45;
    transform:none;
}

.click-feedback{
    animation:click-feedback-pulse 1s ease-out;
}

@keyframes click-feedback-pulse{
    0%{
        box-shadow:0 0 0 0 rgba(88, 213, 255, 0.95);
        outline:3px solid rgba(88, 213, 255, 0.95);
        outline-offset:2px;
    }
    100%{
        box-shadow:0 0 0 18px rgba(88, 213, 255, 0);
        outline:3px solid rgba(88, 213, 255, 0);
        outline-offset:8px;
    }
}

.reset-all-button{
    grid-column:1 / -1;
    align-self:end;
    margin-top:auto;
}

.score-controls{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-bottom:8px;
}

.penalty-group{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-bottom:0;
}

.penalty-group h4{
    flex:0 0 100%;
    margin-bottom:0;
}

/* =========================
   DISPLAY AREA
==========================*/

.display{
    display:flex;
    flex-direction:column;
    height:100vh;
}

.operator-layout .display{
    height:100vh;
    border-left:1px solid #2f3548;
}

.operator-layout .fighter{
    padding:28px 36px;
}

.operator-layout .flag{
    font-size:40px;
}

.operator-layout .fighter-left{
    gap:14px;
}

.operator-layout .fighter-info h1{
    font-size:28px;
    margin-bottom:4px;
}

.operator-layout .fighter-info h2{
    font-size:16px;
}

.operator-layout .fighter-right{
    gap:40px;
}

.operator-layout .score-box .label{
    font-size:18px;
    margin-bottom:6px;
}

.operator-layout .score-box .value{
    font-size:112px;
}

.operator-layout .penalties{
    gap:6px;
}

.operator-layout .penalty-header{
    gap:8px;
    min-height:60px;
}

.operator-layout .penalty-columns{
    grid-template-columns:repeat(4, 30px);
    gap:10px;
}

.operator-layout .penalty-columns span{
    justify-content:center;
    width:30px;
    height:62px;
    font-size:12px;
}

.operator-layout .penalty-label{
    width:86px;
    font-size:18px;
}

.operator-layout .dots{
    gap:10px;
}

.operator-layout .dot{
    width:30px;
    height:30px;
}

.operator-layout .match-info{
    height:130px;
}

.operator-layout .info-label{
    font-size:14px;
    margin-bottom:6px;
}

.operator-layout .info-value{
    font-size:22px;
}

.operator-layout .timer{
    font-size:54px;
}

.operator-layout .inline-info-input{
    min-height:44px;
    width:min(280px, 100%);
    font-size:22px;
}

.fighter{
    flex:1;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:30px 50px;
    border-bottom:2px solid #2f3548;
}

.aka{
    background:linear-gradient(90deg,#aa1010,#1c1111);
}

.shiro{
    background:linear-gradient(90deg,#30343f,#1c1f26);
}

.fighter-left{
    display:flex;
    align-items:center;
    gap:25px;
}

.flag{
    font-size:70px;
}

.fighter-info h1{
    font-size:52px;
    margin-bottom:10px;
}

.fighter-info h2{
    font-size:28px;
    color:#a0a8b8;
}

.fighter-right{
    display:flex;
    gap:60px;
    align-items:center;
}

.score-box{
    text-align:center;
}

.score-stepper{
    display:flex;
    justify-content:center;
    gap:6px;
    margin-top:8px;
}

.score-step-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:58px;
    height:50px;
    padding:0;
    font-size:28px;
    line-height:1;
}

.score-box .label{
    font-size:24px;
    color:#aab3c5;
    margin-bottom:10px;
}

.score-box .value{
    font-size:180px;
    font-weight:normal;
}

.penalties{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.penalty-header{
    display:flex;
    align-items:flex-end;
    gap:10px;
    min-height:70px;
}

.penalty-columns{
    display:grid;
    grid-template-columns:repeat(3, 22px);
    gap:8px;
    align-items:end;
}

.penalty-columns span{
    display:flex;
    align-items:center;
    justify-content:left;
    width:22px;
    height:64px;
    color:#aab3c5;
    font-size:12px;
    font-weight:bold;
    transform:rotate(-90deg);
    white-space:nowrap;
}

.penalty-row{
    display:flex;
    align-items:center;
    gap:10px;
}

.penalty-label{
    width:90px;
    font-size:20px;
}

.dots{
    display:flex;
    gap:8px;
}

.dot{
    width:22px;
    height:22px;
    border-radius:50%;
    background:#333;
    border:2px solid #666;
}

.clear-dot{
    background:transparent;
}

.clickable-dot{
    cursor:pointer;
}

.clickable-dot:hover{
    transform:scale(1.12);
}

.dot.active{
    background:#ffb400;
    border-color:#ffcc00;
    box-shadow:0 0 10px #ffcc00;
}

/* =========================
   BOTTOM SECTION
==========================*/

.match-info{
    height:240px;
    background:#111827;
    display:flex;
    justify-content:space-around;
    align-items:center;
    border-top:3px solid #2d3648;
    text-transform: uppercase
}

.info-block{
    text-align:center;
}

.info-label{
    font-size:22px;
    color:#8d99ae;
    margin-bottom:10px;
}

.info-value{
    font-size:42px;
    font-weight:bold;
}

.inline-info-input{
    width:min(240px, 100%);
    margin:0;
    padding:6px 8px;
    border:1px solid rgba(255, 255, 255, 0.24);
    border-radius:6px;
    background:rgba(7, 10, 16, 0.46);
    color:white;
    text-align:center;
    text-transform:none;
}

.inline-info-input:focus{
    border-color:#58d5ff;
    outline:2px solid rgba(88, 213, 255, 0.28);
}

.timer{
    font-size:96px;
    color:#58d5ff;
    text-shadow:0 0 20px #58d5ff;
}

@media (max-width: 900px){
    body{
        overflow-x:hidden;
        overflow-y:auto;
    }

    .display{
        min-height:100svh;
        height:auto;
    }

    .fighter{
        min-width:0;
        padding:22px;
        gap:20px;
    }

    .fighter-left,
    .fighter-right{
        min-width:0;
    }

    .fighter-right{
        gap:24px;
    }

    .flag{
        flex:0 0 auto;
        font-size:clamp(38px, 8vw, 58px);
    }

    .fighter-info{
        min-width:0;
    }

    .fighter-info h1{
        overflow-wrap:anywhere;
        font-size:clamp(28px, 7vw, 44px);
    }

    .fighter-info h2{
        overflow-wrap:anywhere;
        font-size:clamp(16px, 4vw, 24px);
    }

    .score-box .label{
        font-size:clamp(13px, 3vw, 18px);
    }

    .score-box .value{
        font-size:clamp(72px, 16vw, 128px);
        line-height:0.9;
    }

    .penalty-label{
        width:72px;
        font-size:16px;
    }

    .dot{
        width:18px;
        height:18px;
    }

    .match-info{
        height:auto;
        min-height:150px;
        padding:18px 12px;
        gap:14px;
        flex-wrap:wrap;
    }

    .info-block{
        min-width:140px;
    }

    .info-label{
        font-size:16px;
    }

    .info-value{
        overflow-wrap:anywhere;
        font-size:clamp(22px, 5vw, 34px);
    }

    .timer{
        font-size:clamp(48px, 10vw, 76px);
    }
}

@media (max-width: 600px){
    .display{
        min-height:100svh;
    }

    .fighter{
        flex-direction:column;
        align-items:stretch;
        justify-content:center;
        padding:16px 12px;
    }

    .fighter-left{
        justify-content:center;
        gap:12px;
    }

    .fighter-right{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:14px;
        width:100%;
    }

    .score-box{
        min-width:0;
    }

    .penalties{
        grid-column:1 / -1;
        align-items:center;
        gap:6px;
    }

    .penalty-row{
        width:min(100%, 260px);
        justify-content:space-between;
    }

    .penalty-label{
        width:auto;
        min-width:58px;
        font-size:14px;
    }

    .dots{
        gap:5px;
    }

    .dot{
        width:15px;
        height:15px;
    }

    .match-info{
        display:grid;
        grid-template-columns:1fr 1fr;
        align-items:center;
        padding:12px;
    }

    .info-block{
        min-width:0;
    }

    .info-block:nth-child(2){
        grid-column:1 / -1;
        grid-row:1;
    }

    .info-label{
        font-size:12px;
        margin-bottom:4px;
    }

    .info-value{
        font-size:18px;
    }
}

@media (max-width: 380px){
    .fighter{
        padding:12px 8px;
    }

    .fighter-left{
        gap:8px;
    }

    .score-box .value{
        font-size:58px;
    }

    .match-info{
        grid-template-columns:1fr;
    }
}
