/* ─── Layout ─────────────────────────────────────────────────── */
.pokestats-wrap {
  max-width: 560px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
  text-align: center;
}

.pokestats-header-section { margin-bottom: 1.8rem; }

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

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

/* ─── Stats card ─────────────────────────────────────────────── */
.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem 1.8rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

#stats-bars { display: flex; flex-direction: column; gap: 0.65rem; }

.stat-row {
  display: grid;
  grid-template-columns: 90px 1fr 45px;
  align-items: center;
  gap: 0.6rem;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

.stat-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
  min-width: 4px;
}

.stat-bar-hp  { background: #4ade80; }
.stat-bar-atk { background: #f87171; }
.stat-bar-def { background: #fb923c; }
.stat-bar-spa { background: #60a5fa; }
.stat-bar-spd { background: #a78bfa; }
.stat-bar-spe { background: #facc15; }

.stat-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

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

#pokestats-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;
}

#pokestats-input:focus    { border-color: #34d399; }
#pokestats-input:disabled { opacity: 0.45; cursor: not-allowed; }

#pokestats-autocomplete {
  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);
  text-align: left;
}

#pokestats-autocomplete li { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.75rem; cursor: pointer; font-size: 0.9rem; transition: background 0.1s; }
#pokestats-autocomplete li:hover { background: var(--surface2); }
#pokestats-autocomplete li img { width: 45px; height: 45px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }

/* ─── Shared ─────────────────────────────────────────────────── */
#pokestats-feedback { font-size: 0.85rem; color: var(--text-muted); min-height: 1.2rem; margin-bottom: 0.5rem; }
#pokestats-counter  { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.75rem; }

.wrong-guesses { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; min-height: 1rem; margin-bottom: 0.75rem; }
.wrong-tag { display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.7rem; background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); border-radius: 20px; font-size: 0.8rem; color: #f87171; }
.wrong-tag img { width: 27px; height: 27px; object-fit: contain; image-rendering: pixelated; }

.replay-btn { display: block; margin: 0 auto 1.5rem; 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; opacity: 0.6; transition: opacity 0.15s; }
.replay-btn:hover { opacity: 1; }

#pokestats-result { padding: 1.5rem 2rem; background: var(--surface); border-radius: 14px; border: 1px solid var(--border); text-align: left; }
.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: #34d399; }
.result-timezone { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.6rem; opacity: 0.65; }
