:root{
  --bg1:#0b1020;
  --bg2:#1b0f3a;
  --fg:#f2f6ff;
  --muted: rgba(242,246,255,.75);
  --bd: rgba(255,255,255,.14);
  --panel: rgba(255,255,255,.06);
  --accent: rgba(255,210,120,1);
  --ok: rgba(80,220,160,.35);
  --bad: rgba(255,120,120,.35);
  --r: 16px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; margin:0; }
body{
  background: radial-gradient(1200px 800px at 30% 10%, var(--bg2), var(--bg1));
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#app{
  height:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:10px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--bd);
  border-radius: var(--r);
  background: var(--panel);
}

.titre{ font-weight:800; letter-spacing:.2px; font-size:18px; }
.sousTitre{ color: var(--muted); font-size:13px; margin-top:2px; }

.right{
  display:flex;
  gap:12px;
  align-items:center;
}

.hud{
  min-width: 220px;
  padding:10px 12px;
  border:1px solid var(--bd);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
}
.hudLine{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:14px;
}
.label{ color: var(--muted); }
.value{ font-weight:800; }

.actions{ display:flex; gap:8px; }
button{
  appearance:none;
  border:1px solid var(--bd);
  background: rgba(0,0,0,.25);
  color: var(--fg);
  padding:10px 12px;
  border-radius: 12px;
  font-weight:800;
  cursor:pointer;
}
button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.scene{
  position:relative;
  flex:1;
  border:1px solid var(--bd);
  border-radius: var(--r);
  background: rgba(0,0,0,.18);
  overflow:hidden;
}

#game{
  width:100%;
  height:100%;
  display:block;
}

.status{
  position:absolute;
  left:12px;
  bottom:12px;
  padding:8px 10px;
  border-radius: 12px;
  border:1px solid var(--bd);
  background: rgba(0,0,0,.30);
  color: var(--muted);
  font-size:13px;
}

.overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.55);
  z-index: 5;
  padding:20px;
  text-align:center;
}
.overlay.hidden{ display:none; }
.overlayTitle{
  font-size:28px;
  font-weight:900;
  margin-bottom:10px;
}
.overlayText{
  color: var(--muted);
  font-size:15px;
  max-width: 720px;
}

.pianoWrap{
  border:1px solid var(--bd);
  border-radius: var(--r);
  background: var(--panel);
  padding:10px 12px 12px;
}

.pianoTitle{
  font-size:13px;
  color: var(--muted);
  margin-bottom:8px;
}

.piano{
  position:relative;
  height:140px;
  user-select:none;
  touch-action: manipulation;
  border-radius: 14px;
  border:1px solid var(--bd);
  background: rgba(0,0,0,.18);
  overflow:hidden;
}

.keyWhite{
  position:absolute;
  top:0; bottom:0;
  border-right:1px solid rgba(0,0,0,.35);
  background: linear-gradient(#fff, #dfe6ff);
  color:#101425;
  border-radius: 0 0 10px 10px;
}

.keyBlack{
  position:absolute;
  top:0;
  height: 86px;
  background: linear-gradient(#2a2a2a, #0b0b0b);
  border:1px solid rgba(255,255,255,.12);
  border-top:none;
  border-radius: 0 0 10px 10px;
  z-index: 2;
}

.keyLabel{
  position:absolute;
  bottom:8px;
  left:0; right:0;
  text-align:center;
  font-size:12px;
  font-weight:900;
  opacity:.85;
  pointer-events:none;
}
.keyBlack .keyLabel{
  color:#f2f6ff;
  opacity:.9;
}

.keyActive{
  outline: 3px solid rgba(255,210,120,.65);
  outline-offset: -3px;
}

@media (max-width: 900px){
  .right{ flex-direction:column; align-items:flex-end; }
  .hud{ min-width: 200px; }
}
