/* ── Reset & base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: #f9f9f9;
  color: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem;
}

/* ── Header ── */
h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

/* ── App container ── */
#app {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* ── Stats row ── */
.stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #555;
}

.how-to-play {
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.85rem;
  font-weight: 400;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.how-to-play:hover {
  color: #111;
  background: transparent;
}

/* ── Help modal ── */
.help-modal {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.help-modal p {
  font-size: 1rem;
  color: #333;
}

.help-modal .help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.help-modal label {
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
}

/* ── Hints ── */
#hints {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#hints ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#hints li {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#hints li .hint-num {
  font-size: 0.7rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

#hints img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 3px;
}

/* ── Search / input area ── */
.search-wrapper {
  position: relative;
}

.search-row {
  display: flex;
}

#guess {
  flex: 1;
  border: 1.5px solid #d0d0d0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color 0.15s;
}

#guess:focus {
  border-color: #888;
}
#guess::placeholder {
  color: #aaa;
}

#submit-btn {
  border: 1.5px solid #d0d0d0;
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  background: #111;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

#submit-btn:hover {
  background: #333;
}
#submit-btn:active {
  background: #000;
}

/* ── Hero dropdown ── */
.hero-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
}

.hero-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f0f0f0;
}

.hero-option:last-child {
  border-bottom: none;
}
.hero-option:hover,
.hero-option.active {
  background: #f5f5f5;
}

.hero-option img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #eee;
}

.hero-option span {
  font-size: 0.95rem;
}

/* ── Previous guesses ── */
.guesses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.guess-chip {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #f0f0f0;
  color: #888;
  text-decoration: line-through;
}

/* ── Game over ── */
.answer-reveal {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.answer-reveal img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.answer-reveal .answer-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.answer-reveal .answer-label {
  font-size: 0.8rem;
  color: #888;
}
.answer-reveal .answer-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.outcome-correct {
  border-color: #4caf50;
}
.outcome-wrong {
  border-color: #e53935;
}

.outcome-already-played {
  border-color: #888;
}

.outcome-already-played + p {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
}

/* ── Shared button style ── */
button {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: 1.5px solid #d0d0d0;
  background: #111;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover {
  background: #333;
}

/* ── Footer ── */
footer {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.8rem;
  color: #aaa;
}

footer a {
  color: #888;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 9.5rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 999;
}

.toast span {
  display: inline-block;
  background: #111;
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  white-space: nowrap;
}
