.wg-game { max-width: 520px; margin: 1rem auto 3rem; padding: 0 1rem; position: relative; z-index: 1; }

.panel {
  background: var(--card);
  border: 3px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(10px);
}
.panel.hidden { display: none; }
.panel h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.1em;
}
.wg-icon { font-size: 4rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.tagline { margin: 0 0 1.5rem; color: var(--text-soft); font-weight: 600; }

.setup-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; align-items: center; }
.btn-primary {
  font: inherit; font-weight: 800; padding: 0.7rem 1.6rem; border-radius: 999px; border: none;
  background: linear-gradient(90deg, var(--primary), var(--accent)); color: white; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.15s ease; font-size: 1.1rem; text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.03); }
.btn-secondary {
  display: inline-block; margin-left: 0.75rem; padding: 0.7rem 1.4rem; border-radius: 999px; text-decoration: none;
  color: var(--text); background: var(--card); border: 2px solid var(--card-border); font-weight: 700;
}

.wg-header { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.hud { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.15); border-radius: 12px; padding: 0.5rem; }
.hud-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-soft); font-weight: 700; }
.hud-value { font-size: 1.15rem; font-weight: 800; color: var(--text); }

/* Board */
.wg-board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; justify-content: center; margin-bottom: 1rem; }
.wg-row { display: grid; grid-template-columns: repeat(5, 58px); gap: 6px; }
.wg-tile {
  width: 58px; height: 58px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800;
  text-transform: uppercase; color: var(--text); background: rgba(255,255,255,0.05);
}
.wg-tile.filled { border-color: var(--primary); animation: tile-pop 0.12s ease; }
@keyframes tile-pop { 0% { transform: scale(0.9); } 100% { transform: scale(1); } }
.wg-tile.correct { background: #6aaa64; border-color: #6aaa64; color: white; }
.wg-tile.present { background: #c9b458; border-color: #c9b458; color: white; }
.wg-tile.absent  { background: #6b6b6b; border-color: #6b6b6b; color: white; }
.wg-tile.flip { animation: flip 0.5s ease; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }

.message { min-height: 1.4em; font-weight: 700; margin: 0.25rem 0 0.75rem; color: var(--text); }

/* Keyboard */
.wg-keyboard { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key {
  min-width: 30px; height: 50px; padding: 0 0.5rem; border-radius: 8px; border: none;
  background: rgba(180,180,200,0.5); color: var(--text); font: inherit; font-weight: 800; font-size: 1rem;
  text-transform: uppercase; cursor: pointer; transition: transform 0.1s ease;
}
.kb-key.wide { min-width: 56px; font-size: 0.8rem; }
.kb-key:hover { transform: translateY(-2px); }
.kb-key.correct { background: #6aaa64; color: white; }
.kb-key.present { background: #c9b458; color: white; }
.kb-key.absent  { background: #3a3a3a; color: rgba(255,255,255,0.7); }

.reveal { font-size: 1.1rem; margin: 0.5rem 0 0; }
.reveal-def { color: var(--text-soft); font-style: italic; margin: 0.25rem 0 0.5rem; }

/* help swatches */
.swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: 3px; vertical-align: middle; }
.swatch.correct { background: #6aaa64; }
.swatch.present { background: #c9b458; }
.swatch.absent  { background: #6b6b6b; }

@media (max-width: 480px) {
  .wg-row { grid-template-columns: repeat(5, 48px); }
  .wg-tile { width: 48px; height: 48px; font-size: 1.6rem; }
  .kb-key { min-width: 26px; height: 46px; }
}
