:root {
  --bg-primary: #1e1e1e;
  --bg-secondary: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent: #00d4ff;
  --error: #ff3333;
  --success: #00cc00;
  --font-mono: "Fira Code", monospace;
  --font-sans: "Inter", sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f0f0f0;
  --bg-secondary: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  padding-bottom: calc(2rem + 60px); /* Existing padding + copyright height */
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.settings {
  display: flex;
  gap: 1rem;
}

.settings button,
.settings select {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--text-secondary);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.timer {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.test-container {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.sample-text {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  line-height: 1.6;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  white-space: pre-wrap;
}

.input {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: 8px;
  resize: none;
  height: 200px;
  transition: border-color 0.3s;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
}

.stat {
  text-align: center;
  padding: 1rem;
  border-radius: 4px;
  background: var(--bg-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}

.correct {
  color: var(--success);
}
.error {
  color: var(--error);
}
.current {
  background-color: var(--accent);
}

.leaderboard {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.leaderboard table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard th,
.leaderboard td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--text-secondary);
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
    padding-bottom: calc(1rem + 60px); /* Existing padding + copyright height */
  }

  .settings {
    flex-direction: column;
  }

  .stats {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Update the restart button styling */
#restartButton {
  background: linear-gradient(135deg, var(--accent), #4a9eff);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

#restartButton::before {
  content: "↺";
  font-size: 1.2rem;
  margin-right: 0.2rem;
}

#restartButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

#restartButton:active {
  transform: translateY(1px);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#restartButton:hover::before {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Update modal styling to center the button */
.results {
  text-align: center;
}

.results-content {
  margin: 2rem 0;
}

/* Add new UI elements */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  margin: 1rem 0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  color: var(--accent);
  font-weight: bold;
  animation: pulse 1s infinite;
  z-index: 100;
}

.settings-panel {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.keyboard-shortcuts {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

/* Update responsive design */
@media (max-width: 600px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .keyboard-shortcuts {
    display: none;
  }
}

/* Add new creative UI elements */
.focus-mode {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, var(--bg-primary), #000);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s;
}

.focus-mode.active {
  opacity: 1;
}

.particle {
  position: absolute;
  pointer-events: none;
  animation: float 20s linear infinite;
}

.word-highlight {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  transition: all 0.3s;
}

.word-highlight.active {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96c93d);
  background-size: 400% 400%;
  animation: gradient 3s ease infinite;
}

.achievements {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transform: translateX(120%);
  transition: transform 0.3s;
}

.achievements.show {
  transform: translateX(0);
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

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

.typing-pattern {
  height: 60px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin: 1rem 0;
  overflow: hidden;
}

.pattern-graph {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.pattern-bar {
  flex: 1;
  background: var(--accent);
  margin: 0 1px;
  transition: height 0.3s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(100px, -100px) rotate(360deg);
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.mode-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
}

.mode-button.active {
  background: var(--accent);
  transform: scale(1.05);
}

.quote-container {
  text-align: center;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Add title styles */
.title-section {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.main-title {
  font-size: 3.5rem;
  font-weight: 600;
  background: linear-gradient(45deg, var(--accent), #4a9eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.title-decoration {
  position: absolute;
  font-size: 8rem;
  opacity: 0.03;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  user-select: none;
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .main-title {
    font-size: 2.5rem;
  }

  .title-decoration {
    font-size: 6rem;
  }
}

/* Update copyright styles */
.copyright-section {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.75rem;
  text-align: center;
  background: var(--bg-primary);
  border-top: 1px solid var(--bg-secondary);
  font-size: 0.9rem;
  color: var(--text-secondary);
  z-index: 100;
}

.designer-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.designer-logo {
  font-size: 1.1rem;
  background: linear-gradient(45deg, var(--accent), #4a9eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
}

@media (max-width: 600px) {
  .copyright-section {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .designer-credit {
    padding: 0.25rem 0.75rem;
  }
}
