/* ============================================
   Tablo — Mastermind 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;
}

.mm-board {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 360px;
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2dd4bf #0f1923;
}

.mm-board::-webkit-scrollbar {
  width: 6px;
}

.mm-board::-webkit-scrollbar-track {
  background: #0f1923;
  border-radius: 3px;
  margin: 8px 0;
}

.mm-board::-webkit-scrollbar-thumb {
  background: #2dd4bf;
  border-radius: 3px;
}

.mm-board:empty::after {
  content: 'No guesses yet';
  display: block;
  text-align: center;
  color: #475569;
  font-size: 13px;
  padding: 20px;
}

.mm-past-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #334155;
}

.mm-past-row:last-child {
  border-bottom: none;
}

.mm-row-num {
  font-size: 11px;
  color: #64748b;
  min-width: 24px;
  text-align: right;
}

.mm-slots {
  display: flex;
  gap: 8px;
}

.mm-slot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #334155;
  background: #0f1923;
  flex-shrink: 0;
}

.mm-slot.filled {
  border-color: transparent;
}

/* CORRECTED: 4 dots in a single row */
.mm-feedback {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.mm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
}

.mm-dot.green { background: #22c55e; }
.mm-dot.yellow { background: #eab308; }

.mm-current-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(45, 212, 211, 0.08);
  border: 2px dashed #2dd4bf;
  border-radius: 12px;
  padding: 12px 16px;
  width: 100%;
  max-width: 360px;
}

.mm-current-row.hidden {
  display: none;
}

.mm-current-num {
  font-size: 14px;
  font-weight: 700;
  color: #2dd4bf;
  min-width: 24px;
  text-align: right;
}

.mm-current-slots {
  display: flex;
  gap: 8px;
}

.mm-input-slot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #334155;
  background: #0f1923;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mm-input-slot:hover:not(.filled) {
  border-color: #2dd4bf;
  transform: scale(1.1);
}

.mm-input-slot.filled {
  border-color: transparent;
  cursor: pointer;
}

.mm-input-slot.next {
  border-color: #2dd4bf;
  animation: mm-pulse 1.5s ease-in-out infinite;
}

@keyframes mm-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 211, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(45, 212, 211, 0); }
}

.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 360px;
}

.color-btn {
  width: 48px;
  height: 48px;
  border: 3px solid #334155;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.color-btn:hover {
  transform: scale(1.15);
  border-color: #2dd4bf;
}

.color-btn:active {
  transform: scale(0.95);
}

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

.mode-select {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-primary, sans-serif);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mode-select:hover { border-color: #2dd4bf; }

.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:not(:disabled) {
  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: 360px;
  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-secret {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.winner-secret .mm-slot {
  width: 40px;
  height: 40px;
}

.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) {
  .mm-slot { width: 30px; height: 30px; }
  .mm-input-slot { width: 38px; height: 38px; }
  .color-btn { width: 42px; height: 42px; }
  .game-stats { gap: 16px; padding: 12px 16px; }
  .game-controls { flex-direction: column; width: 100%; }
  .mode-select, .game-btn { width: 100%; }
}