body{
font-family:system-ui,-apple-system,Segoe UI,Roboto;
margin:0;
background:#1c1f26;
color:white;
text-align:center;
min-height:100dvh;
}

html,
body{
width:100%;
height:100%;
overflow-x:hidden;
}

body.light{
background:#eef1f6;
color:#111;
}

body.light .game-header{

background:rgba(255,255,255,0.75);
border-bottom:1px solid rgba(0,0,0,0.06);
}

body.light th,
body.light td{
background:#ffffff;
color:#111;
}

body.light .player-name{
background:#e5e9f0;
}

body.light .overlay-content{
background:#ffffff;
}

body.light .modal-content{
background:#ffffff;
color:#111;
}

body.light input{
background:#ffffff;
color:#111;
}

body.light .player-card{
background:#ffffff;
}

body.light .titel{
background:none;
-webkit-text-fill-color:#111;

text-shadow:
0 0 6px rgba(255,0,0,0.5),
0 0 8px rgba(255,0,0,0.35),
0 0 14px rgba(255,0,0,0.2);

}

body.light .prediction{
border-bottom:1px solid #cfd4dc;
}

body.light .start-lobby-btn{
color:#333;
border-color:#22c55e;
}

.titel{

font-size:26px;
font-weight:700;
letter-spacing:1.5px;

background:linear-gradient(
90deg,
#ffd700 0%,
#fff6b0 45%,
#ffd700 100%
);

-webkit-background-clip:text;
-webkit-text-fill-color:transparent;

text-shadow:
0 0 6px rgba(255,215,0,0.35),
0 0 12px rgba(255,215,0,0.15);

}

h2{
margin-top:10px;
font-weight:500;
}

button{
padding:12px 20px;
margin:8px;
font-size:16px;
border:none;
border-radius:10px;
cursor:pointer;
background:#2c7ef7;
color:white;
transition:0.2s;

touch-action: manipulation;
}

button:hover{
opacity:0.9;
}

#stop-game{

background:none;
border:2.5px solid #444;
color:#ff5a5a;
padding:8px 14px;
font-size:16px;
border-radius:10px;
opacity:0.9;
}

#stop-game:hover{
background:#e13b3b;
}

input{
display:block;
width:80%;
margin:10px auto;
padding:12px;
font-size:16px;
border-radius:8px;
border:none;
background:#2b2f38;
color:white;
}

.hidden{
display:none;
}

/* TABLE */

#table-container{
overflow-x:auto;
padding-bottom:20px;
margin-top:25px;
}

table{
border-collapse:separate;
border-spacing:4px;
margin:auto;
}

th{
background:#2b2f38;
padding:10px;
border-radius:8px;
font-weight:500;
}

td{
background:#2b2f38;
min-width:90px;
height:80px;
border-radius:8px;
position:relative;
}

.player-name{
position:sticky;
left:0;
background:#181b21;
font-weight:600;
z-index:5;
min-width:110px;
}

.dealer{
font-weight:600;
}

.prediction{
position:absolute;
top:0;
left:0;
width:100%;
height:40%;
display:flex;
align-items:center;
justify-content:center;
font-size:14px;
opacity:0.8;
border-bottom:1px solid rgba(255,255,255,0.15);
}

.score{
position:absolute;
bottom:0;
left:0;
width:100%;
height:60%;
display:flex;
align-items:center;
justify-content:center;
font-size:24px;
font-weight:bold;
}

.green{
color:#4dff88;
}

.red{
color:#ff5a5a;
}

/* OVERLAY */

.overlay{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.5);
display:flex;
align-items:center;
justify-content:center;
z-index:200;
}

.overlay.hidden{
display:none;
}

.overlay button{
font-size:24px;
margin:10px;
width:70px;
height:70px;
border-radius:12px;
}

.overlay-content{
background:#1f222a;
padding:20px;
border-radius:16px;
box-shadow:0 10px 30px rgba(0,0,0,0.6);
}

/* PREDICTION BUTTONS */

.prediction-btn{
width:55px;
height:55px;
font-size:20px;
border-radius:12px;
background:#2c7ef7;
border:none;
color:white;
}

#prediction-content,
#result-content{
display:grid;
grid-template-columns:repeat(4,1fr);
gap:10px;
justify-items:center;

max-height:60vh;
overflow-y:auto;
padding:10px;
}

@media (max-height:700px){
#prediction-content{
grid-template-columns:repeat(5,1fr);
}
}

