/**
 * Site 010 — Free Word Jumble
 * Interaction enhancement styles — amber + forest green theme
 * card-activity archetype with sprint/survival modes
 */

/* ════════════════════════════════════════════════
   WORD JUMBLE INTERACTION ENHANCEMENTS
   ════════════════════════════════════════════════ */

/* ── Letter Tile Input ────────────────────────── */
.wj-letter-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  padding: 1rem 0;
}

/* Letter tiles: cream/ivory bg, amber border, slight 3D shadow */
.wj-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--site-border-dark, #fde68a);
  border-radius: var(--radius-tile, 8px);
  background: var(--site-surface, #fefce8);
  color: var(--site-primary-dark, #78350f);
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-tile, 0 2px 0 #b45309, 0 3px 6px rgba(120, 53, 15, 0.20));
  transition: transform 0.12s var(--ease, cubic-bezier(0.4, 0, 0.2, 1)),
              border-color 0.12s,
              background 0.12s,
              box-shadow 0.12s;
}

.wj-tile:hover {
  border-color: var(--site-primary, #d97706);
  background: #fffbeb;
  box-shadow: var(--shadow-tile-hover, 0 4px 0 #b45309, 0 6px 12px rgba(120, 53, 15, 0.24));
}

.wj-tile.is-selected {
  border-color: var(--site-primary, #d97706);
  background: var(--site-primary-light, #fffbeb);
  transform: translateY(-4px);
  box-shadow: 0 6px 0 var(--site-primary-hover, #b45309),
              0 8px 16px rgba(217, 119, 6, 0.24);
}

.wj-tile.is-placed {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.wj-tile:focus-visible {
  outline: 2px solid var(--site-primary, #d97706);
  outline-offset: 2px;
}

/* ── Answer Slots ─────────────────────────────── */
.wj-answer-slots {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.75rem 0;
}

.wj-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px dashed var(--site-border-dark, #fde68a);
  border-radius: var(--radius-tile, 8px);
  background: #fef9f0;
  color: var(--site-text, #1c1401);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.wj-slot.is-filled {
  border-style: solid;
  border-color: var(--site-primary, #d97706);
  background: #ffffff;
  box-shadow: var(--shadow-tile, 0 2px 0 #b45309, 0 3px 6px rgba(120, 53, 15, 0.16));
}

.wj-slot.is-correct {
  border-color: var(--site-accent, #16a34a);
  background: #f0fdf4;
  color: var(--site-accent-dark, #14532d);
}

.wj-slot.is-wrong {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

/* ── Combo / Streak Indicator ─────────────────── */
.wj-combo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-pill, 9999px);
  background: linear-gradient(135deg, #d97706, #16a34a);
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.30);
  transition: transform 0.2s;
}

.wj-combo.is-active { transform: scale(1.1); }

.wj-combo__multiplier {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ── Sprint / Survival Mode Bar ───────────────── */
.wj-mode-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-button, 10px);
  margin-bottom: 1rem;
}

.wj-mode-bar--sprint {
  background: linear-gradient(135deg, #78350f 0%, #d97706 100%);
  color: #fff;
}

.wj-mode-bar--survival {
  background: linear-gradient(135deg, #14532d 0%, #16a34a 100%);
  color: #fff;
}

.wj-mode-bar__timer {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 4rem;
  text-align: center;
}

.wj-mode-bar__lives {
  display: flex;
  gap: 0.2rem;
  font-size: 1.2rem;
}

.wj-mode-bar__progress {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  overflow: hidden;
}

.wj-mode-bar__fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.wj-mode-bar__score {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Mode Selector ────────────────────────────── */
.wj-mode-select {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.wj-mode-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--site-border-dark, #fde68a);
  border-radius: var(--radius-button, 10px);
  background: #ffffff;
  color: var(--site-text, #1c1401);
  cursor: pointer;
  min-height: 44px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.wj-mode-btn:hover { border-color: var(--site-primary, #d97706); }

.wj-mode-btn.is-active {
  border-color: var(--site-primary, #d97706);
  background: var(--site-primary-light, #fffbeb);
  color: var(--site-primary-hover, #b45309);
}

/* ── Hint Button ──────────────────────────────── */
.wj-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--site-primary, #d97706);
  background: transparent;
  border: 1.5px solid var(--site-primary-border, #fcd34d);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s;
}

.wj-hint-btn:hover { background: var(--site-primary-light, #fffbeb); }

.wj-hint-btn__count {
  font-size: 0.7rem;
  background: var(--site-primary, #d97706);
  color: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-pill, 9999px);
}

/* ── Post-Game Stats ──────────────────────────── */
.wj-stats {
  padding: 1.25rem;
  background: var(--site-primary-light, #fffbeb);
  border: 1px solid var(--site-border-dark, #fde68a);
  border-radius: var(--radius-card, 12px);
  margin-top: 1.5rem;
}

.wj-stats__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--site-primary-dark, #78350f);
  margin-bottom: 1rem;
  text-align: center;
  font-family: var(--font-heading);
}

.wj-stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .wj-stats__grid { grid-template-columns: repeat(2, 1fr); }
}

.wj-stat-card {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: #ffffff;
  border: 1px solid var(--site-border-dark, #fde68a);
  border-radius: var(--radius-button, 10px);
}

.wj-stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--site-primary, #d97706);
}

.wj-stat-card__label {
  font-size: 0.75rem;
  color: var(--site-text-muted, #6b7280);
  margin-top: 0.2rem;
}

.wj-stats__replay {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* ── Daily Challenge Badge ────────────────────── */
.wj-daily {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-pill, 9999px);
  background: linear-gradient(135deg, #d97706, #16a34a);
  color: #fff;
}

/* ── Print Suppression ────────────────────────── */
@media print {
  .wj-letter-tiles,
  .wj-answer-slots,
  .wj-combo,
  .wj-mode-bar,
  .wj-mode-select,
  .wj-hint-btn,
  .wj-stats,
  .wj-daily { display: none !important; }
}

/* ── Dark Mode Adjustments ────────────────────── */
@media (prefers-color-scheme: dark) {
  .wj-tile {
    background: #271500;
    border-color: #78350f;
    color: #fef3c7;
    box-shadow: 0 2px 0 #1a0f00, 0 3px 6px rgba(0, 0, 0, 0.35);
  }
  .wj-tile:hover {
    background: #3d1f00;
    border-color: #d97706;
  }
  .wj-tile.is-selected {
    background: #3d1f00;
    border-color: #fbbf24;
    box-shadow: 0 6px 0 #1a0f00, 0 8px 16px rgba(0, 0, 0, 0.40);
  }

  .wj-slot {
    background: #1c1100;
    border-color: #78350f;
    color: #f5f0e8;
  }
  .wj-slot.is-filled {
    background: #271500;
    border-color: #d97706;
  }

  .wj-mode-btn {
    background: #1c1100;
    border-color: #78350f;
    color: #f5f0e8;
  }
  .wj-mode-btn.is-active {
    background: #271500;
    border-color: #d97706;
    color: #fbbf24;
  }

  .wj-stats {
    background: #1c1100;
    border-color: #78350f;
  }
  .wj-stat-card {
    background: #271500;
    border-color: #78350f;
  }
  .wj-stat-card__value { color: #fbbf24; }
  .wj-stat-card__label { color: #a8a29e; }

  .wj-hint-btn {
    color: #fbbf24;
    border-color: #b45309;
  }
  .wj-hint-btn:hover { background: #271500; }
  .wj-hint-btn__count { background: #d97706; }
}
