@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --bg-color: #0D1B2A;
  --primary-color: #0984E3;
  --secondary-color: #74B9FF;
  --accent-color: #E17055;
  --text-color: #E0E1DD;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius: 12px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 600px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

header {
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 20px;
  background: var(--glass-bg);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}

.moves-count {
  color: var(--secondary-color);
}

.max-moves {
  color: var(--text-color);
  opacity: 0.6;
}

#game-canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.color-picker {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.color-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: white;
  transform: scale(1.1);
}

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

.btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-color);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn.primary {
  background: var(--primary-color);
  border: none;
}

.btn.primary:hover {
  background: var(--secondary-color);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 27, 42, 0.85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-color);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  text-align: center;
  max-width: 400px;
  width: 85%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.modal p {
  margin-bottom: 24px;
  opacity: 0.8;
}

@media (max-width: 480px) {
  .container {
    padding: 20px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .color-btn {
    width: 40px;
    height: 40px;
  }
}
