/* ─── Layout ─────────────────────────────────────────────────── */
.wordle-wrap {
  max-width: 820px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
}

.wordle-header-section {
  text-align: center;
  margin-bottom: 1.8rem;
}

.wordle-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--yellow) 0%, #ff8c42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  padding-bottom: 0.12em;
}

.wordle-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.35rem;
}

/* ─── Input & autocomplete ───────────────────────────────────── */
.wordle-input-wrap {
  position: relative;
  max-width: 360px;
  margin: 0 auto 1rem;
}

#wordle-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

#wordle-input:focus {
  border-color: var(--yellow);
}

#wordle-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  list-style: none;
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

#autocomplete-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.1s;
}

#autocomplete-list li:hover {
  background: var(--surface2);
}

#autocomplete-list li img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* ─── Counter ────────────────────────────────────────────────── */
#wordle-counter {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* ─── Replay button ──────────────────────────────────────────── */
.replay-btn {
  display: block;
  margin: 0 auto 1rem;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  border: 1px dashed var(--text-muted);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: opacity 0.15s;
  opacity: 0.6;
}

.replay-btn:hover { opacity: 1; }

/* ─── Feedback ───────────────────────────────────────────────── */
#wordle-feedback {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  min-height: 1.4rem;
  margin-bottom: 0.5rem;
}

/* ─── Legend ─────────────────────────────────────────────────── */
.wordle-legend {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-green  { background: rgba(34, 197, 94, 0.5); }
.legend-orange { background: rgba(249, 115, 22, 0.5); }
.legend-red    { background: rgba(239, 68, 68, 0.45); }

.legend-hint {
  opacity: 0.6;
  font-size: 0.72rem;
}

/* ─── Grid ───────────────────────────────────────────────────── */
.wordle-grid-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

#wordle-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  min-width: 520px;
}

#wordle-table thead th {
  padding: 0.4rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
}

#wordle-table thead th:first-child {
  text-align: left;
}

/* ─── Cells ──────────────────────────────────────────────────── */
.cell-name {
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--surface);
  border-radius: 6px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guess-sprite {
  width: 58px;
  height: 58px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.guess-name-info {
  display: flex;
  flex-direction: column;
}

.cell {
  padding: 0.6rem 0.75rem;
  text-align: center;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}

.cell-green  { background: rgba(34, 197, 94, 0.2);  color: #4ade80; }
.cell-orange { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.cell-red    { background: rgba(239, 68, 68, 0.18); color: #f87171; }

/* ─── Reveal animation ───────────────────────────────────────── */
@keyframes cellReveal {
  0%   { opacity: 0; transform: scaleY(0.3) translateY(-6px); }
  60%  { transform: scaleY(1.05); }
  100% { opacity: 1; transform: scaleY(1) translateY(0); }
}

.cell-reveal {
  opacity: 0;
  animation: cellReveal 0.28s ease forwards;
}

.guess-pokemon-name {
  display: block;
}

.guess-count {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.type-badge + .type-badge::before {
  content: ' / ';
  opacity: 0.55;
}

.guess-win .cell-name {
  color: #4ade80;
}

/* ─── Result ─────────────────────────────────────────────────── */
#wordle-result {
  margin-top: 2rem;
  padding: 1.5rem 2rem;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.result-sprite {
  width: 90px;
  height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.result-win  { font-size: 1.4rem; font-weight: 800; color: #4ade80; }
.result-lose { font-size: 1.2rem; font-weight: 800; color: #f87171; }

.result-pokemon-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.result-rank, .result-attempts {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.result-countdown-section {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

.result-countdown-section > p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.result-countdown {
  font-size: 2.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--yellow);
}

.result-timezone {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  opacity: 0.65;
}
