*{
    box-sizing:border-box;
    -webkit-tap-highlight-color:transparent;
}

html,
body{
    margin:0;
    width:100%;
    height:100%;
    background:#050505;
    font-family:Arial, Helvetica, sans-serif;
    color:white;
    text-align:center;
    overflow:hidden;
}

.remote-body{
    width:100%;
    height:100dvh;
    overflow:hidden;
}

.remote-page{
    width:100%;
    height:100dvh;
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:4px;
    overflow:hidden;
}

.player-header{
    width:94vw;
    max-width:430px;
    height:20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:12px;
    opacity:.8;
    flex:0 0 auto;
}

#gameStatus{
    width:94vw;
    max-width:430px;
    height:28px;
    line-height:28px;
    padding:0 8px;
    font-size:16px;
    font-weight:bold;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    flex:0 0 auto;
}

#display{
    width:90vw;
    max-width:400px;
    height:38px;
    line-height:38px;
    margin:2px auto;
    background:#111;
    color:#00ff66;
    border:2px solid #333;
    border-radius:10px;
    font-size:23px;
    font-weight:bold;
    letter-spacing:3px;
    flex:0 0 auto;
}

#responseMessage{
    width:90vw;
    max-width:400px;
    height:24px;
    line-height:24px;
    font-size:15px;
    font-weight:bold;
    color:#00ff66;
    overflow:hidden;
    flex:0 0 auto;
}

.remote{
    width:min(92vw,430px);
    flex:1;
    min-height:0;
    margin:3px auto 0;
    padding:10px;
    border-radius:26px;
    background:linear-gradient(180deg,#3a3a3a,#181818);
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,.15),
        inset 0 -6px 12px rgba(0,0,0,.7),
        0 8px 22px rgba(0,0,0,.8);
    display:flex;
    flex-direction:column;
    gap:10px;
}

.abcd{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    flex:0 0 auto;
}

.numbers{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    grid-template-rows:repeat(4,1fr);
    gap:7px;
    flex:1;
    min-height:0;
}

.btn{
    border:none;
    cursor:pointer;
    font-weight:bold;
    user-select:none;
    box-shadow:
        inset 0 2px 2px rgba(255,255,255,.22),
        inset 0 -5px 8px rgba(0,0,0,.55),
        0 4px 6px rgba(0,0,0,.45);
}

.btn:active{
    transform:translateY(3px);
    box-shadow:
        inset 0 4px 9px rgba(0,0,0,.8);
}

.color-btn{
    height:min(11dvh,88px);
    min-height:48px;
    border-radius:999px;
    font-size:clamp(28px, 8vw, 52px);
    color:white;
    border:5px solid #111;
}

.green{
    background:radial-gradient(circle at 35% 25%,#65ff7f,#00a651 65%,#006b33);
}

.red{
    background:radial-gradient(circle at 35% 25%,#ff7a7a,#d71920 65%,#8a0000);
}

.yellow{
    background:radial-gradient(circle at 35% 25%,#fff47a,#ffd200 65%,#b98d00);
    color:#111;
}

.blue{
    background:radial-gradient(circle at 35% 25%,#75aaff,#0066ff 65%,#00388f);
}

.num{
    width:100%;
    height:100%;
    min-height:0;
    border-radius:12px;
    font-size:clamp(26px, 7.5vw, 44px);
    background:linear-gradient(180deg,#303030,#101010);
    color:white;
    border:2px solid #050505;
}

.action-delete{
    background:linear-gradient(180deg,#5a1b1b,#240808);
    color:#ffb0b0;
}

.action-ok{
    background:linear-gradient(180deg,#1b5a2a,#08240f);
    color:#b7ffcb;
    font-size:clamp(20px, 6vw, 34px);
}

.btn.disabled,
.btn:disabled{
    opacity:.35;
    filter:grayscale(1);
    cursor:not-allowed;
    transform:none !important;
}

.login-box{
    width:90%;
    max-width:380px;
    margin:100px auto;
    background:#1b1b1b;
    padding:25px;
    border-radius:20px;
}

.login-box h1{
    margin-top:0;
}

.login-box input,
.login-box button{
    width:100%;
    padding:14px;
    margin:8px 0;
    font-size:18px;
    border-radius:10px;
    border:none;
}

.login-box button{
    background:#00a651;
    color:white;
    font-weight:bold;
}

.error-box{
    background:#4a0000;
    color:white;
    padding:12px;
    border-radius:10px;
    margin-bottom:15px;
    font-weight:bold;
}

.session-code-box{
    background:#222;
    color:white;
    padding:15px;
    border-radius:10px;
    margin-bottom:15px;
    font-size:20px;
}

@media (max-height:680px){

    .player-header{
        height:17px;
        font-size:11px;
    }

    #gameStatus{
        height:24px;
        line-height:24px;
        font-size:14px;
    }

    #display{
        height:32px;
        line-height:32px;
        font-size:20px;
    }

    #responseMessage{
        height:20px;
        line-height:20px;
        font-size:13px;
    }

    .remote{
        padding:8px;
        gap:8px;
        border-radius:22px;
    }

    .abcd{
        gap:8px;
    }

    .numbers{
        gap:6px;
    }

    .color-btn{
        height:min(10dvh,70px);
        min-height:42px;
        font-size:clamp(24px, 7vw, 40px);
        border-width:4px;
    }

    .num{
        font-size:clamp(23px, 7vw, 36px);
        border-radius:10px;
    }

    .action-ok{
        font-size:clamp(18px, 5vw, 28px);
    }
}

@media (max-height:580px){

    .player-header{
        display:none;
    }

    #gameStatus{
        height:22px;
        line-height:22px;
        font-size:13px;
    }

    #display{
        height:28px;
        line-height:28px;
        font-size:18px;
        margin:1px auto;
    }

    #responseMessage{
        height:18px;
        line-height:18px;
        font-size:12px;
    }

    .remote{
        padding:7px;
        gap:6px;
        border-radius:18px;
    }

    .abcd{
        gap:6px;
    }

    .numbers{
        gap:5px;
    }

    .color-btn{
        height:42px;
        min-height:38px;
        font-size:28px;
        border-width:3px;
    }

    .num{
        font-size:25px;
        border-radius:8px;
    }

    .action-ok{
        font-size:20px;
    }
}
