/* Word Groups — game-specific styles (shared look lives in ../theme.css) */

.tagline {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.tagline strong {
  color: var(--accent);
}

.level-chip {
  font-weight: 800;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 6px 16px;
  font-size: 1.05rem;
  white-space: nowrap;
}

.tries-chip {
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 14px;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.tries-chip.low-tries {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hint-bar {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
}

.tile.hinted {
  background: var(--found-5);
  border-color: #e0c200;
  animation: pulse 0.65s ease 3;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.lose-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  text-align: left;
}

.lose-groups .solved-group {
  padding: 9px 14px;
}

.unsolved-group {
  background: var(--bg);
  border: 1px dashed var(--line);
}

.board-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
}

.board {
  width: min(100%, 900px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: filter 0.25s ease;
}

.solved-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.solved-group {
  border-radius: 14px;
  padding: 12px 16px;
  text-align: center;
  animation: pop-in 0.3s ease;
}

.solved-group h3 {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.solved-group p {
  font-weight: 600;
  margin-top: 2px;
}

.solved-color-1 { background: var(--found-1); }
.solved-color-2 { background: var(--found-3); }
.solved-color-3 { background: var(--found-4); }

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.tile {
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.9vw, 1.25rem);
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 14px;
  padding: 0 6px;
  height: clamp(58px, 9vh, 86px);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.06s ease, background 0.12s ease;
  overflow-wrap: anywhere;
}

.tile:active {
  transform: scale(0.95);
}

.tile.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tile.shake {
  animation: shake 0.4s ease;
}

.board-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}

.toast {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 22px;
  z-index: 10;
  animation: pop-in 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateX(-50%) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.solved-group {
  animation-name: solved-in;
}

@keyframes solved-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ---------- Narrow screens ---------- */
@media (max-width: 760px) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .tile {
    font-size: 0.82rem;
    height: 64px;
  }
}
