/* ===================================
   2048 Cupcakes - Game Enhancements UI
   - Stats Dashboard
   - Undo Button
   - Keyboard Shortcuts
   =================================== */

/* Enhanced Controls Bar */
.game-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-controls button {
  background: linear-gradient(135deg, #f888a9 0%, #f67098 100%);
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  color: #3c1b1a;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.game-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(246, 112, 152, 0.4);
}

.game-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.game-controls .undo-count {
  background: rgba(0,0,0,0.2);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
}

/* Stats Dashboard */
.stats-dashboard {
  background: linear-gradient(135deg, #fdfae8 0%, #fff5e6 100%);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

[data-theme="dark"] .stats-dashboard {
  background: linear-gradient(135deg, #1e2a4a 0%, #16213e 100%);
}

.stats-dashboard h3 {
  margin: 0 0 15px 0;
  color: #776e65;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .stats-dashboard h3 {
  color: #b8b8b8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
}

.stat-item {
  text-align: center;
  padding: 15px 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

[data-theme="dark"] .stat-item {
  background: rgba(255,255,255,0.08);
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: #f67098;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: #8f7a66;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .stat-label {
  color: #888;
}

/* Keyboard Shortcuts Panel */
.shortcuts-panel {
  background: #fdfae8;
  border-radius: 10px;
  padding: 15px 20px;
  margin-top: 20px;
  border-left: 4px solid #f2b179;
}

[data-theme="dark"] .shortcuts-panel {
  background: #1e2a4a;
}

.shortcuts-panel h4 {
  margin: 0 0 10px 0;
  color: #776e65;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .shortcuts-panel h4 {
  color: #b8b8b8;
}

.shortcuts-list {
  display: none;
  margin-top: 10px;
}

.shortcuts-panel.expanded .shortcuts-list {
  display: block;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
  color: #4d2523;
}

[data-theme="dark"] .shortcut-item {
  color: #e8e8e8;
}

.shortcut-key {
  display: inline-block;
  background: #f67098;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  min-width: 30px;
  text-align: center;
}

/* Share Score Button */
.share-score-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
}

.share-score-btn:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

/* Sound Toggle */
.sound-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f67098;
  color: white;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 999;
}

.sound-toggle:hover {
  transform: scale(1.1);
}

.sound-toggle.muted {
  background: #888;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobile Responsive */
@media screen and (max-width: 520px) {
  .game-controls {
    flex-direction: column;
  }
  
  .game-controls button {
    width: 100%;
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .theme-toggle {
    width: 40px;
    height: 40px;
    font-size: 18px;
    bottom: 15px;
    right: 15px;
  }
  
  .sound-toggle {
    bottom: 65px;
    right: 15px;
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
}
