.wg-stage {
  --wg-green: #3f9b52;
  --wg-yellow: #c9a227;
  --wg-gray: #6b6f78;
  --wg-key: #dcd6cc;
  --wg-tile-line: #cfc6b8;
  max-width: 500px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
@media (prefers-color-scheme: dark) {
  .wg-stage { --wg-key: #3a3129; --wg-tile-line: #4a3f35; --wg-gray: #4b4f57; }
}
.wg-label { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; min-height: 22px; }

.wg-board {
  --tile: min(62px, calc((100vw - 48px) / 5.4), calc((100svh - 360px) / 6.4));
  display: grid; grid-template-rows: repeat(6, var(--tile)); gap: 6px;
}
.wg-row { display: grid; grid-template-columns: repeat(5, var(--tile)); gap: 6px; }
.wg-row.shake { animation: wg-shake .45s; }
.wg-tile {
  display: grid; place-items: center;
  border: 2px solid var(--wg-tile-line); border-radius: 6px;
  font: 800 calc(var(--tile) * .52)/1 system-ui, sans-serif; text-transform: uppercase;
  color: var(--text); background: var(--surface);
  user-select: none;
}
.wg-tile.filled { border-color: var(--muted); animation: wg-pop .1s; }
.wg-tile.g, .wg-tile.y, .wg-tile.n { color: #fff; border-color: transparent; }
.wg-tile.g { background: var(--wg-green); }
.wg-tile.y { background: var(--wg-yellow); }
.wg-tile.n { background: var(--wg-gray); }
.wg-tile.flip { animation: wg-flip .5s ease both; }
.wg-row.win .wg-tile { animation: wg-jump .5s ease both; }

.wg-keys { width: 100%; display: flex; flex-direction: column; gap: 7px; touch-action: manipulation; }
.wg-krow { display: flex; gap: 5px; justify-content: center; }
.wg-key {
  flex: 1 1 0; max-width: 46px; height: 54px;
  border: 0; border-radius: 6px; background: var(--wg-key); color: var(--text);
  font: 700 15px system-ui, sans-serif; text-transform: uppercase; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.wg-key.wide { flex-grow: 1.6; max-width: 72px; font-size: 12px; }
.wg-key.g, .wg-key.y, .wg-key.n { color: #fff; }
.wg-key.g { background: var(--wg-green); }
.wg-key.y { background: var(--wg-yellow); }
.wg-key.n { background: var(--wg-gray); }
.wg-key:active { filter: brightness(.9); }

.wg-dist { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; }
.wg-dist div { display: grid; grid-template-columns: 14px 1fr; gap: 6px; align-items: center; }
.wg-dist span { background: var(--wg-gray, #6b6f78); color: #fff; text-align: right; padding: 1px 6px; border-radius: 3px; min-width: 22px; font-weight: 700; }
.wg-dist span.now { background: var(--wg-green, #3f9b52); }
.wg-answer { font: 800 24px system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--text); margin: 4px 0; }

@keyframes wg-pop { 50% { transform: scale(1.08); } }
@keyframes wg-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes wg-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes wg-jump { 40% { transform: translateY(-14px); } }
