: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;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
}

.screen.hidden {
  display: none;
}

.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);
}

.hidden {
  display: none !important;
}

/* Screen Layouts */
.screen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px 24px;
  gap: 40px;
}

.header {
  text-align: center;
}

.header h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
  letter-spacing: -1px;
}

.header .subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Menu */
.menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 400px;
}

.menu-button {
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

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

.button-label {
  display: block;
}

.button-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.menu-info {
  text-align: center;
  padding: 24px;
  background: rgba(0, 212, 255, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 212, 255, 0.1);
}

.info-line {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 6px 0;
}

/* Game Screen */
.game-header {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.score-display {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 16px;
}

.score-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.score-divider {
  font-size: 12px;
  color: var(--text-muted);
}

.game-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  position: relative;
  overflow: hidden;
}

#game-canvas {
  display: block;
  background: #000;
  width: 600px;
  height: 480px;
}

.game-footer {
  padding: 16px;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  text-align: center;
}

.game-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal Styles */
.modal {
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.modal h2 {
  font-size: 32px;
  margin-bottom: 24px;
  color: var(--accent);
}

.pause-score {
  display: flex;
  justify-content: space-around;
  margin-bottom: 32px;
  font-size: 18px;
  color: var(--text-secondary);
}

.pause-score > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pause-score span {
  font-weight: 700;
  color: var(--accent);
  font-size: 24px;
}

.game-over-modal {
  max-width: 400px;
}

.final-score {
  display: flex;
  justify-content: space-around;
  margin: 24px 0 40px;
  gap: 16px;
}

.score-item {
  flex: 1;
  padding: 16px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-item .score-label {
  font-size: 11px;
}

.score-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-secondary);
}

/* Modal Buttons */
.modal-button {
  display: block;
  width: 100%;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  min-height: 56px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 12px 0;
}

.modal-button:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
  background: rgba(0, 212, 255, 0.1);
}

/* Game Canvas Styles */
canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
