* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(30, 30, 45, 0.6);
  --accent-primary: #a855f7;
  --accent-secondary: #22d3ee;
  --accent-tertiary: #f472b6;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --glow-purple: 0 0 30px rgba(168, 85, 247, 0.4);
  --glow-cyan: 0 0 20px rgba(34, 211, 238, 0.3);
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(244, 114, 182, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.header {
  text-align: center;
  padding: 40px 0 30px;
}

.title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.title-icon {
  font-size: 3rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.title-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.focus-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.focus-indicator.active {
  background: rgba(34, 211, 238, 0.2);
  color: var(--accent-secondary);
  animation: pulse 2s infinite;
}

.focus-indicator.inactive {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

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

.main-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.counter-section {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.2);
  box-shadow: var(--glow-purple);
}

.big-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 800;
  background: linear-gradient(180deg, #fff 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  transition: transform 0.1s ease;
  animation: glow 2s ease-in-out infinite;
}

.big-counter.pop {
  transform: scale(1.05);
}

@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5)); }
  50% { filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.8)); }
}

.counter-label {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.counter-hint {
  color: var(--accent-secondary);
  font-size: 0.85rem;
  margin-top: 8px;
  opacity: 0.8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (min-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 15px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

.section-title {
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.heatmap-section, .activity-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.keyboard-heatmap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.keyboard-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.keyboard-key {
  width: clamp(24px, 6vw, 40px);
  height: clamp(24px, 6vw, 40px);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.15s ease;
  position: relative;
}

.keyboard-key.key-pressed {
  transform: scale(1.2);
  z-index: 10;
}

.keyboard-key.space-key {
  width: clamp(120px, 30vw, 200px);
}

.key-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.5rem, 2vw, 0.75rem);
  font-weight: 600;
  color: var(--text-primary);
}

.key-count {
  font-size: 0.5rem;
  color: var(--text-secondary);
  position: absolute;
  bottom: 2px;
  right: 3px;
}

.activity-graph {
  height: 80px;
}

.graph-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 60px;
}

.graph-bar {
  flex: 1;
  min-height: 2px;
  background: linear-gradient(to top, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
}

.graph-label {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 10px;
}

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

.control-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.control-btn.pause {
  background: rgba(250, 204, 21, 0.2);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.control-btn.resume {
  background: rgba(34, 211, 238, 0.2);
  color: var(--accent-secondary);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.control-btn.reset {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.control-btn.sound {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.control-btn.share {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.control-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

.lifetime-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.lifetime-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

.lifetime-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-tertiary);
  display: block;
}

.lifetime-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.achievements-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.achievement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.achievement.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.achievement.unlocked {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

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

.achievement-info {
  display: flex;
  flex-direction: column;
}

.achievement-name {
  font-weight: 600;
  font-size: 0.8rem;
}

.achievement-desc {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.achievement-popup {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(34, 211, 238, 0.9));
  padding: 15px 25px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 1000;
  animation: slideDown 0.5s ease, fadeOut 0.5s ease 2.5s;
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.5);
}

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.achievement-popup-icon {
  font-size: 2rem;
}

.achievement-popup-title {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.achievement-popup-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.fun-fact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(250, 204, 21, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(250, 204, 21, 0.2);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.fun-fact-icon {
  font-size: 1.3rem;
}

.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-stat {
  margin-top: 8px;
  font-size: 0.75rem;
  opacity: 0.7;
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.particle {
  pointer-events: none;
}

/* System-wide notice styles */
.systemwide-notice {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(251, 146, 60, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

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

.notice-title {
  font-weight: 700;
  font-size: 1rem;
  color: #fb923c;
  flex: 1;
}

.notice-dismiss {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.notice-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.notice-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

.notice-actions {
  display: flex;
  gap: 10px;
}

.notice-btn {
  background: rgba(251, 146, 60, 0.2);
  border: 1px solid rgba(251, 146, 60, 0.3);
  color: #fb923c;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.notice-btn:hover {
  background: rgba(251, 146, 60, 0.3);
  transform: translateY(-1px);
}

.alternatives-list {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.alternatives-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.alternative-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.alternative-item:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--accent-secondary);
  transform: translateX(4px);
}

.alt-platform {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 100px;
  text-align: center;
}

.alt-tool {
  flex: 1;
  color: var(--accent-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.alt-arrow {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

@media (max-width: 480px) {
  .title-text {
    font-size: 1.8rem;
  }
  
  .title-icon {
    font-size: 2rem;
  }
  
  .big-counter {
    font-size: 3.5rem;
  }
  
  .control-btn {
    padding: 10px 16px;
    font-size: 0.8rem;
  }
  
  .lifetime-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .alt-platform {
    min-width: 80px;
    font-size: 0.7rem;
  }
}