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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cell {
  border: 1px solid #e0e0e0;
  background: white;
  transition: all 0.1s ease;
  user-select: none;
}

.dark .cell {
  background: #1f2937;
  border-color: #374151;
}

.cell:hover {
  background: #f9fafb;
}

.dark .cell:hover {
  background: #374151;
}

.active-cell {
  border: 2px solid #2196F3 !important;
  box-shadow: 0 0 0 1px #2196F3;
  z-index: 10;
}

.selected-cell {
  background: #E3F2FD !important;
}

.dark .selected-cell {
  background: #1e3a5f !important;
}

.cell-content {
  padding: 4px 8px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 100%;
  display: flex;
  align-items: center;
}

input {
  font-family: inherit;
}

.sparkles {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  pointer-events: none;
  animation: sparkle 0.3s ease-out;
  z-index: 1000;
}

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

.easter-egg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  text-align: center;
  animation: easterEgg 3s ease-out;
  pointer-events: none;
}

@keyframes easterEgg {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
  }
  40% {
    transform: translate(-50%, -50%) scale(1) rotate(-5deg);
  }
  60% {
    transform: translate(-50%, -50%) scale(1.1) rotate(0deg);
  }
  80% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Smooth transitions */
.cell, .active-cell, .selected-cell {
  transition: background-color 0.15s ease, border-color 0.15s ease;
}