/* === Onboarding Tooltips === */
.onboarding-tooltip {
  position: fixed;
  z-index: 10000;
  pointer-events: all;
  animation: tooltipFadeIn 0.3s ease-out;
}

.onboarding-tooltip.hidden {
  display: none;
}

.tooltip-content {
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid var(--accent, #00f7ff);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 247, 255, 0.3);
  max-width: 280px;
}

.tooltip-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.tooltip-content p {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.tooltip-content kbd {
  background: var(--accent, #00f7ff);
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-family: inherit;
}

.tooltip-dismiss {
  background: var(--accent, #00f7ff);
  color: #000;
  border: none;
  padding: 8px 24px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s;
}

.tooltip-dismiss:hover {
  transform: scale(1.05);
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Try Before Die Overlay === */
.try-before-die {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  animation: tbdPulse 0.5s ease-out;
}

.try-before-die.hidden {
  display: none;
}

.tbd-content {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95));
  border-radius: 16px;
  padding: 24px 40px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

.tbd-icon {
  font-size: 3rem;
  display: block;
  animation: tbdSpin 0.5s ease-out;
}

.tbd-content p {
  margin: 8px 0 0;
  font-size: 1.4rem;
  font-weight: bold;
  color: #000;
}

@keyframes tbdPulse {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes tbdSpin {
  from { transform: rotate(-180deg); }
  to { transform: rotate(0deg); }
}

/* === Micro-event Banner === */
.micro-event-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8000;
  background: linear-gradient(90deg, rgba(0,0,0,0.9), rgba(30,30,60,0.95), rgba(0,0,0,0.9));
  border: 2px solid var(--accent, #00f7ff);
  border-radius: 30px;
  padding: 10px 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: bannerSlideIn 0.4s ease-out;
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.4);
}

.micro-event-banner.hidden {
  display: none;
}

.micro-event-banner.coin-rush {
  border-color: gold;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.micro-event-banner.safe-zone {
  border-color: #4ade80;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.event-icon {
  font-size: 1.5rem;
}

.event-text {
  font-weight: bold;
  font-size: 1.1rem;
}

.event-timer {
  width: 60px;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}

.event-timer::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--accent, #00f7ff);
  animation: timerShrink var(--event-duration, 10s) linear forwards;
}

@keyframes bannerSlideIn {
  from { transform: translateX(-50%) translateY(-50px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes timerShrink {
  from { width: 100%; }
  to { width: 0%; }
}

/* === Badges Section === */
.badges-block {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.badges-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.badges-header h3 {
  margin: 0;
  font-size: 1rem;
}

.badges-count {
  background: var(--accent, #00f7ff);
  color: #000;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
}

.badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.badge-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.badge-item.earned {
  border-color: gold;
  background: rgba(255, 215, 0, 0.1);
}

.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 1.2rem;
}

/* === Daily Challenges Enhanced === */
.challenge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.challenge-item:hover {
  background: rgba(255,255,255,0.06);
}

.challenge-item.completed {
  background: rgba(74, 222, 128, 0.1);
  border-left: 3px solid #4ade80;
}

.challenge-difficulty {
  font-size: 1rem;
}

.challenge-text {
  flex: 1;
  font-size: 0.9rem;
}

.challenge-reward {
  font-size: 0.9rem;
}

.challenge-refresh {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

/* === Settings Screen === */
.settings-section {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.settings-section h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--accent, #00f7ff);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.setting-row label {
  flex: 1;
}

.setting-row input[type="range"] {
  width: 120px;
  margin: 0 12px;
}

.setting-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.keybinds-grid {
  display: grid;
  gap: 8px;
}

.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.keybind-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: inherit;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 80px;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.keybind-btn:hover {
  background: rgba(255,255,255,0.15);
}

.keybind-btn.listening {
  border-color: var(--accent, #00f7ff);
  animation: pulse 1s infinite;
}

.settings-hint {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-top: 12px;
}

/* === Game Over Stats === */
.game-over-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 16px 0;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}

.stat-mini {
  text-align: center;
}

.stat-mini .stat-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}

.stat-mini .stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent, #00f7ff);
}

.game-over-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.go-badge {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid gold;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.keep-patches-go {
  margin: 12px 0;
  font-size: 0.9rem;
}

.keep-patches-go label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

/* === Combo HUD === */
#hudComboCanvas {
  background: linear-gradient(90deg, rgba(255,100,100,0.2), rgba(255,50,50,0.3));
  border-color: #ff6b6b;
  animation: comboPulse 0.5s ease-out;
}

@keyframes comboPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* === Glow effect for obstacles === */
.obstacle-glow {
  filter: drop-shadow(0 0 8px var(--accent, #00f7ff));
}

/* === Keep patches option === */
.keep-patches-option {
  margin: 12px 0;
}

.keep-patches-option label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
}

/* === High Contrast Mode === */
body.high-contrast .game-over-panel,
body.high-contrast .start-panel,
body.high-contrast .card {
  background: #000;
  border: 3px solid #fff;
}

body.high-contrast .hud-chip {
  background: #000;
  border: 2px solid #fff;
  color: #fff;
}

/* === Reduced Effects Mode === */
body.reduce-effects * {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

body.reduce-effects .obstacle-glow,
body.reduce-effects .tbd-content,
body.reduce-effects .micro-event-banner {
  box-shadow: none !important;
  filter: none !important;
}

/* === Selectors Row === */
.selectors-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.selectors-row .theme-selector-highlight {
  flex: 1;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
