:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}

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

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  padding: 20px;
  overflow-y: auto;
}

.screen.hidden {
  display: none !important;
}

.screen-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--bg-tertiary);
}

.screen-header h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.screen-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
}

.screen-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  padding: 20px 0;
}

.button {
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: #000;
  font-weight: 700;
}

.button-primary:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow), inset 0 0 10px rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.button-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--bg-tertiary);
}

.button-secondary:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
  background: var(--bg-secondary);
}

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
}

.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* Game Screen */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  gap: 16px;
}

.score-display {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

#score {
  font-weight: 700;
  color: var(--accent-secondary);
}

.game-status {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

#gameCanvas {
  max-width: 400px;
  max-height: 400px;
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
  border: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.game-footer {
  text-align: center;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Score Display */
.score-box {
  background: var(--bg-tertiary);
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin: 20px 0;
}

.score-box .label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.score-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-secondary);
  margin: 0;
}

.new-high-score {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-secondary);
}

.new-high-score.hidden {
  display: none;
}

/* Scores List */
.scores-list {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-secondary);
  font-size: 16px;
}

.score-item:last-child {
  border-bottom: none;
}

.score-item-rank {
  font-weight: 700;
  color: var(--accent);
  min-width: 40px;
}

.score-item-value {
  font-weight: 700;
  color: var(--accent-secondary);
}

.empty-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-style: italic;
}

/* Settings */
.setting-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-item label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#difficultySelect {
  padding: 12px 16px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--bg-secondary);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  min-height: 44px;
}

#difficultySelect:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
  background: var(--bg-tertiary);
}

#difficultySelect option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}
