:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Modal Game Over */
.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: rgba(20, 20, 30, 0.95);
  border: 3px solid #4ecdc4;
  border-radius: 12px;
  padding: 40px;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.modal-content h2 {
  color: #4ecdc4;
  font-size: 2.5em;
  margin: 0 0 30px 0;
  text-shadow: 0 2px 10px rgba(78, 205, 196, 0.3);
}

.final-score {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  gap: 20px;
}

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

.score-display-item .score-label {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-display-item .score-value {
  font-size: 2em;
  font-weight: bold;
  color: #4ecdc4;
}

.bonus-breakdown {
  background: rgba(78, 205, 196, 0.1);
  border: 1px solid rgba(78, 205, 196, 0.3);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bonus-item-breakdown {
  display: flex;
  justify-content: space-between;
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.8);
}

.bonus-item-breakdown span:last-child {
  font-weight: bold;
  color: #feca57;
}

.bonus-item-breakdown.difficulty-bonus {
  padding-top: 8px;
  border-top: 1px solid rgba(78, 205, 196, 0.2);
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.9);
}

.bonus-item-breakdown.difficulty-bonus span:last-child {
  color: #ff9ff3;
}

.bonus-item-breakdown span:last-child.not-earned {
  color: #999;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.btn-primary,
.btn-secondary {
  padding: 14px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background-color: #4ecdc4;
  color: #000;
}

.btn-primary:hover {
  background-color: #3db8a8;
  transform: scale(1.02);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: #646cff;
  color: white;
}

.btn-secondary:hover {
  background-color: #535bf2;
  transform: scale(1.02);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* Score Panel */
#score-panel {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.score-container {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #4ecdc4;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

.score-label {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 1.8em;
  font-weight: bold;
  color: #4ecdc4;
}

.bonus-conditions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(78, 205, 196, 0.3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.condition-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.8);
  padding: 0 8px;
}

.condition-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.condition-value {
  font-weight: bold;
  color: #feca57;
  font-size: 1.1em;
}

/* GUI Panel */
#gui-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.gui-container {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #646cff;
  border-radius: 8px;
  padding: 20px;
  min-width: 280px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.gui-container h3 {
  margin: 0 0 20px 0;
  font-size: 1.2em;
  color: #646cff;
  text-align: center;
}

.gui-control {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gui-control label {
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.87);
  display: flex;
  justify-content: space-between;
}

.gui-control label span {
  color: #646cff;
  font-weight: bold;
}

.gui-control input[type="range"] {
  width: 100%;
  cursor: pointer;
  accent-color: #646cff;
  height: 6px;
  border-radius: 3px;
}

#hint-btn,
#reset-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 8px;
}

#hint-btn {
  background-color: #f7b731;
  color: #000;
}

#hint-btn:hover {
  background-color: #feca57;
  transform: scale(1.02);
}

#hint-btn:active {
  transform: scale(0.98);
}

#reset-btn {
  background-color: #646cff;
  margin-bottom: 0;
}

#reset-btn:hover {
  background-color: #535bf2;
  transform: scale(1.02);
}

#reset-btn:active {
  transform: scale(0.98);
}

.bonus-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.bonus-info h4 {
  margin: 0 0 12px 0;
  font-size: 0.9em;
  color: #646cff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bonus-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
}

.bonus-icon {
  font-size: 1.2em;
}

.difficulty-options {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.difficulty-options h4 {
  margin: 0 0 12px 0;
  font-size: 0.9em;
  color: #f7b731;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  margin-bottom: 8px;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #f7b731;
}

.checkbox-label:hover {
  color: rgba(255, 255, 255, 1);
}


a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vanilla:hover {
  filter: drop-shadow(0 0 2em #f7df1eaa);
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}
