:root{
  --bg:#0f1220;
  --card:#171b2e;
  --card2:#12162a;
  --text:#e9ecff;
  --muted:#aab0da;
  --ok:#39d98a;
  --bad:#ff5c7a;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 20% 10%, #1e2560 0%, var(--bg) 60%);
  color:var(--text);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.app{
  width:min(980px, 100%);
}

.topbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:center;
  margin-bottom:12px;
}

.topbar button{
  width:44px;height:44px;
  border:0;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:var(--text);
  cursor:pointer;
  box-shadow: var(--shadow);
}
.topbar button:active{transform:scale(.98)}
#progress{
  flex:1;
  text-align:center;
  color:var(--muted);
  font-weight:600;
}

h1{
  margin:8px 0 16px;
  text-align:center;
  letter-spacing:.2px;
}

.board{
  display:flex;
  flex-direction: column;
  gap:16px;
}

.zone{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}

.zone h2{
  margin:0 0 12px;
  font-size:14px;
  letter-spacing:.3px;
  text-transform:uppercase;
  color:var(--muted);
}

.slots{
  display:flex;
  flex-wrap:nowrap;
  gap:10px;
  padding:12px;
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  overflow-x:auto;   /* scroll horizontal si phrase longue */
  white-space:nowrap;
}

.slot{
  position:relative;
  min-width: 90px;
  padding:10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border:1px dashed rgba(255,255,255,.18);
  color: transparent;
  user-select:none;
  flex: 0 0 auto;
}

.slot::after{
  content: attr(data-hint);
  color: rgba(233,236,255,.20);
  font-weight:700;
  letter-spacing:.2px;
}

.slot.filled{
  border-style: solid;
}

.bank{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:12px;
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  min-height:74px;
}

.word{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);
  cursor:grab;
  user-select:none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.word:active{ cursor:grabbing; transform:scale(.98); }
.word.dragging{ opacity:.6; transform:scale(.98); }

.bank.dragover, .slots.dragover{
  outline:2px solid rgba(233,236,255,.18);
  outline-offset: 4px;
}

.status{
  margin-top:12px;
  min-height:22px;
  color: var(--muted);
  font-weight:600;
}

.actions{
  display:flex;
  gap:10px;
  justify-content:center;
  margin-top:16px;
}

.actions button{
  border:0;
  padding:12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor:pointer;
  box-shadow: var(--shadow);
}
.actions button:active{transform:scale(.99)}

@keyframes popOk {
  0%{ transform: scale(1); box-shadow: 0 0 0 rgba(57,217,138,0); }
  40%{ transform: scale(1.06); box-shadow: 0 0 0 10px rgba(57,217,138,.14); }
  100%{ transform: scale(1); box-shadow: 0 0 0 rgba(57,217,138,0); }
}

@keyframes shakeBad {
  0%,100%{ transform: translateX(0); }
  20%{ transform: translateX(-6px); }
  40%{ transform: translateX(6px); }
  60%{ transform: translateX(-4px); }
  80%{ transform: translateX(4px); }
}

.okFlash{
  animation: popOk .35s ease;
  border-color: rgba(57,217,138,.7) !important;
}

.badFlash{
  animation: shakeBad .28s ease;
  border-color: rgba(255,92,122,.7) !important;
}

.done{
  color: var(--ok);
}

.topbar{
  display:flex;
  flex-direction: column;
  gap:12px;
  margin-bottom:12px;
}

.menu{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
}

.menu label{ color: var(--muted); font-weight:700; }

.menu select{
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  color: var(--text);
  border-radius: 12px;
  padding:10px 12px;
  outline:none;
}

.menu button{
  border:0;
  padding:12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  box-shadow: var(--shadow);
}

.nav{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:center;
}

#successBox{
  display:none;
  margin-top:12px;
  padding:14px 16px;
  border-radius: 14px;
  background: rgba(57,217,138,.12);
  border: 1px solid rgba(57,217,138,.35);
  color: var(--ok);
  font-weight:800;
  text-align:center;
}
#startBtn {
    width: 240px;
}