/* Wall Go — plateau, pions, murs, barre de joueurs, zone d'action. */

/* ================= plateau ================= */
.wg-board { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: manipulation; user-select: none; -webkit-user-select: none; overflow: visible; }
.wg-tile { fill: var(--tile); stroke: transparent; stroke-width: 2; transition: fill 0.55s var(--ease), stroke 0.55s var(--ease), opacity 0.55s; }
.wg-tile.own0 { fill: #6a4a1c; stroke: rgba(247, 165, 49, 0.6); }
.wg-tile.own1 { fill: #1c5287; stroke: rgba(91, 184, 255, 0.6); }
.wg-tile.dead { fill: #0a2747; opacity: 0.7; }

/* murs : tubes lumineux de la couleur du joueur qui les pose */
.wg-wall { stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }
.wg-wall.w0 { fill: var(--p0); filter: drop-shadow(0 0 7px rgba(247, 165, 49, 0.75)); }
.wg-wall.w1 { fill: var(--p1); filter: drop-shadow(0 0 7px rgba(91, 184, 255, 0.7)); }
.wg-wall.drop { animation: wall-drop 0.5s var(--ease) both; }
@keyframes wall-drop {
  0% { transform: scale(2.1); opacity: 0; }
  55% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.wg-shock { fill: none; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: shock 0.65s var(--ease) both; }
.wg-shock.s0 { stroke: var(--p0); }
.wg-shock.s1 { stroke: var(--p1); }
@keyframes shock { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(5.5); opacity: 0; } }

/* pions */
.wg-piece { will-change: transform; }
.wg-piece-inner { transform-box: fill-box; transform-origin: center; }
.wg-piece-inner.pop { animation: pop 0.45s var(--spring) both; }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wg-board .ring { fill: none; stroke: var(--text); stroke-width: 3; opacity: 0; }
.wg-board .body { stroke: rgba(255, 255, 255, 0.55); stroke-width: 2; }
.wg-board .shine { fill: #fff; opacity: 0.4; }
.p0 .body, .wg-piece.p0 .body { fill: var(--p0); }
.p1 .body, .wg-piece.p1 .body { fill: var(--p1); }
.wg-piece.p0 { filter: drop-shadow(0 4px 8px rgba(247, 165, 49, 0.6)); }
.wg-piece.p1 { filter: drop-shadow(0 4px 8px rgba(91, 184, 255, 0.5)); }
.wg-piece.selectable .ring { opacity: 0.8; animation: ring 1.5s ease-in-out infinite; }
.wg-piece.selected .ring { opacity: 1; stroke-width: 4; animation: none; }
.wg-piece.selected .wg-piece-inner { animation: lift 0.3s var(--spring) both; }
@keyframes ring { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.95; } }
@keyframes lift { to { transform: scale(1.12); } }

/* aides au geste */
.wg-hint.move { fill: rgba(244, 249, 255, 0.9); animation: hint 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.wg-hint.place { fill: rgba(244, 249, 255, 0.28); }
@keyframes hint { 0%, 100% { transform: scale(0.8); } 50% { transform: scale(1.25); } }
.wg-ghost { opacity: 0.6; }
.wg-ghost .ring { display: none; }
.wg-trail { stroke: rgba(244, 249, 255, 0.45); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.wg-handle { opacity: 0.4; animation: handle 1s ease-in-out infinite; }
.wg-handle.p0 { fill: var(--p0); }
.wg-handle.p1 { fill: var(--p1); }
.wg-handle.chosen { opacity: 1; animation: none; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 0 9px rgba(244, 249, 255, 0.75)); }
@keyframes handle { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.85; } }
.nudge { animation: nudge 0.32s ease; }
@keyframes nudge { 20% { transform: translateX(-7px); } 45% { transform: translateX(7px); } 70% { transform: translateX(-4px); } }

/* ================= écran de partie ================= */
.wg-screen { height: 100vh; height: 100dvh; min-height: 0; gap: 10px; padding-top: max(8px, env(safe-area-inset-top)); overflow: hidden; }
.wg-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.wg-round { color: var(--muted); font-weight: 700; font-size: 15px; }
/* bouton « Règles » : pastille avec point d'interrogation + mot (un « ? » seul ne se devine pas) */
.wg-rules {
  appearance: none; border: 0; cursor: pointer; min-height: 44px; padding: 0 16px 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line); font: inherit; font-weight: 500; font-size: 15px; touch-action: manipulation;
}
.wg-rules span {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sky); color: var(--navy); font-weight: 700; font-size: 16px; line-height: 1;
}
.wg-rules:active { opacity: 0.75; }
.wg-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wg-player {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0;
  padding: 9px 14px; border-radius: 20px; background: var(--night); opacity: 0.62;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: opacity 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--spring);
}
.wg-player.active { opacity: 1; transform: translateY(-2px); }
.wg-player.p0.active { box-shadow: inset 0 0 0 2px var(--p0), 0 10px 26px -12px var(--p0); }
.wg-player.p1.active { box-shadow: inset 0 0 0 2px var(--p1), 0 10px 26px -12px var(--p1); }
.wg-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.wg-pname { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-pname small { font-size: 12px; font-weight: 700; color: var(--ink); background: var(--text); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.wg-pmeta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.wg-presence { width: 8px; height: 8px; border-radius: 50%; background: #7f9cc0; flex: none; }
.wg-presence.on { background: #4be3a3; box-shadow: 0 0 8px #4be3a3; }
.wg-pscore { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.p0 .wg-pscore { color: var(--p0); }
.p1 .wg-pscore { color: var(--p1); }
.wg-pscore.bump { animation: bump 0.4s var(--spring); }
@keyframes bump { 40% { transform: scale(1.35); } }

.wg-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.wg-board-host { width: 100%; max-width: calc(100dvh - 292px); margin: 0 auto; }

.wg-dock { display: flex; flex-direction: column; gap: 10px; padding-bottom: 2px; }
.wg-title { font-size: 23px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.wg-sub { color: var(--muted); font-size: 15px; line-height: 1.4; min-height: 2.8em; }
.wg-sub .c0 { color: var(--p0); font-weight: 700; }
.wg-sub .c1 { color: var(--p1); font-weight: 700; }
.wg-actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 10px; }
.wg-actions .btn { padding: 0 14px; }

.wg-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

/* ================= démonstration de l'accueil + règles ================= */
.hero-board .wg-board { filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35)); }
.wg-ring { fill: none; stroke: var(--sky); stroke-width: 2.5; }
.wg-lbl { font: 700 20px var(--font); fill: var(--text); }
.wg-lbl.p0 { fill: #ffd9a0; }
.wg-lbl.p1 { fill: #cfeaff; }
.wg-lbl.dead { fill: var(--muted); }
