/* ===== MonsterDex v2 — Retro Field Guide ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #f5f0e8;
  font-family: 'Boogaloo', cursive;
  color: #1a0a00;
  min-height: 100vh;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.hidden { display: none !important; }

/* ===== HEADER ===== */
.eyebrow {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #8b3a1a;
  margin-bottom: 10px;
  text-align: center;
}

.tape {
  display: inline-block;
  background: #f1c40f;
  padding: 3px 14px;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #1a0a00;
  transform: rotate(-1.2deg);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.18);
  margin-bottom: 14px;
}

.logo {
  font-family: 'Bangers', cursive;
  font-size: 86px;
  line-height: 0.9;
  letter-spacing: 3px;
  color: #1a0a00;
  text-shadow: 5px 5px 0 #8b3a1a, 3px 3px 0 #c0392b;
  margin-bottom: 8px;
  text-align: center;
}

.scratch {
  width: 75%;
  height: 3px;
  background: repeating-linear-gradient(90deg, #c0392b 0px, #c0392b 8px, transparent 8px, transparent 12px);
  margin: 0 auto 8px;
  border-radius: 2px;
}

.tagline {
  font-size: 16px;
  color: #5a2d0c;
  font-style: italic;
  text-align: center;
  margin-bottom: 26px;
}

/* ===== SEARCH ===== */
.searchbar {
  display: flex;
  background: #fff;
  border: 3px solid #1a0a00;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 4px 4px 0 #1a0a00;
}

.s-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 13px 16px;
  font-family: 'Boogaloo', cursive;
  font-size: 17px;
  color: #1a0a00;
}
.s-input::placeholder { color: rgba(26,10,0,0.28); }

.s-btn {
  background: #c0392b;
  border: none;
  border-left: 3px solid #1a0a00;
  padding: 0 18px;
  color: #fff;
  font-family: 'Bangers', cursive;
  font-size: 21px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.15s;
}
.s-btn:hover { background: #a93226; }

/* ===== CHIPS ===== */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 26px;
  justify-content: center;
}

.chip {
  background: #fff;
  border: 2px solid #1a0a00;
  border-radius: 4px;
  padding: 5px 13px;
  font-family: 'Boogaloo', cursive;
  font-size: 14px;
  color: #1a0a00;
  cursor: pointer;
  box-shadow: 2px 2px 0 #1a0a00;
  transition: all 0.1s;
}

.chip:hover {
  background: #c0392b;
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #1a0a00;
}

/* ===== SECTION HEADERS ===== */
.section-head {
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 2px;
  color: #8b3a1a;
  margin: 0 0 12px;
  border-bottom: 2px dashed #c0a882;
  padding-bottom: 5px;
}

/* ===== ACTION BUTTONS ===== */
.action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 26px;
}

