/* ============================================================
   Word Scramble — game-specific styles
   ============================================================ */

.ws-setup {
  width: 100%;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
}
.ws-label {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}
.ws-difficulty-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ws-chip {
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.ws-chip:hover {
  border-color: var(--pink);
  color: var(--pink-deep);
}
.ws-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.ws-card {
  width: 100%;
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 4vw, 28px);
  box-shadow: var(--shadow);
  contain: layout paint;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.ws-hint {
  margin: 0 0 18px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 800;
}
.ws-hint[hidden] {
  display: none;
}
.ws-answer {
  display: grid;
  grid-template-columns: repeat(var(--word-len, 6), minmax(0, 1fr));
  gap: clamp(5px, 1.4vw, 10px);
  margin-bottom: 22px;
}
.ws-slot,
.ws-tile {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  line-height: 1;
}
.ws-slot {
  background: var(--bg-soft);
  color: var(--ink);
  font-size: clamp(1.1rem, calc(16vw / var(--word-len, 6)), 2.1rem);
}
.ws-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.ws-tile {
  width: clamp(42px, 11vw, 62px);
  background: var(--yellow);
  color: var(--ink);
  font-size: clamp(1.3rem, 5vw, 2rem);
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(34,49,74,0.15);
  transition: transform 0.08s ease, filter 0.08s ease;
}
.ws-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.ws-tile:disabled {
  opacity: 0.28;
  cursor: default;
  transform: none;
}
.ws-message-row {
  min-height: 1.4em;
  margin: 18px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
}
.ws-message {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 700;
}
.ws-card.is-correct {
  border-color: var(--simon-green);
  animation: ws-correct 1s ease;
}
.ws-card.is-wrong {
  animation: ws-wrong 0.26s ease;
}
.ws-card.is-strike {
  border-color: var(--simon-red);
  animation: ws-strike 1s ease;
}

@keyframes ws-correct {
  0%, 100% { transform: scale(1); }
  10%, 90% { transform: scale(1.015); }
}
@keyframes ws-wrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes ws-strike {
  0%, 100% { transform: scale(1); }
  10%, 90% { transform: scale(1.015); }
}

#game-stage:fullscreen,
#game-stage.is-ios-fullscreen {
  border-radius: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: calc(var(--obg-vh, 1vh) * 100);
  justify-content: flex-start;
  background: var(--bg-soft);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 560px) {
  .ws-setup {
    grid-template-columns: 1fr;
  }
  .ws-chip {
    padding: 7px 13px;
  }
  .ws-tiles {
    gap: 8px;
  }
}
