/* ============================================
   Tablo — Hangman Styles
   ============================================ */

.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 20px;
  gap: 16px;
}

.game-wrapper::before {
  content: '';
  display: block;
  height: 12px;
  flex-shrink: 0;
}

.game-stats {
  display: flex;
  gap: 24px;
  padding: 16px 24px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #2dd4bf;
}

.hm-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.hm-drawing {
  background: #1e293b;
  border: 3px solid #334155;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 240px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hm-drawing svg {
  display: block;
  width: 100%;
}

.hm-drawing line,
.hm-drawing circle {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 0.3s ease;
}

.hm-drawing line.drawn,
.hm-drawing circle.drawn {
  stroke-dashoffset: 0;
}

.hm-word {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 400px;
  padding: 16px;
  background: #1e293b;
  border-radius: 8px;
  border: 1px solid #334155;
}

.hm-letter {
  width: 36px;
  height: 48px;
  border-bottom: 3px solid #2dd4bf;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.hm-letter.revealed {
  animation: hm-reveal 0.3s ease;
}

@keyframes hm-reveal {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.hm-letter.empty {
  color: #475569;
}

.hm-category {
  font-size: 13px;
  color: #64748b;
  font-style: italic;
  padding: 8px 16px;
  background: rgba(45, 212, 211, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(45, 212, 211, 0.3);
}

.hm-keyboard {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 500px;
  padding: 16px;
  background: #1e293b;
  border-radius: 12px;
  border: 1px solid #334155;
}

.hm-key-btn {
  width: 40px;
  height: 40px;
  background: #0f1923;
  border: 2px solid #334155;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hm-key-btn:hover:not(:disabled) {
  background: #243044;
  border-color: #2dd4bf;
  transform: translateY(-2px);
}

.hm-key-btn:active {
  transform: translateY(0);
}

.hm-key-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hm-key-btn.guessed-correct {
  background: rgba(34, 197, 94, 0.3);
  border-color: #22c55e;
  color: #22c55e;
}

.hm-key-btn.guessed-wrong {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ef4444;
}

.game-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.game-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-primary, sans-serif);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.game-btn:hover {
  background: #243044;
  border-color: #2dd4bf;
  color: #2dd4bf;
}

.game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-btn.primary {
  background: #2dd4bf;
  border-color: #2dd4bf;
  color: #0f1923;
}

.game-btn.primary:hover:not(:disabled) {
  background: #5eead4;
}

.game-hint {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  margin: 8px auto;
  max-width: 400px;
  line-height: 1.5;
}

.winner-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.winner-modal.visible { display: flex; }

.winner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.winner-content {
  position: relative;
  background: #1e293b;
  border: 2px solid #2dd4bf;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}

.winner-icon { font-size: 48px; margin-bottom: 16px; }
.winner-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; color: #e2e8f0; }
.winner-message { font-size: 16px; color: #94a3b8; margin-bottom: 24px; }
.winner-buttons { display: flex; gap: 12px; justify-content: center; }

.tablo-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.tablo-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .hm-letter {
    width: 30px;
    height: 40px;
    font-size: 24px;
  }

  .hm-key-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .game-stats { gap: 16px; padding: 12px 16px; }
  .game-btn { width: 100%; }
  .hm-keyboard { gap: 4px; }
}