:root {
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --primary: #4a90e2;
  --primary-dark: #357ab8;
  --accent: #ffcc00;
  --bg-light: #f5f7fa;
  --bg-dark: #e1e5ec;
  --text-color: #333;
  --success: #28a745;
  --error: #dc3545;
}

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

html {
  font-size: 10px;
  font-family: system-ui, sans-serif;
}

body {
  background: var(--bg-light);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 1000px;
  padding: var(--spacing-md);
}

.home__screen {
  background: white;
  padding: var(--spacing-md);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.home__title {
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: var(--spacing-md);
}

.app-button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background-color: var(--primary);
  font-size: 1.8rem;
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  transition: background 0.2s;
  max-width: fit-content;
  margin: 0 auto;
}

.app-button:hover {
  background-color: var(--primary-dark);
}

.app-button.disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.app-button.disabled:hover {
  background-color: #ccc;
}

.game__container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  background-color: white;
  padding: var(--spacing-md);
  border-radius: 8px;
}

.score-display {
  text-align: center;
  padding: var(--spacing-sm);
  background: var(--bg-light);
  border-radius: 8px;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}

.timer-display {
  text-align: center;
  padding: var(--spacing-sm);
  background: var(--bg-light);
  border-radius: 8px;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-dark);
  border: 2px solid var(--accent);
  margin-bottom: var(--spacing-sm);
}

.timer-display.time-up {
  background: #f8d7da;
  border-color: var(--error);
  color: var(--error);
}

.time-up-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.time-up-content {
  background: white;
  padding: var(--spacing-md);
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.time-up-content h2 {
  font-size: 2.4rem;
  color: var(--error);
  margin-bottom: var(--spacing-sm);
}

.time-up-content p {
  font-size: 1.6rem;
  color: var(--text-color);
  margin-bottom: var(--spacing-md);
}

.time-up-buttons {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.try-again-button {
  background-color: var(--primary);
}

.try-again-button:hover {
  background-color: var(--primary-dark);
}

.home-button {
  background-color: var(--accent);
  color: var(--text-color);
}

.home-button:hover {
  background-color: #e6b800;
}

.targets-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-sm);
}

.blocks-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  justify-content: center;
  border-radius: 8px;
  min-height: 12rem;
  border: 2px dashed gray;
  padding: var(--spacing-sm);
}

.target {
  background: var(--bg-dark);
  padding: var(--spacing-sm);
  border: 2px dashed gray;
  border-radius: 8px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-align: center;
  transition: all 0.2s ease;
}

.target__name {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: var(--spacing-sm);
}

.target.drag-over {
  border-color: var(--accent);
  background: #fffbe6;
  transform: scale(1.02);
}

.target.occupied {
  border-color: var(--primary);
  background: #e8f4fd;
  border-style: solid;
}

.target.occupied .target__name {
  color: var(--primary-dark);
}

.target.correct {
  border-color: var(--success);
  background: #d4edda;
  border-style: solid;
}

.target.correct .target__name {
  color: #155724;
}

.target.incorrect {
  border-color: var(--error);
  background: #f8d7da;
  border-style: solid;
}

.target.incorrect .target__name {
  color: #721c24;
}

.blocks-container.drag-over {
  border: 2px dashed var(--accent);
  background: #fffbe6;
}

.block {
  background: white;
  padding: var(--spacing-sm);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: grab;
  font-size: 1.4rem;
  max-width: 200px;
  transition: all 0.2s ease;
}

.block:active {
  cursor: grabbing;
}

.block.locked {
  background: #d4edda;
  border: 2px solid var(--success);
  cursor: default;
  opacity: 0.9;
}

.block.locked:hover {
  transform: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.target .block {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.target .block:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dragging {
  opacity: 0.7;
  transform: scale(1.05);
}

.final-screen {
  background: white;
  padding: var(--spacing-md);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.final-title {
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: var(--spacing-sm);
}

.final-message {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-bottom: var(--spacing-md);
}

.final-score {
  background: var(--bg-light);
  padding: var(--spacing-md);
  border-radius: 8px;
  margin-bottom: var(--spacing-md);
}

.final-score h2 {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: var(--spacing-sm);
}

.score-number {
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

.score-percentage {
  font-size: 2rem;
  color: var(--text-color);
  font-weight: bold;
}
