/* ==============================================================================
   ACHIEVEMENTS, CARD DECK & BOUNTY HUNT STYLING
   Pokémon Obsidian & Amber Dark Aesthetic
   ============================================================================== */

/* Screen 4: Achievements & Trophy Room */
#screen-achievements {
  display: none;
  background: radial-gradient(circle at 50% 20%, #1e2430 0%, #0d0f14 100%);
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#screen-achievements.active {
  display: flex;
}

/* Header Navbar */
.achieve-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  z-index: 10;
  border-bottom: 1px solid rgba(255, 211, 42, 0.15);
}

.achieve-title-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.achieve-heading {
  font-family: 'Luckiest Guy', cursive, sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
  color: #ffd32a;
  text-shadow: 0 2px 8px rgba(255, 211, 42, 0.4);
  margin: 0;
}

.achieve-subhead {
  font-size: 11px;
  color: #a4b0be;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Tab Switcher: Boss Cards vs Milestones */
.achieve-tabs {
  display: flex;
  margin: 14px 20px 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.achieve-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #747d8c;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.achieve-tab-btn.active {
  background: #ffa502;
  color: #1e272e;
  box-shadow: 0 4px 12px rgba(255, 165, 2, 0.35);
}

/* Cards Grid */
.cards-scroll-container {
  padding: 12px 18px 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* Individual Trading Card Item - Strict Portrait Aspect Ratio (848 x 1264) */
.roach-card-item {
  position: relative;
  width: 100%;
  aspect-ratio: 848 / 1264;
  background: #14171f;
  border-radius: 14px;
  border: 2px solid rgba(255, 211, 42, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease;
  user-select: none;
  box-sizing: border-box;
}

.roach-card-item:active {
  transform: scale(0.96);
}

.roach-card-item.unlocked {
  border-color: #ffd32a;
}

.roach-card-item.locked {
  border-color: rgba(255, 255, 255, 0.08);
  filter: grayscale(0.85) opacity(0.65);
}

/* Bookmark Ribbon Pin on Top-Left Corner (Horizontal from Left to Right) */
.card-bookmark-pin {
  position: absolute;
  top: 7px;
  left: 0;
  min-width: 28px;
  height: 22px;
  background: linear-gradient(90deg, #ee5253 0%, #ff4757 100%);
  color: #ffffff;
  font-family: 'Luckiest Guy', cursive, sans-serif;
  font-size: 13px;
  line-height: 22px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px 0 5px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
  z-index: 10;
  box-sizing: border-box;
  pointer-events: none;
}

/* Card Art Area Starts from Top:0, Filling Entire Container */
.card-thumb-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.6) 100%);
  overflow: hidden;
  z-index: 1;
}

.card-thumb-art.has-custom-art {
  background: #0d0f14;
}

.card-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.25s ease;
}

.roach-card-item:hover .card-thumb-image {
  transform: scale(1.05);
}

.card-thumb-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px 56px 10px;
  text-align: center;
}

.card-thumb-icon {
  font-size: 54px;
  filter: drop-shadow(0 4px 14px var(--boss-theme, #ffa502));
  transition: transform 0.2s ease;
}

.roach-card-item:hover .card-thumb-icon {
  transform: scale(1.1);
}

.card-thumb-subtitle {
  font-size: 9.5px;
  font-weight: 700;
  color: #a4b0be;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  max-width: 125px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

/* Card Footer Overlapping Lower Side of Card */
.card-thumb-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 9px 9px 9px;
  background: linear-gradient(180deg, rgba(13, 15, 20, 0) 0%, rgba(13, 15, 20, 0.82) 36%, rgba(13, 15, 20, 0.98) 100%);
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  box-sizing: border-box;
  z-index: 4;
  pointer-events: none;
}

.card-thumb-name {
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 13.5px;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.card-thumb-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 8.5px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: rgba(255, 165, 2, 0.18);
  color: #ffa502;
  border: 1px solid rgba(255, 165, 2, 0.4);
  line-height: 1.3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.card-locked-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 5;
}

.card-thumb-tag.legendary {
  background: rgba(255, 211, 42, 0.18);
  color: #ffd32a;
  border-color: #ffd32a;
}

.card-thumb-tag.mythic {
  background: rgba(255, 71, 87, 0.2);
  color: #ff6b81;
  border-color: #ff4757;
}

.card-thumb-tag.rare {
  background: rgba(30, 144, 255, 0.18);
  color: #70a1ff;
  border-color: #1e90ff;
}

.card-thumb-tag.common {
  background: rgba(206, 214, 224, 0.12);
  color: #ced6e0;
  border-color: rgba(206, 214, 224, 0.3);
}

/* Card Inspector Modal */
.card-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card-modal-overlay.active {
  display: flex;
}

.card-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 360px;
  width: 100%;
}

.card-preview-img,
.card-preview-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 960 / 1480;
  object-fit: contain;
  border-radius: 20px;
  background: transparent;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 211, 42, 0.25);
  margin-bottom: 16px;
  display: block;
  transition: filter 0.25s ease, box-shadow 0.25s ease;
}

