* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: #121213;
  color: white;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.game {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

h1 {
  font-size: 2.6rem;
  margin-bottom: 5px;
  letter-spacing: 2px;
}

.subtitle {
  color: #b3b3b3;
  margin-bottom: 25px;
}

h2 {
  font-size: 1rem;
  color: #d4d4d4;
  margin-bottom: 10px;
}

.guess-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.guess-slots,
.color-palette {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.guess-slot,
.cube {
  width: 54px;
  height: 54px;
  border: 2px solid #3a3a3c;
  border-radius: 8px;
  background: transparent;
}

.guess-slot {
  border-style: dashed;
  cursor: pointer;
}

.color-option {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: white;
}

.current-guess,
.palette {
  margin-bottom: 22px;
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

button {
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  background: #538d4e;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.secondary {
  background: #3a3a3c;
}

.danger {
  background: #b23b3b;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #3a3a3c;
  font-size: 1.3rem;
}

.message {
  min-height: 24px;
  font-weight: bold;
}

.board {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  margin-top: 25px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feedback {
  min-width: 180px;
  text-align: left;
  font-size: 0.9rem;
  color: #d4d4d4;
  line-height: 1.4;
}

.answer-box {
  border: 1px solid #3a3a3c;
  padding: 18px;
  border-radius: 12px;
  margin: 20px 0;
  background: #1f1f22;
}

.hidden {
  display: none;
}

@media (max-width: 500px) {
  h1 {
    font-size: 2rem;
  }

  .row {
    flex-wrap: wrap;
  }

  .guess-slot,
  .cube {
    width: 46px;
    height: 46px;
  }

  .color-option {
    width: 40px;
    height: 40px;
  }

  .feedback {
    width: 100%;
    text-align: center;
  }
}

/* Floating Quit Button */
.quit-floating {
  position: fixed;
  top: 16px;
  right: 16px;
  background: #b23b3b;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 1000;
}

/* Better spacing for title row */
.guess-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.feedback {
  min-width: 95px;
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 1rem;
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
}

.correct {
  color: #6aaa64;
}

.warning {
  color: #f4a261;
}

/* Top buttons */
.top-actions {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 1000;
}

.top-btn {
  padding: 8px 12px;
  border-radius: 8px;
  background: #3a3a3c;
  color: white;
  border: none;
  cursor: pointer;
}

.danger {
  background: #b23b3b;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #1f1f22;
  padding: 24px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: left;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.hidden {
  display: none;
}