*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent2: #a78bfa;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(900px 600px at 80% 15%, rgba(167, 139, 250, 0.18), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.app {
  width: min(900px, 92vw);
  padding: 22px;
}

.header {
  text-align: center;
  margin-bottom: 18px;
}

.header h1 {
  margin: 0 0 6px;
  letter-spacing: 0.4px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.search-card,
.result-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.search-card {
  margin-bottom: 14px;
}

.label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.error-hidden { display: none; }
.error-visible {
  display: block;
  color: #ff6b6b; /* Red warning color */
  font-weight: bold;
  margin-top: 10px;
}

#search-input {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 0 12px;
  font-size: 1rem;
  outline: none;
}

#search-input:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16);
}

#search-button {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  color: #06131a;
  font-weight: 800;
  background: linear-gradient(180deg, var(--accent), #22c55e);
}

#search-button:hover {
  filter: brightness(1.05);
}

.topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#creature-name {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

#creature-id {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.meta {
  display: flex;
  gap: 18px;
  margin-top: 8px;
  color: var(--muted);
}

.types-wrap {
  margin-top: 14px;
}

.types-wrap h3,
.stats h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--muted);
}

.types {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.type-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.stats {
  margin-top: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.stat span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.stat span:last-child {
  font-weight: 900;
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .search-row {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .topline {
    flex-direction: column;
    align-items: flex-start;
  }
}