/* Faded Out Inactive Version for Locked Cards */
.card-preview-img.card-locked-faded,
.card-preview-canvas.card-locked-faded {
  filter: grayscale(0.88) opacity(0.55);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Locked Card Banner */
.modal-lock-banner {
  background: rgba(255, 71, 87, 0.16);
  border: 1px solid rgba(255, 71, 87, 0.4);
  color: #ff6b81;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: 'Luckiest Guy', cursive, sans-serif;
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.modal-lock-banner small {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  color: #dfe6e9;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.card-modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.btn-share-card {
  flex: 1;
  background: #05c46b;
  color: #ffffff;
  border: none;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 196, 107, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.share-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.btn-share-card:active {
  transform: translateY(2px);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f2f6;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-modal.btn-close-expanded {
  flex: 1;
  width: 100%;
  padding: 14px 16px;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 15px;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-close-modal:active {
  transform: translateY(2px);
}

/* Boss Bounty Hunter Selector Modal */
.bounty-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 90;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bounty-modal-overlay.active {
  display: flex;
}

.bounty-card-dialog {
  background: #151821;
  border: 2px solid #ffa502;
  border-radius: 22px;
  max-width: 390px;
  width: 95%;
  max-height: 88vh;
  padding: 18px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
}

.bounty-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
}

.bounty-dialog-title {
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 22px;
  color: #ffd32a;
  margin: 0;
  letter-spacing: 0.5px;
}

.bounty-close-x-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #a4b0be;
  font-size: 16px;
  font-weight: 800;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.bounty-close-x-btn:hover {
  background: rgba(255, 71, 87, 0.25);
  color: #ff4757;
}

.bounty-dialog-desc {
  font-size: 12.5px;
  color: #a4b0be;
  margin: 0 0 14px;
}

/* Boss Buttons Grid */
.bounty-boss-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow-y: auto;
  max-height: 52vh;
  padding-right: 4px;
  margin-bottom: 12px;
}

.bounty-boss-grid::-webkit-scrollbar {
  width: 5px;
}
.bounty-boss-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 165, 2, 0.3);
  border-radius: 6px;
}

/* Individual Boss Profile Button */
.bounty-boss-btn {
  background: linear-gradient(180deg, #1f2430 0%, #171b24 100%);
  border: 1.5px solid rgba(255, 165, 2, 0.35);
  border-radius: 16px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  outline: none;
}

.bounty-boss-btn:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #ffa502;
  box-shadow: 0 8px 20px rgba(255, 165, 2, 0.25);
  background: linear-gradient(180deg, #272e3d 0%, #1e2430 100%);
}

.bounty-boss-btn:active {
  transform: scale(0.97);
}

.bounty-boss-avatar-frame {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2.5px solid #ffa502;
  overflow: hidden;
  background: #0d0f14;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.bounty-boss-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bounty-boss-name {
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.15;
}

.bounty-boss-hp {
  background: rgba(255, 71, 87, 0.2);
  border: 1px solid rgba(255, 71, 87, 0.4);
  color: #ff4757;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.bounty-footer-row {
  width: 100%;
}

.bounty-random-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f2f6;
  border-radius: 12px;
  padding: 11px;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.bounty-random-btn:hover {
  background: rgba(255, 165, 2, 0.2);
  border-color: #ffa502;
  color: #ffd32a;
}

/* =========================================================
   FIRST-TIME IN-GAME CARD UNLOCK POP-UP
   ========================================================= */
.card-unlock-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card-unlock-overlay.active {
  display: flex;
}

.card-unlock-backdrop-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(255, 165, 2, 0.35) 0%, rgba(255, 71, 87, 0.15) 50%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 2s infinite alternate ease-in-out;
}

@keyframes glowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

.card-unlock-dialog {
  position: relative;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 380px;
  width: 100%;
  animation: unlockPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes unlockPopIn {
  0% {
    transform: scale(0.5) translateY(40px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.card-unlock-badge-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #ff9f1a, #ff4757);
  border: 2px solid #ffffff;
  border-radius: 24px;
  padding: 6px 18px;
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
  margin-bottom: 12px;
}

.card-unlock-badge-title {
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 18px;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.card-unlock-sparkle-icon {
  font-size: 16px;
}

.card-unlock-preview-wrap {
  width: 100%;
  max-width: 280px;
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.9));
}

.card-unlock-img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.card-unlock-btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 290px;
}

.btn-unlock-share {
  background: linear-gradient(180deg, #2ed573 0%, #10ac84 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 13px 20px;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 16px;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(46, 213, 115, 0.4);
  transition: transform 0.15s ease;
}

.btn-unlock-share:hover {
  transform: translateY(-2px);
}

.btn-unlock-continue {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f2f6;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 12px 20px;
  font-family: 'Luckiest Guy', sans-serif;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-unlock-continue:hover {
  background: rgba(255, 255, 255, 0.2);
}