/* SCORE ANIMATION */

.score-animation{
position:absolute;
left:50%;
top:80%;
transform:translate(-50%,-50%);
font-size:24px;
font-weight:bold;
animation:scoreAnim 3.5s forwards;
pointer-events:none;
}

@keyframes scoreAnim{

0%{
opacity:1;
transform:translate(-50%,-50%) scale(1);
}

50%{
transform:translate(-50%,-70px) scale(1.3);
}

100%{
opacity:0;
transform:translate(-50%,-120px);
}

}

/* PODIUM */

#podium-screen{
margin-top:30px;
margin-bottom:20px;
padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
opacity:0;
transform:translateY(-20px);
transition:0.5s ease;
}

#podium-screen.show{
opacity:1;
transform:translateY(0);
}

#podium div{
background:none;
padding:6px;
margin:10px auto;
width:260px;
font-size:20px;
font-weight:600;
color:#f5f2f2;
}

/* LOCUL 1 */
#podium div:nth-child(1){
color:#ffd700;
text-shadow:
0 0 8px rgba(255,215,0,0.8),
0 0 18px rgba(255,215,0,0.6);
}

/* LOCUL 2 */
#podium div:nth-child(2){
color:#c0c0c0;
text-shadow:
0 0 6px rgba(192,192,192,0.8),
0 0 14px rgba(192,192,192,0.5);
}

/* LOCUL 3 */
#podium div:nth-child(3){
color:#cd7f32;
text-shadow:
0 0 6px rgba(205,127,50,0.8),
0 0 14px rgba(205,127,50,0.5);
}

/* RESTUL */
#podium div:nth-child(n+4){
color:#f5f2f2;
text-shadow:none;
opacity:0.9;
}

.game-locked{
pointer-events:none;
opacity:0.7;
}

/* START SCREEN */

.start-container{
max-width:420px;
margin:auto;
padding:20px;
}

.players-list{
display:flex;
flex-direction:column;
gap:12px;
margin-bottom:20px;
}

.player-card{
display:flex;
width:100%;
align-items:center;
background:#2b2f38;
border-radius:12px;
padding:6px;
box-shadow:0 4px 10px rgba(0,0,0,0.4);
}

.player-card input{
flex:1;
border:none;
background:transparent;
color:white;
font-size:16px;
padding:10px;
}

.player-card input:focus{
outline:none;
}

.remove-player{
background:#ff5a5a;
border:none;
color:white;
font-size:16px;
width:36px;
height:36px;
border-radius:8px;
cursor:pointer;

display: flex;
align-items: center;
justify-content: center;
}

.add-player-btn{
width:99%;
background:#3b82f6;
color:white;
}

.start-btn{
width:99%;
background:#22c55e;
font-size:18px;
}

.plusminus-wrapper{
display:flex;
align-items:center;
gap:2px;
}

.plusminus-label{
font-size:16px; /* mai mare */
color:#a0aec0;
}

.info-btn{
background:darkgrey;
border:none;
cursor:pointer;
display:flex;
align-items:center;
justify-content:center;
width:26px;
height:26px;
opacity:0.8;
}

.info-btn:hover{
opacity:1;
}

.info-btn img{
width:22px;
height:22px;
}

#info-popup .modal-buttons {
    justify-content: center;
}

#info-popup .modal-buttons button {
    flex: none;
    min-width: 80px;
    padding: 8px 20px;
}

/* HEADER */

.game-header{

position:sticky;
top:0;
z-index:100;

padding:
calc(env(safe-area-inset-top) + 12px)
14px
12px
14px;

background:rgba(17,19,24,0.75);

backdrop-filter:blur(12px);
-webkit-backdrop-filter:blur(12px);

border-bottom:1px solid rgba(255,255,255,0.06);

}

.game-title{
display:flex;
align-items:center;
justify-content:center;
gap:8px;
min-height:44px;
}

.title-card{
height:60px;
border-radius:8px;
}

.left-card{
height:75px;
margin-top:-10px;
margin-bottom:-10px;
}

.right-card{
transform:rotate(8deg);
height:70px;
margin-top:-5px;
margin-bottom:-5px;
}

/* ROUND HEADER */

.round-header{
position:relative;
width:60px;
height:60px;
padding:0;
overflow:hidden;
}

.round-header img{
position:absolute;
top:0;
left:0;
width:100%;
height:115%;
border-radius:8px;
opacity:0.8;
}

