/* Ludeox — grille Scrabble + couleurs Othello */

.ludeox{padding-bottom:48px}
.ludeox-lede{margin:-6px 0 22px;max-width:62ch}
.ludeox-setup{
  background:var(--blanc);
  border:1px solid var(--ligne);
  border-radius:var(--rayon);
  padding:18px 20px;
  margin-bottom:22px;
  box-shadow:var(--ombre);
}
.ludeox-setup label{
  display:block;font-size:12px;font-weight:700;text-transform:uppercase;
  letter-spacing:.08em;color:var(--encre-doux);margin:12px 0 8px;
}
.ludeox-setup .pills{display:flex;flex-wrap:wrap;gap:8px}

.ludeox-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:28px;
  align-items:start;
}
@media(max-width:960px){
  .ludeox-layout{grid-template-columns:1fr}
}

.ludeox-stage{
  background:var(--blanc);
  border:1px solid var(--ligne);
  border-radius:calc(var(--rayon) + 4px);
  box-shadow:var(--ombre);
  padding:18px 18px 16px;
}

.ludeox-board-wrap{
  display:flex;justify-content:center;overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.ludeox-board{
  --cell:clamp(26px, calc((100vw - 120px) / 13), 44px);
  display:grid;
  grid-template-columns:repeat(13, var(--cell));
  grid-template-rows:repeat(13, var(--cell));
  gap:2px;
  padding:6px;
  width:max-content;
  background:linear-gradient(160deg, var(--lavande-moy), var(--bleu));
  border-radius:12px;
  user-select:none;
}

.ludeox-cell{
  position:relative;
  display:flex;align-items:center;justify-content:center;
  border:none;border-radius:5px;
  background:rgba(255,251,247,.72);
  color:var(--encre);
  font-family:var(--sans);font-weight:800;
  font-size:calc(var(--cell) * .42);line-height:1;
  cursor:pointer;padding:0;
  transition:background .12s, transform .12s, box-shadow .12s;
}
.ludeox-cell:hover:not(:disabled){background:rgba(255,251,247,.95)}
.ludeox-cell:focus-visible{outline:2px solid var(--corail);outline-offset:1px;z-index:2}
.ludeox-cell.is-center::before{
  content:"";position:absolute;width:28%;height:28%;border-radius:50%;
  background:var(--corail);opacity:.55;pointer-events:none;
}
.ludeox-cell.has-tile{
  color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(61,53,88,.18);
  cursor:default;
}
.ludeox-cell.has-tile.is-center::before{display:none}
.ludeox-cell.is-pending{
  box-shadow:0 0 0 2px #fff, 0 0 0 4px var(--corail);
  cursor:pointer;transform:scale(1.04);
}
.ludeox-cell.is-target{
  box-shadow:inset 0 0 0 2px var(--corail);
  background:rgba(245,184,138,.45);
}
.ludeox-cell .tile-letter{position:relative;z-index:1;letter-spacing:-.02em}

/* Couleurs Okabe–Ito (contrastes forts) */
.ludeox-cell.owner-0,.ludeox-sb-row.owner-0 .ludeox-sb-score,.ludeox-hist-row.owner-0 .ludeox-hist-turn{--own:#E69F00}
.ludeox-cell.owner-1,.ludeox-sb-row.owner-1 .ludeox-sb-score,.ludeox-hist-row.owner-1 .ludeox-hist-turn{--own:#0072B2}
.ludeox-cell.owner-2,.ludeox-sb-row.owner-2 .ludeox-sb-score,.ludeox-hist-row.owner-2 .ludeox-hist-turn{--own:#009E73}
.ludeox-cell.owner-3,.ludeox-sb-row.owner-3 .ludeox-sb-score,.ludeox-hist-row.owner-3 .ludeox-hist-turn{--own:#CC79A7}

.ludeox-cell.has-tile.owner-0{background:linear-gradient(180deg,#F0B833,#E69F00)}
.ludeox-cell.has-tile.owner-1{background:linear-gradient(180deg,#1A8BC4,#0072B2)}
.ludeox-cell.has-tile.owner-2{background:linear-gradient(180deg,#1BB088,#009E73)}
.ludeox-cell.has-tile.owner-3{background:linear-gradient(180deg,#D891B8,#CC79A7)}

.ludeox-rack-bar{
  margin-top:18px;
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;
  gap:14px 18px;
}
.ludeox-rack{
  display:flex;gap:8px;flex-wrap:wrap;justify-content:center;min-height:54px;
}
.ludeox-rack-tile{
  --rack-size:48px;
  --rack-accent:var(--corail);
  position:relative;
  width:var(--rack-size);height:var(--rack-size);
  border:none;border-radius:8px;
  background:linear-gradient(180deg, #FFF8EE, #EBD7B0);
  box-shadow:0 3px 0 #C9AE7E, 0 4px 10px rgba(61,53,88,.12);
  color:var(--encre);
  font-family:var(--sans);font-weight:800;font-size:22px;
  cursor:pointer;
  transition:transform .12s, box-shadow .12s, opacity .12s;
}
.ludeox-rack-tile:hover{transform:translateY(-2px)}
.ludeox-rack-tile.is-selected{
  transform:translateY(-6px);
  box-shadow:0 8px 0 #C9AE7E, 0 10px 18px color-mix(in srgb, var(--rack-accent) 40%, transparent);
  outline:2px solid var(--rack-accent);outline-offset:2px;
}
.ludeox-rack-tile.is-played{opacity:.28;pointer-events:none;transform:none;box-shadow:none}
.ludeox-rack-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}

.ludeox-side .aside-box{margin-bottom:16px}
.aside-title{font-size:18px;margin-bottom:10px}

.ludeox-scoreboard{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.ludeox-sb-row{
  display:grid;
  grid-template-columns:18px 1fr auto auto;
  gap:8px;align-items:center;
  padding:8px 10px;border-radius:10px;
  background:var(--lavande-pale);border:1px solid var(--ligne);
  font-size:14px;
}
.ludeox-sb-row.is-active{
  border-color:var(--lavande-fonce);
  box-shadow:0 0 0 2px rgba(184,168,224,.45);
}
.ludeox-sb-row.is-me{font-weight:700}
.ludeox-sb-swatch{
  width:14px;height:14px;border-radius:3px;
  border:1px solid rgba(0,0,0,.15);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.25);
}
.ludeox-sb-swatch.owner-0{background:#E69F00}
.ludeox-sb-swatch.owner-1{background:#0072B2}
.ludeox-sb-swatch.owner-2{background:#009E73}
.ludeox-sb-swatch.owner-3{background:#CC79A7}
.ludeox-sb-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ludeox-sb-score{font-family:var(--serif);font-size:20px;color:var(--own, var(--encre))}
.ludeox-sb-max{font-size:12px;color:var(--encre-doux)}

.ludeox-history{max-height:220px;overflow:auto;margin-top:4px}
.ludeox-hist-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.ludeox-hist-row{
  display:grid;
  grid-template-columns:36px 14px 1fr;
  gap:8px;align-items:start;
  font-size:13px;line-height:1.35;
  padding:6px 8px;border-radius:8px;
  background:rgba(255,255,255,.55);border:1px solid var(--ligne);
}
.ludeox-hist-turn{
  font-weight:800;font-size:11px;letter-spacing:.04em;
  color:var(--own, var(--encre-doux));
}
.ludeox-hist-swatch{
  width:12px;height:12px;border-radius:3px;margin-top:3px;
  border:1px solid rgba(0,0,0,.12);
}
.ludeox-hist-swatch.owner-0{background:#E69F00}
.ludeox-hist-swatch.owner-1{background:#0072B2}
.ludeox-hist-swatch.owner-2{background:#009E73}
.ludeox-hist-swatch.owner-3{background:#CC79A7}
.ludeox-hist-body{color:var(--encre-doux)}
.ludeox-hist-body b{color:var(--encre);font-weight:700}
.ludeox-hist-row.is-invalid{opacity:.85}
.ludeox-hist-bad{color:#B44A3A;font-weight:700}

.ludeox-status{
  min-height:2.6em;font-size:14px;color:var(--encre-doux);margin-bottom:10px;
}
.ludeox-status.is-ok{color:#2F7A4E}
.ludeox-status.is-err{color:#B44A3A}
.ludeox-status.is-warn{color:#9A6B1F}
.ludeox-words{
  list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px;padding:0;
}
.ludeox-words li{
  font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  padding:4px 9px;border-radius:999px;
  background:var(--lavande-pale);border:1px solid var(--ligne);color:var(--encre);
}
.ludeox-controls{justify-content:flex-start;margin-top:4px}
.ludeox-controls .btn{width:auto;display:inline-flex;padding:11px 18px;font-size:13.5px}
.ludeox-help{
  margin:0;padding-left:18px;color:var(--encre-doux);font-size:13.5px;line-height:1.55;
}
.ludeox-help li{margin-bottom:6px}
.ludeox-meta{margin-top:10px;font-size:12px;color:var(--encre-doux)}

@media(max-width:520px){
  .ludeox-stage{padding:10px}
  .ludeox-rack-tile{--rack-size:42px;font-size:19px}
}