.act-btn {
  background: #fff;
  border: 2px solid #1a0a00;
  border-radius: 6px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a0a00;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.act-btn:hover {
  background: #f5e8d0;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #1a0a00;
}

.act-icon { font-size: 28px; line-height: 1; }
.act-label { font-family: 'Bangers', cursive; font-size: 18px; letter-spacing: 1px; color: #1a0a00; }
.act-sub { font-size: 12px; color: #5a2d0c; letter-spacing: 1px; text-transform: uppercase; }

/* ===== MONSTER CARDS (past searches grid) ===== */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.card {
  background: #fff;
  border: 2px solid #1a0a00;
  border-radius: 6px;
  padding: 13px;
  box-shadow: 3px 3px 0 #1a0a00;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.card:hover {
  background: #fff8f0;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #1a0a00;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-emoji { font-size: 32px; line-height: 1; }

.card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.badge {
  font-family: 'Rubik', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}

.badge-hostile  { background: #ffe0e0; color: #8b0000; border: 1px solid #c0392b; }
.badge-cursed   { background: #f3e0ff; color: #4a0080; border: 1px solid #884ab5; }
.badge-ancient  { background: #fff3cd; color: #7a4500; border: 1px solid #c8a002; }
.badge-lethal   { background: #ffe0e0; color: #8b0000; border: 1px solid #c0392b; }
.badge-cryptid  { background: #e0f0ff; color: #003c7a; border: 1px solid #1a6fbb; }
.badge-type     { background: #f5f0e8; color: #5a2d0c; border: 1px solid #c0a882; }

.card-name {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 1px;
  color: #1a0a00;
  line-height: 1;
  margin-bottom: 3px;
}

.card-origin {
  font-family: 'Rubik', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8b3a1a;
  margin-bottom: 6px;
}

.card-divider {
  height: 1px;
  background: repeating-linear-gradient(90deg, #c0a882 0px, #c0a882 4px, transparent 4px, transparent 7px);
  margin-bottom: 7px;
}

.card-stats {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.stat {
  font-family: 'Rubik', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #5a2d0c;
  background: #f5f0e8;
  border: 1px solid #c0a882;
  border-radius: 3px;
  padding: 2px 6px;
}

.card-danger-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
}

.danger-label {
  font-family: 'Rubik', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5a2d0c;
}

.skulls { font-size: 12px; letter-spacing: 1px; }

/* ===== LOADING STATE ===== */
.loading {
  text-align: center;
  padding: 40px 20px;
  font-size: 20px;
  color: #5a2d0c;
  font-style: italic;
}
.spin { display: inline-block; animation: spin 1.2s linear infinite; font-size: 32px; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-bar {
  width: 60%;
  height: 6px;
  background: #e0d5c4;
  border-radius: 3px;
  margin: 14px auto 0;
  overflow: hidden;
}
.loading-fill {
  width: 30%;
  height: 100%;
  background: #c0392b;
  border-radius: 3px;
  animation: loadSlide 1.5s ease-in-out infinite;
}
@keyframes loadSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ===== RESULT CARD (full detail) ===== */
.result-card {
  background: #fff;
  border: 3px solid #1a0a00;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 5px 5px 0 #1a0a00;
  animation: rise 0.3s ease-out;
}
@keyframes rise { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }

.result-img-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #1a0a00;
}
.result-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: sepia(0.2) contrast(1.05);
}
.result-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(26,10,0,0.85) 100%);
}
.result-img-placeholder {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a0a00;
  font-size: 80px;
  position: relative;
}

.result-header {
  background: #1a0a00;
  padding: 20px 20px 16px;
  border-bottom: 2px dashed #c0a882;
}
.result-name {
  font-family: 'Bangers', cursive;
  font-size: 48px;
  letter-spacing: 3px;
  color: #f5f0e8;
  text-shadow: 3px 3px 0 #c0392b;
  line-height: 1;
  margin-bottom: 4px;
}
.result-aka {
  font-size: 14px;
  color: #c0a882;
  font-style: italic;
  margin-bottom: 10px;
}
.result-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.rbadge {
  font-family: 'Rubik', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
}
.rbadge-origin { background: rgba(241,196,15,0.2); color: #f1c40f; border: 1px solid rgba(241,196,15,0.4); }
.rbadge-type   { background: rgba(192,57,43,0.2); color: #e88; border: 1px solid rgba(192,57,43,0.4); }
.rbadge-danger { background: rgba(120,0,0,0.3); color: #ffaaaa; border: 1px solid rgba(192,57,43,0.5); }

.result-body { padding: 18px 20px; background: #fff; display: grid; gap: 18px; }

.rsection {
  font-family: 'Bangers', cursive;
  font-size: 19px;
  letter-spacing: 2px;
  color: #8b3a1a;
  border-bottom: 2px dashed #c0a882;
  padding-bottom: 5px;
  margin-bottom: 10px;
}

.rdesc {
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #2a1000;
}

.rstat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rstat-block { background: #f5f0e8; border: 1px solid #c0a882; border-radius: 5px; padding: 9px 12px; }
.rstat-label { font-family: 'Rubik', sans-serif; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #8b3a1a; margin-bottom: 2px; }
.rstat-value { font-family: 'Boogaloo', cursive; font-size: 15px; color: #1a0a00; }

.rabilities { display: flex; flex-direction: column; gap: 7px; }
.rability {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #f5f0e8;
  border-left: 3px solid #c0392b;
  padding: 9px 12px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #2a1000;
}
.rability .icon { flex-shrink: 0; font-size: 16px; }

.rweaknesses { display: flex; flex-wrap: wrap; gap: 7px; }
.rweak {
  background: #ffe0e0;
  border: 1px solid #c0392b;
  border-radius: 4px;
  color: #8b0000;
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rappearances { display: flex; flex-direction: column; gap: 5px; }
.rappear {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  color: #5a2d0c;
  font-style: italic;
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.rappear::before { content: '▸'; position: absolute; left: 0; color: #c0392b; font-style: normal; }

.rfunfact {
  background: #fffbe6;
  border: 2px dashed #c8a002;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-style: italic;
  line-height: 1.65;
  color: #4a3000;
}
.rfunfact strong {
  font-style: normal;
  color: #7a4500;
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.back-btn {
  background: #1a0a00;
  border: none;
  border-radius: 6px;
  color: #f5f0e8;
  font-family: 'Bangers', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 12px 20px;
  cursor: pointer;
  width: 100%;
  margin-top: 16px;
  box-shadow: 3px 3px 0 #c0392b;
  transition: all 0.15s;
}
.back-btn:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 #c0392b; }

/* ===== ERROR ===== */
.error-box {
  background: #ffe0e0;
  border: 2px solid #c0392b;
  border-radius: 6px;
  padding: 14px 16px;
  color: #8b0000;
  font-style: italic;
  margin-top: 14px;
  box-shadow: 3px 3px 0 #c0392b;
}

/* ===== PHOTO MODAL ===== */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,10,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-bg.show { display: flex; }

.modal {
  background: #f5f0e8;
  border: 3px solid #1a0a00;
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 6px 6px 0 #1a0a00;
}
.modal-title { font-family: 'Bangers', cursive; font-size: 28px; letter-spacing: 2px; color: #1a0a00; margin-bottom: 14px; }

.upload-area {
  border: 3px dashed #c0a882;
  border-radius: 6px;
  padding: 30px 20px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  margin-bottom: 14px;
}
.upload-area:hover { border-color: #c0392b; background: #fff8f0; }
.upload-area input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.upload-text { font-size: 15px; color: #5a2d0c; font-style: italic; }

#preview-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 5px;
  border: 2px solid #1a0a00;
  display: none;
  margin-bottom: 12px;
}

.modal-btns { display: flex; gap: 8px; }
.modal-btn {
  flex: 1;
  padding: 12px;
  font-family: 'Bangers', cursive;
  font-size: 18px;
  letter-spacing: 1px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid #1a0a00;
}
.modal-btn-go { background: #c0392b; color: #fff; box-shadow: 2px 2px 0 #1a0a00; }
.modal-btn-cancel { background: #fff; color: #1a0a00; box-shadow: 2px 2px 0 #1a0a00; }

/* ===== PAST SEARCHES ===== */
.past-searches { margin-top: 10px; }
.clear-btn {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: 2px dashed #c0a882;
  border-radius: 4px;
  padding: 6px 18px;
  font-family: 'Boogaloo', cursive;
  font-size: 14px;
  color: #8b3a1a;
  cursor: pointer;
  transition: all 0.15s;
}
.clear-btn:hover { border-color: #c0392b; color: #c0392b; }

/* ===== IDENTIFIED BANNER ===== */
.identified-banner {
  background: #e8f5e9;
  border: 2px solid #4caf50;
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  color: #2e7d32;
  text-align: center;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  color: #8b3a1a;
  font-size: 13px;
  font-style: italic;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 2px dashed #c0a882;
}