.round-number{
position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
z-index:2;

font-size:24px;
font-weight:bold;
color:red;

text-shadow:
0 0 2px black,
0 0 3px black,
-3px 0 3px black;
}

/* CONTROLS */

.game-controls{
display:flex;
justify-content:flex-start;
margin-top:20px;
margin-bottom:25px;
padding-left:10px;
}

.active-round{
box-shadow:0 0 0 1.2px #ffd700 inset;
background:#353a45;
}

.active-top{
background: rgba(255,215,0,0.18);
box-shadow: inset 0 0 0 1px rgba(255,215,0,0.35);
}

.active-bottom{
background: rgba(255,215,0,0.18);
box-shadow: inset 0 0 0 1px rgba(255,215,0,0.35);
}

#toast{
position:fixed;
top:55%;
left:50%;
transform:translate(-50%,-50%);
background:#2b2f38;
color:yellow;
padding:14px 20px;
border-radius:10px;
font-size:15px;
opacity:0;
pointer-events:none;
transition:opacity 0.3s, transform 0.3s;
box-shadow:0 8px 25px rgba(0,0,0,0.6);
z-index:500;
}

#toast.show{
opacity:1;
transform:translate(-50%,-55%);
}

.modal{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.6);
display:none;
align-items:center;
justify-content:center;
z-index:600;
}

.modal.show{
display:flex;
}

.modal-content{
background:#1f222a;
padding:25px;
border-radius:14px;
text-align:center;
width:260px;
box-shadow:0 10px 40px rgba(0,0,0,0.7);
}

.modal-buttons{
display:flex;
justify-content:space-between;
margin-top:20px;
}

.modal-buttons button{
flex:1;
margin:0 5px;
}

#confirm-stop{
background:#ff4d4d;
}

/* STARTER ARROW */

.play-arrow{
display:inline-block;
margin-right:6px;
color:#4dff88;
font-size:16px;
animation:playPulse 0.8s ease-in-out 4;
}

/* STARTER PLAYER */

.starter{
color:#4dff88;
font-weight:700;
}

/* ARROW ANIMATION */

@keyframes playPulse{

0%{
transform:scale(1);
opacity:1;
}

50%{
transform:scale(1.35);
opacity:0.6;
}

100%{
transform:scale(1);
opacity:1;
}

}

.lobby-btn{
background:none;
border:none;
display:flex;
align-items:center;
justify-content:center;
width:40px;
height:40px;
cursor:pointer;
opacity:0.85;
transition:0.15s;
}

.lobby-btn img{
width:45px;
height:45px;
}

.lobby-btn:hover{
opacity:1;
}

.lobby-btn:active{
transform:scale(0.92);
}

.undo-btn{
background:none;
border:none;
display:flex;
align-items:center;
justify-content:center;
width:40px;
height:40px;
cursor:pointer;
opacity:0.85;
transition:0.15s;
}

.undo-btn img{
width:38px;
height:38px;
}

.undo-blink{
animation: undoBlink 0.3s ease 2;
}

@keyframes undoBlink{
0%{ opacity:1; transform:scale(1); }
50%{ opacity:0.2; transform:scale(1.2); }
100%{ opacity:1; transform:scale(1); }
}

.start-lobby-btn{
justify-content:left;
width:100%;
color:grey;
background:none;
font-size:18px;
padding:14px 40px 14px 14px;
margin-top:10px;
margin-bottom:15px;
margin-left:-15px;
gap: 10px;
}

.start-lobby-btn:hover{
text-shadow: 0 0 20px white;
}

.start-lobby-btn img{
width:40px;
height:40px;
}

/* keep awake control */
.awake-control-wrapper {
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 12px;
    margin: 5px 0;
    padding: 10px;
    background: none;
    border-radius: 12px;
}

.awake-label {
    font-size: 14px;
    color: #a0aec0;
}

/* Switch Styling */
.awake-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.awake-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #4a5568;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2c7ef7; /* Albastru solicitat */
}

input:checked + .slider:before {
    transform: translateX(22px);
}

#animation-layer{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
pointer-events:none;
z-index:999;
}

/* PAGE TRANSITIONS */

body{
opacity:0;
transform:scale(0.98);
transition:
opacity 0.35s ease,
transform 0.35s ease;
}

body.page-enter{
opacity:1;
transform:scale(1);
}

body.page-exit{
opacity:0;
transform:scale(0.98);
pointer-events:none;
}