/* Hybrid theme: Tailwind handles layout/spacing; this file adds the
   retro-pixel accents (font, sprite crispness, pixel buttons) plus a
   modern gradient backdrop and card hover/glow effects. */

:root {
  --pixel-font: 'Press Start 2P', monospace;
  --accent: #fbbf24; /* amber-400 */
  --accent-dark: #b45309;
}

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 60%, #020617 100%);
  background-attachment: fixed;
}

.pixel-heading {
  font-family: var(--pixel-font);
  text-shadow: 2px 2px 0 #0f172a;
}

/* Shared control styling for inputs/selects in the header */
.control {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.85rem;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.control:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Pixel-styled buttons (Drive panel, modal close) */
.btn-pixel {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  background: var(--accent);
  color: #1e293b;
  border: 2px solid #1e293b;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  box-shadow: 2px 2px 0 #1e293b;
  cursor: pointer;
}

.btn-pixel:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

.btn-pixel:disabled {
  background: #475569;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Pokémon grid cards */
.card {
  background: linear-gradient(160deg, #1e293b 0%, #111827 100%);
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 10px 25px -10px rgba(251, 191, 36, 0.5);
}

.card img.sprite {
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.card .dex-id {
  font-family: var(--pixel-font);
  font-size: 0.6rem;
  color: #94a3b8;
}

.card .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.card .gen-badge,
.card .pack-badge,
.card .rarity-badge {
  font-size: 0.65rem;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.15rem 0.5rem;
  word-break: break-word;
}

.card .card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Count of wishlisted printings shown on a species card */
.card .wish-count-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: #fecdd3;
  background: #9f1239;
  border: 1px solid #be123c;
  border-radius: 0.375rem;
  padding: 0.15rem 0.5rem;
}

/* Real card art shown in the My Wishlist card grid */
.card img.wish-card-image {
  width: 120px;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.6);
}

.card img.wish-card-image.sprite {
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
}

/* Wishlist toggle inside the View Card modal */
.modal-wishlist-btn {
  display: block;
  width: 100%;
}

.wishlist-btn {
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  color: #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.wishlist-btn:hover {
  border-color: var(--accent);
}

.wishlist-btn.active {
  background: #be123c;
  border-color: #be123c;
  color: #fff1f2;
}

.view-card-btn {
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  color: #1e293b;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.view-card-btn:hover {
  filter: brightness(1.1);
}

.view-card-btn:disabled {
  background: #475569;
  border-color: #475569;
  color: #94a3b8;
  cursor: not-allowed;
}

/* TCG card modal */
#card-modal.flex {
  display: flex;
}

.tcg-card-image {
  width: 100%;
  max-width: 300px;
  border-radius: 1rem;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  align-self: center;
}

.tcg-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #0f172a;
  border: 1px dashed #475569;
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* "View Card" modal: thumbnail strip of every printing/expansion */
.tcg-version-gallery {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.tcg-version-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 88px;
  padding: 0;
  border: 2px solid #334155;
  border-radius: 0.5rem;
  background: #0f172a;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}

.tcg-version-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcg-version-thumb-label {
  font-size: 0.55rem;
  color: #cbd5e1;
  padding: 0.25rem;
  text-align: center;
  word-break: break-word;
}

.tcg-version-thumb:hover {
  border-color: var(--accent-dark);
}

.tcg-version-thumb.active {
  border-color: var(--accent);
}

/* Marks a printing that's in the wishlist */
.tcg-version-thumb.wished {
  position: relative;
}

.tcg-version-thumb.wished::after {
  content: '★';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 0.7rem;
  color: #fb7185;
  text-shadow: 0 0 2px #000;
  pointer-events: none;
}

/* "View Card" modal: how-many-printings selector above the gallery */
.tcg-count-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.tcg-count-label {
  font-size: 0.7rem;
  color: #cbd5e1;
}

.tcg-count-btn {
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border: 2px solid #334155;
  border-radius: 0.4rem;
  background: #0f172a;
  color: #cbd5e1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.tcg-count-btn:hover {
  border-color: var(--accent-dark);
}

.tcg-count-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.tcg-count-total {
  font-size: 0.6rem;
  color: #64748b;
  margin-left: auto;
}

.tcg-card-details h2 {
  font-family: var(--pixel-font);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.tcg-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #334155;
  color: #f1f5f9;
  margin-right: 0.25rem;
}

.tcg-attack {
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.6rem;
  background: #0f172a;
}

.tcg-attack .attack-name {
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.tcg-attack .attack-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-top: 0.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  z-index: 100;
  text-align: center;
  padding: 1rem;
}

.loading-overlay.hidden {
  display: none;
}

.pixel-spinner {
  width: 32px;
  height: 32px;
  background: var(--accent);
  animation: spin 1s steps(8) infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
