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

body {
  font-family: system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #121212;
  color: #f5f5f5;
  transition: background-color 0.6s ease;
}

.game-container {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-radius: 16px;
  padding: 28px 22px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.04);
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.instructions {
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.attempts {
  font-weight: 600;
  margin-bottom: 16px;
}

#attempts-remaining {
  color: #ffd54f;
}

.input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 16px;
}

#color-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #444;
  background: #1e1e1e;
  color: #f5f5f5;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#color-input:focus {
  outline: none;
  border-color: #7e57c2;
  box-shadow: 0 6px 18px rgba(126,87,194,0.16);
}

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

button {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, #42a5f5, #7e57c2);
  color: #ffffff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(126,87,194,0.18);
}

/* animações */
@keyframes pulseGlow {
  0% { box-shadow: 0 8px 30px rgba(0,0,0,0.6); transform: scale(1); }
  50% { box-shadow: 0 12px 48px rgba(126,87,194,0.32); transform: scale(1.02); }
  100% { box-shadow: 0 8px 30px rgba(0,0,0,0.6); transform: scale(1); }
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* estado de vitória: brilho suave na página e pulso no container */
body.win {
  transition: background-color 0.6s ease;
}
body.win .game-container {
  animation: pulseGlow 900ms ease infinite;
  border-color: rgba(255,255,255,0.08);
}

/* estado de derrota: container treme e fica levemente dessaturado */
body.lose .game-container {
  animation: shake 420ms ease;
  filter: grayscale(0.35) saturate(0.9);
}

/* tremor rápido para input quando erro de palpite inválido */
.input-shake {
  animation: shake 420ms ease;
}

/* destaque do texto de feedback em caso de vitória/derrota */
.feedback.win { color: #c8ffbf; }
.feedback.lose { color: #ffb3b3; }

/* tags/foco */
.tag:active, .tag:focus {
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* preview da cor digitada */
.color-sample {
  width: 64px;
  height: 40px;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
  justify-self: center;
  margin-left: auto;
  margin-right: auto;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.color-sample.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* feedback */
.feedback {
  margin-top: 12px;
  min-height: 1.4em;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.02);
  transition: background 0.2s ease, color 0.2s ease;
  font-weight: 600;
}

/* histórico */
.history {
  list-style: none;
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.history li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  font-size: 0.85rem;
}

.hidden { display: none; }

.credit {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #bdbdbd;
  opacity: 0.9;
}
