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

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #232526, #414345);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.container {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

h1 {
  text-align: center;
  color: #fff;
}

.subtitle {
  text-align: center;
  color: #bbb;
  margin-bottom: 20px;
  font-size: 14px;
}

.guess-row {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.slots {
  display: flex;
  gap: 8px;
}

.slot {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s;
}

.slot.empty {
  background: rgba(255, 255, 255, 0.12);
  border: 2px dashed rgba(255, 255, 255, 0.4);
}

.slot:hover {
  transform: scale(1.05);
}

.actions {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

button {
  background: #ff9800;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #ffb74d;
}

button:disabled {
  background: #666;
  cursor: not-allowed;
}

.palette {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.color {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s;
}

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

.color.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.info {
  text-align: center;
  color: #ddd;
  margin-bottom: 8px;
}

#attemptInfo {
  font-weight: bold;
  margin-bottom: 8px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px;
  font-size: 13px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.dot.black {
  background: #111;
}

.dot.white {
  background: #fff;
  border: 1px solid #888;
}

.dot.empty {
  background: transparent;
  border: 1px dashed #666;
}

h2 {
  color: #fff;
  font-size: 16px;
  margin: 18px 0 10px;
  text-align: center;
}

.history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 4px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 10px;
}

.attempt-num {
  color: #aaa;
  font-size: 13px;
  width: 22px;
  text-align: right;
}

.slot.small {
  width: 32px;
  height: 32px;
}

.dots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.dots .dot {
  width: 12px;
  height: 12px;
  margin: auto;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.overlay-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 420px;
  width: 90%;
}

.overlay-box h2 {
  color: #333;
  margin-bottom: 10px;
}

.overlay-box p {
  color: #555;
  margin-bottom: 12px;
}

.overlay-box .secret-label {
  font-size: 13px;
  margin-bottom: 8px;
}

.overlay-box .slots {
  justify-content: center;
  margin-bottom: 20px;
}

.overlay-box .slot {
  cursor: default;
}

.hidden {
  display: none;
}

/* Setup */
.setup {
  text-align: center;
  color: #fff;
  padding: 20px 0;
}

.setup h2 {
  color: #fff;
  margin-bottom: 16px;
}

.length-options {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.length-btn {
  background: rgba(255, 255, 255, 0.15);
  width: 52px;
  height: 52px;
  padding: 0;
  font-size: 20px;
  border-radius: 10px;
}

.length-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.length-btn.active {
  background: #4caf50;
}

#colorInfo {
  color: #bbb;
  margin-bottom: 16px;
}

.back-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.overlay-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
