:root{
  --primary:#2563eb;
  --danger:#dc2626;
  --timer:#ffffff;
  --bg:#0b1220;
  --card:#111827cc;
  --text:#e5e7eb;
}

*{ box-sizing:border-box; font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial; }
body{ margin:0; background:var(--bg); color:var(--text); }

.page{ padding:16px; }
.topbar{ display:flex; justify-content:space-between; align-items:center; padding:12px 16px; }
.brand{ display:flex; gap:12px; align-items:center; }
.logo{ height:60px; }
.logo-floating{ position:absolute; left:16px; top:16px; height:80px; opacity:.95; }

.card{
  max-width:900px; margin:16px auto; padding:16px;
  background:var(--card); border:1px solid #334155; border-radius:14px;
}

.grid2{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; }
label{ display:flex; flex-direction:column; gap:6px; font-size:14px; }
input, select{ padding:10px; border-radius:10px; border:1px solid #334155; background:#0b1220; color:var(--text); }

.gridPlayers{ display:grid; gap:10px; margin-top:10px; }
.playerRow{ display:grid; grid-template-columns: 120px 1fr 160px; gap:10px; align-items:center; }
.playerRowTitle{ font-weight:800; opacity:.9; }

.btn{
  padding:12px 14px; border-radius:12px; border:0; cursor:pointer; font-weight:800;
  color:white; margin-top:12px;
}
.btn.primary{ background:var(--primary); }
.btn.danger{ background:var(--danger); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }

.link{ color:#93c5fd; text-decoration:none; font-size:14px; margin-left:10px; }
.hint{ opacity:.75; font-size:13px; }

.game{ height:100vh; overflow:hidden; }
.board{
  position:relative; width:100%; height:100%;
  background: radial-gradient(circle at center, #1f2937 0%, #0b1220 70%);
  background-size:cover; background-position:center;
}

.center{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,-50%);
  background:#0b1220cc; border:1px solid #334155;
  padding:14px; border-radius:16px; text-align:center;
  min-width:220px;
}
.tableName{ font-weight:900; margin-bottom:10px; }

/* Player card (slightly smaller than V1) */
.player{
  position:absolute;
  transform:translate(-50%,-50%);
  width:160px; padding:9px;
  background:#0b1220cc; border:1px solid #334155;
  border-radius:14px; text-align:center;
  touch-action:none;
}
.player .header{ display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:6px; }
.player .dot{ width:12px; height:12px; border-radius:50%; border:1px solid #0b1220; box-shadow:0 0 0 2px #334155; }
.player .name{ font-weight:900; }
.player .time{ font-size:30px; font-weight:900; color:var(--timer); letter-spacing:1px; }
.player .malus{ margin-top:8px; font-weight:900; opacity:.95; color:#dc2626 }
.player.ready{ outline:3px solid #22c55e; }
.player button.btn{ padding:10px 12px; margin-top:10px; }

.overlay{
  position:absolute; inset:0;
  background:#000000aa; display:flex; align-items:center; justify-content:center;
  padding:16px;
}
.hidden{ display:none; }
.overlay .panel{
  background:#0b1220; border:1px solid #334155; border-radius:16px;
  padding:16px; max-width:520px; width:100%;
}

.flash{ padding:10px; border-radius:12px; background:#064e3bcc; border:1px solid #10b981; margin-bottom:12px; }

@keyframes malusFlash {
  0%   { box-shadow: 0 0 0 0 rgba(220,38,38,0.9); }
  50%  { box-shadow: 0 0 0 6px rgba(220,38,38,0.9); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

.player.malus-hit {
  animation: malusFlash 0.6s ease-out;
}

.player .time.low-time {
  color: #f97316;     /* arancione */
}

.player .time.critical-time {
  color: #dc2626;     /* rosso */
}