@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* css/tts.css — Premium Redesign */

/* ─── HEADER ─────────────────────────────── */
.tts-header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.tts-header::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.tts-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.tts-header p {
  margin: 5px 0 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.tts-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ─── CATEGORY SELECTOR ──────────────────── */
.tts-category-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tts-cat-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tts-cat-btn:active {
  transform: scale(0.97);
}

.tts-cat-btn.active {
  background: linear-gradient(135deg, var(--primary-red, #cc0000), #991b1b);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(204, 0, 0, 0.3);
}

/* ─── DIFFICULTY SELECTOR ────────────────── */
.tts-difficulty-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  justify-content: center;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.tts-diff-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tts-diff-btn.active {
  background: var(--primary-blue, #1e3a8a);
  color: white;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

:root {
  --cell-size: 32px;
}

@media (min-width: 400px) {
  :root {
    --cell-size: 38px;
  }
}

/* ─── BOARD CONTAINER ────────────────────── */
.tts-board-container {
  overflow-x: auto;
  padding: 16px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: block;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.tts-grid {
  display: inline-grid;
  gap: 0;
  background: #475569;
  padding: 2px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  text-align: left;
}

/* ─── CELLS ──────────────────────────────── */
.tts-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  position: relative;
  background: transparent;
}

.tts-cell.active {
  background: var(--bg-card);
}

.tts-cell.empty {
  background: #334155;
  pointer-events: none;
}

.tts-input {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-color);
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--bg-card);
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  outline: none;
  color: var(--text-dark);
  transition: all 0.15s ease;
  font-family: 'Inter', system-ui, sans-serif;
}

.tts-input:focus {
  background: var(--accent-blue-bg, #dbeafe);
  border-color: var(--primary-blue, #1e3a8a);
  box-shadow: inset 0 0 0 2px rgba(30,58,138,0.2);
  z-index: 2;
  position: relative;
}

.tts-input.correct {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: #22c55e;
  animation: correctPop 0.3s ease;
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.tts-input.incorrect {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: #ef4444;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.tts-number {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 8px;
  font-weight: 800;
  color: var(--primary-red, #cc0000);
  pointer-events: none;
  z-index: 3;
  line-height: 1;
}

/* ─── CLUES ──────────────────────────────── */
.clues-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.clues-section {
  margin-bottom: 0;
}

.clues-section:first-child {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.clues-section h4 {
  color: var(--primary-red, #cc0000);
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.clues-section h4::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
}

.clues-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--text-body);
}

.clues-list li {
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.2s;
  cursor: pointer;
  line-height: 1.4;
}

.clues-list li:hover {
  background: var(--bg-surface);
}

.clues-list li:last-child {
  margin-bottom: 0;
}

.clues-list li strong {
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-blue, #1e3a8a), #2563eb);
  color: white;
  font-size: 10px;
  font-weight: 800;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ─── CHECK BUTTON ───────────────────────── */
.btn-check {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-blue, #1e3a8a), #2563eb);
  color: white;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(30, 58, 138, 0.3);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.btn-check:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.btn-check:hover {
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.35);
}
