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:60px;
height:60px;
font-size:22px;
border-radius:12px;
background:#2c7ef7;
border:none;
color:white;
}

#prediction-content{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:10px;
justify-items:center;
}

/* SCORE ANIMATION */

.score-animation{
position:absolute;
left:50%;
top:80%;
transform:translate(-50%,-50%);
font-size:24px;
font-weight:bold;
animation:scoreAnim 2.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{
margin-top:20px;
font-size:20px;
}

#podium div{
background:#2b2f38;
padding:12px;
margin:8px auto;
border-radius:10px;
width:70%;
}

#podium div:nth-child(1){
background:#ffd700;
color:black;
font-weight:bold;
}

#podium div:nth-child(2){
background:#c0c0c0;
color:black;
}

#podium div:nth-child(3){
background:#cd7f32;
color:black;
}

.podium-top{
font-size:22px;
margin:12px 0;
font-weight:600;
}

.podium-rest{
font-size:20px;
margin:4px 0;
opacity:0.85;
}

/* 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;
}

/* 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:10px;
min-height:44px;
}

.title-card{
height:60px;
border-radius:8px;
box-shadow:
0 6px 16px rgba(0,0,0,0.6);
}

.left-card{
transform:rotate(-8deg);
}

.right-card{
transform:rotate(8deg);
}

/* ROUND HEADER */

.round-header{
width:36px;
height:36px;
font-size:14px;
}

.round-number{
font-size:14px;
font-weight:bold;
}

/* 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;
}

#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;
}

#flip-container{
perspective:1200px;
}

#flip-inner{
transition:transform 1.2s;
transform-style:preserve-3d;
position:relative;
}

#flip-inner.flip{
transform:rotateY(180deg) scale(0.98);
}

#game-screen,
#podium-screen{
backface-visibility:hidden;
-webkit-backface-visibility:hidden;
}

#game-screen{
transform:rotateY(0deg);
}

#podium-screen{
position:absolute;
top:0;
left:0;
width:100%;
transform:rotateY(180deg);
}

/* 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);
}

.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);
}

/* 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;
}