@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  /* TextingPrince Branding */
  --tp-purple: #4F2683; /* Minnesota Vikings Purple */
  --tp-purple-dark: #2A104E; 
  --tp-gold: #D4AF37;   
  --tp-gold-light: #F9E596;
  --tp-black: #0D0D0D;
  --tp-white: #F0F0F0;
  --tp-purple-light: #6A3FA3;
  
  /* Game States */
  --color-correct: #2ECC71; 
  --color-partial: #F1C40F; /* New Yellow for 1-point answers */
  --color-incorrect: #E74C3C; 
  
  /* Glassmorphism */
  --glass-bg: rgba(26, 26, 26, 0.85);
  --glass-border: rgba(212, 175, 55, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

i {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", sans-serif !important;
}

body {
  background: radial-gradient(circle at center, #5D2A8D 0%, #1a0a2e 50%, #050105 100%);
  background-color: #050105;
  color: var(--tp-white);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent scrolling for Visual Novel feel */
}

/* --- HUD (Heads Up Display) --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(13, 13, 13, 0.7);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 100;
}

.level-title {
  color: var(--tp-gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  flex: 1;
}

.powerup-container {
  flex: 1;
  text-align: center;
}

.btn-powerup {
  background: var(--color-primary);
  border: 2px solid var(--color-accent);
  color: var(--color-bg);
  padding: 5px 15px;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-powerup:hover {
  background: var(--color-accent);
}
.btn-powerup:disabled {
  background: #555;
  border-color: #333;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
  border-color: #555;
  color: #555;
}

.stats {
  display: flex;
  gap: 2rem;
  font-weight: 600;
  flex: 1;
  justify-content: flex-end;
}

.lives-container {
  display: flex;
  gap: 5px;
}

.heart {
  color: var(--tp-gold);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.heart.lost {
  color: rgba(255, 255, 255, 0.2);
  transform: scale(0.8);
}

/* --- Main Layouts --- */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100vh;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  animation: fadeIn 0.5s ease forwards;
}

.screen.active {
  display: flex;
}

/* --- Start Screen --- */
#start-screen {
  background-image: url('assets/start_bg.png');
  background-size: cover;
  background-position: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.start-card {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

/* --- Visual Novel RPG Screen --- */
#rpg-container {
  width: 100%;
  height: 100%;
  background-image: url('assets/neutral.png');
  background-size: cover;
  background-position: center top;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Anchors dialogue to the bottom */
  align-items: center;
  padding-bottom: 2rem;
  transition: background-image 0.2s ease-in-out;
}

#dialogue-view {
  width: 95%;
  max-width: 700px;
  max-height: 55vh; /* Prevents going too high on mobile */
  overflow-y: auto;
  border-radius: 15px;
  z-index: 10;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  padding: 1.5rem;
}

.rpg-content {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.rpg-content.active {
  display: block;
}

/* --- Glass Cards --- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.text-center {
  text-align: center;
}

/* --- Typography --- */
h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--tp-gold);
  text-transform: uppercase;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

/* Boss Battle Specific Sizing */
.boss-mode #question-text {
  font-size: 1.5rem;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  color: #fff;
}

/* Dialogue Color-Coding in Boss Babe Battles */
.guy-talk, .dialogue-guy {
  color: #33ccff !important; /* Vibrant high-readability light blue */
  font-weight: 700;
  text-shadow: 0 0 5px rgba(51, 204, 255, 0.4);
}
.girl-talk, .dialogue-girl {
  color: #ff66b2 !important; /* Vibrant high-readability pink */
  font-weight: 700;
  text-shadow: 0 0 5px rgba(255, 102, 178, 0.4);
}

p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.2rem;
  color: #DDD;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  background: transparent;
  color: var(--tp-gold);
  border: 2px solid var(--tp-gold);
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn:hover {
  background: var(--tp-gold);
  color: var(--tp-black);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-primary {
  background: var(--tp-gold);
  color: var(--tp-black);
}

.btn-primary:hover {
  background: var(--tp-gold-light);
}

.btn-full { width: 100%; }
.btn-claim { margin-top: 1.5rem; }
.btn-boss-start { margin-top: 2rem; }
.btn-next-level { margin-top: 1.5rem; }
.btn-recap {
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--tp-gold);
    color: var(--tp-gold);
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-recap:hover {
    background: var(--tp-gold);
    color: var(--tp-black);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* --- Form Elements --- */
.player-name-input {
  padding: 0.8rem;
  font-size: 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--tp-gold);
  background: rgba(0,0,0,0.5);
  color: white;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.start-input-wrapper { margin-top: 2rem; }

/* --- Quiz Header --- */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.question-progress-label {
  color: var(--tp-gold);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.boss-timer-display {
  display: none;
  color: var(--color-incorrect);
  font-weight: bold;
  font-size: 1.1rem;
}

/* --- Victory Titles --- */
.victory-title {
  color: var(--color-correct);
  text-shadow: 0 0 15px var(--color-correct);
}

.reward-unlock-title {
  color: var(--tp-gold);
  text-shadow: 0 0 10px rgba(230, 194, 0, 0.5);
}

.reward-name {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.reward-preview-badge {
  background: rgba(13,13,13,0.9);
  border: 2px solid var(--tp-gold);
  border-radius: 8px;
  padding: 12px 20px;
  display: inline-block;
  margin: 1rem 0;
  box-shadow: 0 0 15px rgba(230, 194, 0, 0.3);
}

.reward-badge-label {
  color: var(--tp-gold);
  font-weight: bold;
  font-size: 1.2rem;
}

.reward-badge-value {
  font-weight: bold;
  font-size: 1.2rem;
  margin-left: 5px;
}

.reward-description {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.recap-title {
  color: var(--color-correct);
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  margin-bottom: 0.5rem;
}

.recap-subtitle {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* --- Game Over --- */
.game-over-title {
  color: var(--color-incorrect);
  margin-bottom: 1rem;
}

.game-over-message {
  margin-bottom: 2rem;
}

.game-over-insight-box {
  background: rgba(74, 21, 75, 0.6);
  padding: 1.2rem;
  border-left: 4px solid var(--tp-gold);
  border-radius: 8px;
  text-align: left;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  display: none;
}

.game-over-insight-box.active {
  display: block;
}

.game-over-insight-title {
  color: var(--tp-gold);
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.game-over-insight-text {
  font-size: 0.95rem;
  color: #DDD;
}

/* --- Reward Video --- */
.reward-video-player {
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
  border: 1px solid var(--tp-gold);
}

/* --- Display Utilities --- */
.hud-hidden { display: none; }
.rpg-hidden { display: none; }
.powerup-hidden { display: none; }
.shield-hidden { display: none; }

/* --- Quiz UI --- */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--tp-white);
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.option-btn:hover:not(.disabled) {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--tp-gold);
  transform: translateX(3px);
}

/* Option States */
.option-btn.selected-correct {
  background: var(--color-correct) !important;
  border-color: var(--color-correct) !important;
  color: white !important;
}

.option-btn.selected-incorrect {
  background: var(--color-incorrect) !important;
  border-color: var(--color-incorrect) !important;
  color: white !important;
}

.option-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.option-btn.eliminated {
  text-decoration: line-through;
  opacity: 0.3;
  pointer-events: none;
  background: transparent;
  border-color: #333;
}

/* --- Insight Popup --- */
.insight-box {
  margin-top: 1rem;
  padding: 1.2rem;
  background: rgba(74, 21, 75, 0.6); 
  border-left: 4px solid var(--tp-gold);
  border-radius: 0 8px 8px 0;
  text-align: left;
  display: none;
  animation: slideIn 0.3s ease forwards;
}

.insight-box.active {
  display: block;
}

.insight-title {
  color: var(--tp-gold);
  font-weight: 800;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.insight-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.next-action {
  margin-top: 1rem;
  display: none;
}
.next-action.active {
  display: block;
}

/* --- Game Over / Rejection Screen --- */
.rejection-stamp {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 5rem;
  font-weight: 900;
  color: var(--color-incorrect);
  text-shadow: 0 0 20px rgba(0,0,0,1);
  border: 6px solid var(--color-incorrect);
  padding: 0.5rem 1.5rem;
  border-radius: 10px;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}

.rejection-stamp.active {
  animation: stamp-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stamp-in {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-15deg) scale(2); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-15deg) scale(1); }
}

#game-over-content h2 {
  font-size: 2.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#game-over-message {
  font-size: 1.3rem;
  line-height: 1.6;
}

/* Resume Button & Glow */
.btn-resume {
    background: linear-gradient(135deg, #FFD700, #ff0099) !important;
    color: black !important;
    font-weight: 800 !important;
    border: none !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.btn-resume:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 0, 153, 0.6);
}

.glow-animation {
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 153, 0.7); }
    100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.4); }
}

/* Onboarding Transitions */
.landing-form > div {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Boss Screen --- */
.boss-warning {
  margin-bottom: 1rem;
}

.glitch-text {
  color: var(--color-incorrect);
  font-size: 2.2rem;
  font-weight: 900;
  animation: glitch-anim 0.6s infinite;
  text-transform: uppercase;
  letter-spacing: 4px;
}

.solid-text {
  color: var(--color-incorrect);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.5rem;
}

@keyframes glitch-anim {
  0% { transform: translate(0) }
  20% { transform: translate(-3px, 3px) }
  40% { transform: translate(-3px, -3px) }
  60% { transform: translate(3px, 3px) }
  80% { transform: translate(3px, -3px) }
  100% { transform: translate(0) }
}

/* Boss Atmosphere Overlay */
#rpg-container.boss-mode::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  box-shadow: inset 0 0 150px rgba(255, 0, 0, 0.6);
  background: rgba(20, 0, 0, 0.3); /* Slight red tint over everything */
  pointer-events: none;
  animation: pulse-overlay 2s infinite;
  z-index: 1;
}

@keyframes pulse-overlay {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Boss Dialogue Box styling */
#rpg-container.boss-mode #dialogue-view {
  border-color: var(--color-incorrect);
  background: rgba(40, 10, 10, 0.9);
  animation: boss-box-pulse 2s infinite;
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes boss-box-pulse {
  0% { box-shadow: 0 0 20px rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 0 40px rgba(231, 76, 60, 0.8); }
  100% { box-shadow: 0 0 20px rgba(231, 76, 60, 0.4); }
}

/* Boss Entry Heavy Shake */
@keyframes boss-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-15px, -15px) rotate(-2deg); }
  20% { transform: translate(15px, 15px) rotate(2deg); }
  30% { transform: translate(-15px, 15px) rotate(-2deg); }
  40% { transform: translate(15px, -15px) rotate(2deg); }
  50% { transform: translate(-10px, -10px) rotate(-1deg); }
  60% { transform: translate(10px, 10px) rotate(1deg); }
  70% { transform: translate(-5px, 5px) rotate(-1deg); }
  80% { transform: translate(5px, -5px) rotate(1deg); }
  90% { transform: translate(-2px, -2px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.boss-shake-effect {
  animation: boss-shake 0.8s cubic-bezier(.36,.07,.19,.97) both;
}

/* --- Victory Screen --- */
.victory-bg {
  background-image: url('assets/bikini.png');
  background-size: cover;
  /* Shift background down on mobile so it's not too zoomed into the face */
  background-position: center 25%;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.victory-layout-container {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 20px;
  justify-content: center; /* Center on mobile, override on desktop */
  align-items: center;
  box-sizing: border-box;
  overflow-y: auto; /* Allow scrolling if content is too tall */
}

.victory-card {
  max-width: 500px;
  width: 100%;
  text-align: center;
  /* More transparent background with less blur to reveal the reward image clearly */
  background: rgba(13, 13, 13, 0.45) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Old review video styles removed — see upgraded styles below */


.video-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.5);
  margin-top: 1rem;
}

.hidden {
  display: none !important;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-red {
  0% { opacity: 0.8; }
  50% { opacity: 1; text-shadow: 0 0 15px var(--color-incorrect); }
  100% { opacity: 0.8; }
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-8px); }
  100% { transform: translateX(0); }
}

.shake-effect {
  animation: shake 0.3s ease;
}

/* --- Frame Shield Styles (Global) --- */
#hud-shield-container {
  background: rgba(255, 215, 0, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--tp-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeIn 0.5s ease;
}

.shield-activation-popup {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--tp-gold);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  z-index: 1000;
  text-align: center;
  color: var(--tp-gold);
  font-weight: bold;
  font-size: 1.4rem;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
  pointer-events: none;
  animation: shield-pop 2.5s ease forwards;
}

.shield-activation-popup i {
  display: block;
  font-size: 3rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 10px var(--tp-gold));
}

.shield-activation-popup span {
  display: block;
  font-size: 0.9rem;
  color: #DDD;
  margin-top: 0.5rem;
  font-weight: normal;
}

@keyframes shield-pop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  25% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  85% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

/* --- Review Videos (Upgraded) --- */
.recommended-videos {
  margin-top: 1.5rem;
  max-width: 500px;
  width: 100%;
  background: linear-gradient(135deg, rgba(74, 21, 75, 0.4), rgba(26, 26, 26, 0.95)) !important;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
}

.recommended-videos h3 {
  color: var(--tp-gold);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.recommended-videos .review-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}

.video-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.video-list li:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--tp-gold);
  transform: translateX(4px);
}

.video-list li .play-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--tp-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tp-gold);
  font-size: 0.7rem;
}

.video-list li .video-title {
  color: var(--tp-white);
  font-weight: 500;
}

/* On mobile: hide the Struggling panel on win/video/reward steps — it only shows in Step 3 (Recap) */
@media (max-width: 768px) {
  .recommended-videos {
    display: none;
  }

  /* Reward video — centered and full-width so players really feel the reward */
  #victory-video-container {
    width: 100%;
  }
  #victory-video-container .reward-video-player {
    width: 100%;
    max-height: 55vh;
    border-radius: 10px;
  }

  /* Step 3 on mobile: show the Struggling panel full-width below the PDF button */
  #victory-step-3 .recommended-videos {
    display: block !important;
    max-width: 100%;
    margin-top: 1.5rem;
  }
}

/* --- Desktop Layout Adjustments (Visual Novel Split) --- */
@media (min-width: 769px) {
  #rpg-container {
    display: flex;
    flex-direction: row;
    justify-content: center; /* Direct center quiz */
    align-items: center;
    padding-bottom: 0;
    padding-right: 0;
    /* Zoom slightly and align right edge to push the center-drawn character to the left 1/3rd mark */
    background-size: 130vw auto !important; 
    background-position: right center !important; 
  }

  #rpg-container #dialogue-view {
    position: relative;
    top: auto;
    left: auto !important;
    transform: none;
    width: 50%;
    max-width: 600px;
    max-height: 85vh;
    margin: 0;
    z-index: 10;
  }

  #victory-screen {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 0;
    padding-right: 0;
    background-size: 110%;
    background-position: 20% 30%;
  }

  .victory-layout-container {
    align-items: flex-end;
    padding-right: 8%;
  }

  .victory-card {
    width: 45%;
    max-width: 500px;
    max-height: 80vh;
  }

  .rejection-stamp {
    left: 50%;
  }

  .text-popup {
    top: -200px;
    left: 6%; /* Push left towards the character */
    transform: none;
    width: 44vw;
    max-width: 650px;
  }
  .text-popup.show {
    top: 12%; /* Keep it near the top left over her shoulder */
    transform: none;
  }
  .point-popup {
    left: 50%; /* Center over the dialogue box */
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  /* ── Compact single-row HUD on mobile ── */
  header {
    flex-wrap: nowrap;
    padding: 4px 8px;
    min-height: 0;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
    height: auto;
  }

  /* Hide the level title — takes up too much space */
  .level-title { display: none !important; }

  /* Forfeit button — small, left side */
  #forfeit-level-btn {
    font-size: 0.6rem !important;
    padding: 3px 6px !important;
    white-space: nowrap;
  }

  /* Stats row — compress */
  .stats {
    gap: 6px;
    font-size: 0.75rem;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    overflow: visible;
  }

  /* Make hearts larger and easier to see */
  .lives-container { gap: 3px; }
  .heart { font-size: 1.1rem !important; }

  /* Gems and tokens — smaller */
  .status-gem-container,
  .tokens-container { margin-left: 6px !important; }

  /* Audio buttons — always visible, small */
  .audio-toggles {
    margin-left: 6px !important;
    gap: 4px !important;
    flex-shrink: 0;
  }
  .audio-toggles .audio-btn {
    padding: 3px 5px !important;
    font-size: 0.75rem !important;
  }

  /* Score — hide on mobile to save space */
  .score-container { display: none; }

  /* Powerup bar — hide completely on mobile until earned */
  .powerup-container { display: none !important; }

  /* RPG container — give back space */
  #rpg-container { padding-bottom: 10px; }
  #dialogue-view { width: 98%; padding: 1rem; max-height: 60vh; }
  .rejection-stamp { font-size: 3rem; border-width: 4px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.1rem; }
  p { font-size: 0.95rem; }
  .option-btn { padding: 0.6rem 0.8rem; font-size: 0.95rem; }
}


/* Boss Timer Urgency */
#boss-timer.urgent {
  animation: timer-pulse 0.5s infinite alternate;
}

@keyframes timer-pulse {
  from { transform: scale(1); opacity: 1; text-shadow: 0 0 5px var(--color-incorrect); }
  to { transform: scale(1.2); opacity: 0.8; text-shadow: 0 0 15px var(--color-incorrect); }
}

/* Boss Text Pop-in Animation */
.text-popup {
  position: absolute;
  top: -200px; /* Start far above screen */
  right: 10px;
  width: 75%;
  max-width: 360px;
  z-index: 20;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.text-popup.show {
  /* Land in the top-right — visible near the character's shoulder, above the dialogue box */
  top: 6%;
  opacity: 1;
}

/* On mobile, push the text popup BELOW the slim HUD bar so it is never covered */
@media (max-width: 768px) {
  .text-popup {
    right: 8px;
    width: 82%;
    max-width: 340px;
  }
  .text-popup.show {
    top: 52px; /* Clears the compact mobile HUD bar height */
    opacity: 1;
  }
}

/* text-popup desktop rules merged into main media query above */

/* --- Point Popups --- */
.point-popup {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  font-weight: 900;
  z-index: 50;
  pointer-events: none;
  text-shadow: 0 0 15px rgba(0,0,0,0.8), 0 0 5px rgba(255,255,255,0.3);
  opacity: 0;
}

.point-popup.animate {
  animation: float-up-fade 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes float-up-fade {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -100px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -200px) scale(1); }
}

/* --- Progress Bar --- */
.modal-overlay.hidden {
  display: none !important;
}

/* ─── Landing Page Overlay ─── */
.landing-overlay {
    background-image: url('assets/start_bg.png'); /* Default Desktop 16:9 */
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Above everything */
}

/* Mobile Background Swap */
@media (max-width: 768px) {
    .landing-overlay {
        background-image: url('assets/start_bg_mobile.png'); /* Mobile 1:1 */
    }
}

.landing-overlay::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(30, 0, 50, 0.4), rgba(0, 0, 0, 0.85));
    backdrop-filter: blur(4px);
}

.landing-card {
    max-width: 500px;
    width: 90%;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.landing-logo {
    width: 220px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 0, 153, 0.6));
    animation: logo-float 3s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.landing-title {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
    color: var(--tp-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    margin-bottom: 0.5rem;
}

.landing-subtitle {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 2rem;
}

.landing-form {
    margin-bottom: 2rem;
}

.landing-footer p {
    font-size: 0.9rem;
    color: #888;
}

.landing-footer a {
    color: var(--tp-gold);
    text-decoration: none;
    font-weight: bold;
}

.landing-footer a:hover {
    text-decoration: underline;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.progress-tracker-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 20px;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 5;
}

.progress-dot {
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.progress-dot.active {
  background: var(--tp-gold);
  box-shadow: 0 0 10px var(--tp-gold);
  transform: scale(1.2);
}

.progress-dot.completed {
  background: var(--color-correct);
  box-shadow: 0 0 8px var(--color-correct);
}

.progress-dot.boss {
  width: 18px;
  height: 18px;
  margin-top: -3px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: var(--color-incorrect); /* Red for Boss */
}

.progress-dot.boss.active {
  background: var(--color-incorrect);
  box-shadow: 0 0 15px var(--color-incorrect);
  transform: scale(1.4) rotate(360deg);
}

/* Confidence Bar Upgrade */
.confidence-bar-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  border: 2px solid var(--tp-gold);
  background: var(--tp-black);
  color: #fff;
  padding: 0;
  border-radius: 20px;
}
.confidence-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: var(--tp-gold);
  transition: width 0.4s ease-out;
  z-index: 1;
}
.confidence-content {
  position: relative;
  z-index: 2;
  padding: 5px 15px;
  width: 100%;
  font-weight: bold;
  color: var(--tp-black);
}
.confidence-bar-btn.ready .confidence-fill {
  background: var(--tp-gold);
}
.confidence-bar-btn.ready {
  animation: glow-gold 2s infinite;
  border-color: #FFF;
}
.confidence-bar-btn.recharging .confidence-fill {
  background: rgba(212, 175, 55, 0.4);
}
.confidence-bar-btn.recharging .confidence-content {
  color: #ddd;
}
.confidence-bar-btn.empty .confidence-fill {
  width: 0% !important;
}
.confidence-bar-btn.empty .confidence-content {
  color: #888;
}

@keyframes glow-gold {
  0% { box-shadow: 0 0 5px var(--tp-gold); }
  50% { box-shadow: 0 0 20px var(--tp-gold), inset 0 0 10px var(--tp-gold); }
  100% { box-shadow: 0 0 5px var(--tp-gold); }
}

/* Neon Pink Text */
.neon-pink {
  color: #ff66cc;
  text-shadow: 0 0 5px #ff66cc, 0 0 10px #ff66cc, 0 0 20px #ff0099, 0 0 40px #ff0099;
  font-weight: bold;
}

.neon-pink-plain {
  color: #ff66cc;
  font-weight: bold;
}

/* Target Map Screen */
.target-map-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a051a 0%, #0d0d0d 100%);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  box-sizing: border-box;
  overflow-y: auto;
  z-index: 100;
  align-items: center;
}

.target-map-title {
  color: var(--tp-gold);
  text-transform: uppercase;
  font-size: 2.5rem;
  letter-spacing: 4px;
  margin-bottom: 0.5rem;
  text-align: center;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.target-map-subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  margin-bottom: 3rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.target-map-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  padding-bottom: 2rem;
  display: flex;
  justify-content: center;
}

/* The path line connecting the targets */
.map-path-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--tp-gold), var(--tp-gold) 10px, transparent 10px, transparent 20px);
  z-index: 1;
  opacity: 0.2;
}

.target-map-grid {
  display: flex;
  justify-content: center;
  gap: 40px;
  width: 100%;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .target-map-grid {
    gap: 20px;
  }
}

.target-card {
  background: rgba(30, 30, 30, 0.9);
  border: 2px solid #444;
  border-radius: 15px;
  width: 220px;
  aspect-ratio: 3/4.5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 20px 10px;
}

.target-card-level {
  font-size: 0.75rem;
  color: var(--tp-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  margin-bottom: 5px;
  opacity: 0.8;
}

.target-card.current {
  border-color: var(--tp-gold);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
  transform: scale(1.05);
  animation: current-target-glow 2s infinite alternate;
}

@keyframes current-target-glow {
  from { box-shadow: 0 0 15px rgba(212, 175, 55, 0.3); border-color: var(--tp-gold); }
  to { box-shadow: 0 0 40px rgba(212, 175, 55, 0.7); border-color: #fff; }
}

.video-controls {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.skip-btn {
  font-size: 0.85rem !important;
  padding: 0.5rem 1.2rem !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: rgba(255,255,255,0.6) !important;
  background: rgba(0,0,0,0.3) !important;
}

.skip-btn:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
}

.target-card.unlocked {
  border-color: var(--tp-gold);
  background: rgba(20, 20, 20, 0.9);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.target-card.defeated {
  border-color: var(--color-correct);
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.2);
}

.target-card.current {
  border-color: var(--tp-gold);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
  transform: scale(1.05);
  animation: current-target-pulse 2s infinite;
}

@keyframes current-target-pulse {
  0% { box-shadow: 0 0 10px var(--tp-gold); }
  50% { box-shadow: 0 0 40px var(--tp-gold); }
  100% { box-shadow: 0 0 10px var(--tp-gold); }
}

.target-card-img {
  width: 90%;
  height: 70%;
  object-fit: contain;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.target-card:hover .target-card-img {
  transform: scale(1.1);
}

.target-card.locked .target-card-img {
  filter: brightness(0);
  opacity: 0.3;
}

.target-card-name {
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.target-card.locked .target-card-name {
  color: #555;
  font-size: 0.8rem;
}

/* Status Badges */
.status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  z-index: 5;
}

.badge-defeated {
  background: var(--color-correct);
  color: white;
}

.badge-locked {
  background: #333;
  color: #888;
}

.badge-target {
  background: var(--tp-gold);
  color: black;
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0.6; }
}

/* ─── A/B/C/D Option Letter Labels ─── */
.option-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    width: 28px;
    height: 28px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--tp-gold);
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-btn:hover:not(.disabled) .option-letter {
    background: rgba(212, 175, 55, 0.4);
    border-color: var(--tp-gold);
}

.option-text {
    flex: 1;
    text-align: left;
}

/* Keyboard hint (desktop only) */
.key-hint {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-family: monospace;
    color: rgba(255,255,255,0.3);
    margin-left: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .key-hint { display: none; }
}

/* ─── Streak Fire Popup ─── */
.streak-popup {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    text-align: center;
    pointer-events: none;
    animation: streak-float 2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.streak-fire {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(255, 100, 0, 0.8));
}

.streak-text {
    font-size: 1.6rem;
    font-weight: 900;
    color: #FF6B35;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.9), 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 2px;
    margin-top: 4px;
}

@keyframes streak-float {
    0%   { opacity: 0; transform: translate(-50%, 20px) scale(0.5); }
    20%  { opacity: 1; transform: translate(-50%, -20px) scale(1.15); }
    60%  { opacity: 1; transform: translate(-50%, -50px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -110px) scale(0.9); }
}

/* ─── Score Grade Badge ─── */
.grade-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border-radius: 10px;
    border: 2px solid currentColor;
    margin-bottom: 0.75rem;
    animation: fadeIn 0.5s ease;
    background: rgba(0,0,0,0.4);
}

.grade-letter {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
}

.grade-label {
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.personal-best-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
    animation: fadeIn 0.5s ease;
}

/* ─── Start Screen Arcade Upgrade ─── */
.main-logo {
    max-width: 90%;
    margin: 0 auto 15px auto;
    display: block;
    animation: logo-pulse 3s ease infinite;
}

@keyframes logo-pulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.8)); transform: scale(1.02); }
}

.ranked-slam-logo {
    animation: slam-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, shake-impact 0.4s ease-out 0.6s;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.8));
}

@keyframes slam-in {
    0% { transform: scale(3) translateY(-100px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes shake-impact {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-5px, 5px); }
    40% { transform: translate(5px, -5px); }
    60% { transform: translate(-5px, -5px); }
    80% { transform: translate(5px, 5px); }
    100% { transform: translate(0, 0); }
}

.level-preview-pills {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.level-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid;
}

.level-pill.unlocked {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--tp-gold);
    color: var(--tp-gold);
}

.level-pill.locked {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.3);
}

/* Mobile: show level title again using a smaller version */
@media (max-width: 768px) {
    .level-title {
        display: block !important;
        font-size: 0.65rem;
        letter-spacing: 1px;
        text-align: center;
        flex-basis: 100%;
        order: -1;
        padding-bottom: 2px;
    }
    .stats { justify-content: center; }
    .powerup-container { order: 1; width: 100%; text-align: center; margin-top: 4px; }
}

/* ─── Start Screen Hotkey Hints ─── */
.hotkey-hint {
    font-size: 0.9rem !important;
    color: rgba(255,255,255,0.45) !important;
    margin-top: 1.2rem !important;
    margin-bottom: 0.5rem !important;
    background: rgba(0,0,0,0.3);
    padding: 12px 16px;
    border-radius: 10px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.05);
}

.hotkey-hint kbd {
    background: rgba(255,255,255,0.15);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--tp-gold);
    font-family: monospace;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 0 rgba(0,0,0,0.5);
}

/* ─── Start Screen Nav Buttons ─── */
.start-action-row {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.start-nav-btn {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: white !important;
    font-size: 0.85rem !important;
    padding: 8px 14px !important;
    flex: 1;
    min-width: 90px;
}

/* Hide keyboard hints on mobile — they only apply to desktop keyboard users */
@media (max-width: 768px) {
    .hotkey-hint { display: none !important; }
}

/* ─── Reward Video Controls ─── */
.reward-video-player {
    max-height: 60vh; /* Prevent video from pushing controls off screen */
    width: 100%;
    object-fit: contain;
    background: black;
    margin-bottom: 10px;
}

.video-controls {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.4);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile Level Title fix */
@media (max-width: 768px) {
    .level-title {
        font-size: 0.75rem !important;
        margin-bottom: 5px;
    }
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    border: 2px solid var(--tp-gold);
}

.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    background: none; border: none;
    color: white; font-size: 1.5rem;
    cursor: pointer; opacity: 0.7;
}

.modal-close:hover { opacity: 1; color: var(--color-incorrect); }

.modal-close-floating {
    position: absolute;
    top: 30px;
    right: 40px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    z-index: 1100;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.modal-close-floating:hover {
    background: #ff0099;
    border-color: #ff0099;
    color: #fff;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 20px rgba(255, 0, 153, 0.6);
}

@media (max-width: 600px) {
    .modal-close-floating {
        top: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
}

.modal-title {
    text-align: center; margin-bottom: 1.5rem;
    color: white; letter-spacing: 2px; text-transform: uppercase;
}

.leaderboard-list {
    display: flex; flex-direction: column; gap: 10px;
}

.leaderboard-item {
    display: flex; align-items: center;
    padding: 10px 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
}

.leaderboard-item .rank { width: 40px; font-weight: bold; color: #888; font-size: 1.1rem; }
.leaderboard-item .player-name { flex: 1; font-weight: bold; color: white; }
.leaderboard-item .badges { width: 60px; text-align: center; font-size: 1.2rem; }
.leaderboard-item .score { width: 90px; text-align: right; color: var(--tp-gold); font-weight: bold; }

.leaderboard-item.rank-1 { background: rgba(212, 175, 55, 0.15); border-color: var(--tp-gold); }
.leaderboard-item.rank-1 .rank { color: var(--tp-gold); }
.leaderboard-item.rank-2 { background: rgba(192, 192, 192, 0.15); border-color: silver; }
.leaderboard-item.rank-2 .rank { color: silver; }
.leaderboard-item.rank-3 { background: rgba(205, 127, 50, 0.15); border-color: #cd7f32; }
.leaderboard-item.rank-3 .rank { color: #cd7f32; }

@keyframes loadBar {
    from { width: 0%; }
    to { width: 100%; }
}

/* --- Slot Machine Victory Overlay --- */
#slot-machine-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#slot-machine-overlay.hidden {
    display: none;
}

.slot-machine-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.slam-in-title {
    font-size: 3rem;
    color: var(--tp-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.8);
    margin: 0;
    animation: slam-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#slot-score-counter {
    font-size: 4rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 15px rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.5);
    padding: 10px 30px;
    border: 2px solid var(--tp-gold);
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

#slot-grade-stamp-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1001;
}

/* ─────────────────────────────────────────────
   VAULT & CARD SYSTEM STYLES
   ───────────────────────────────────────────── */

.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 900px;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

/* Base Card Component */
.ts-card {
    position: relative;
    width: 100%;
    aspect-ratio: 2.5 / 3.5;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ts-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.8);
}

.ts-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Card Header (Scene Title) */
.ts-card-header {
    height: 12%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 5px;
    background: rgba(0,0,0,0.4);
    z-index: 5;
}

.ts-card-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--tp-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Photo */
.ts-card-photo-container {
    flex: 1;
    min-height: 150px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center top;
}

/* Card Frame Overlay */
.ts-card-frame {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}

/* Rarity Badge */
.ts-rarity-badge {
    position: absolute;
    top: 10px; 
    right: 10px;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 0.8rem;
    z-index: 15;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.5);
}

/* Card Info Area */
.ts-card-footer {
    min-height: 30%;
    width: 100%;
    background: rgba(0,0,0,0.8);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    z-index: 12;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.ts-card-name-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.ts-card-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: white;
}

.ts-card-age {
    font-size: 0.6rem;
    color: #999;
    font-weight: 400;
}

.ts-card-lore {
    font-size: 0.5rem;
    line-height: 1.2;
    color: #ccc;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.ts-card-prompt {
    font-size: 0.55rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 3px 6px;
    border-radius: 6px;
    font-style: italic;
    color: var(--tp-gold-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Full View Expansion */
.ts-card-full {
    width: 420px;
    max-width: 95vw;
    height: auto !important;
    aspect-ratio: auto !important;
    overflow: hidden !important; /* Hard stop for internal content */
    box-shadow: none !important;
    margin-bottom: 40px !important; /* Force space at the card level */
}
.ts-card-full .ts-card-inner {
    height: auto !important;
}
.ts-card-full .ts-card-header {
    height: auto !important;
    padding: 15px 12px 5px 12px;
}
.ts-card-full .ts-card-photo-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto !important;
    min-height: auto !important;
    flex-shrink: 0;
    flex: none;
    background-size: cover;
    background-repeat: no-repeat;
}
.ts-card-full .ts-card-footer {
    height: auto !important;
    min-height: auto !important;
    padding: 15px 12px 25px 12px;
}
.ts-card-full .ts-card-title { font-size: 1.1rem; }
.ts-card-full .ts-card-name { font-size: 1.4rem; }
.ts-card-full .ts-card-age { font-size: 1rem; }
.ts-card-full .ts-card-lore { 
    font-size: 0.9rem; 
    line-height: 1.4;
    color: #e0e0e0;
    display: block !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    margin-bottom: 15px; 
}
.ts-card-full .ts-card-prompt { 
    font-size: 1rem; 
    white-space: normal; 
    padding: 12px; 
    border-radius: 10px; 
    line-height: 1.4;
    margin-bottom: 0; /* Let footer padding handle it */
    box-shadow: none !important; /* Final kill on prompt shadow */
    border: 1px solid rgba(255,255,255,0.1);
}
.ts-card-full .ts-rarity-badge { 
    width: 36px; 
    height: 36px; 
    font-size: 1.2rem;
    top: 10px;
    right: 10px;
}

/* ─── Rarity Specifics ─── */

/* COMMON: Matte Black + Neon Pink */
.rarity-common .ts-card-frame {
    border: 1px solid #222;
    box-shadow: inset 0 0 0 2px rgba(255, 0, 153, 0.5);
}
.rarity-common .ts-rarity-badge {
    background: #ff0099;
    color: white;
    box-shadow: 0 0 10px #ff0099;
}

/* UNCOMMON: Metallic Purple + Gold Streak */
.rarity-uncommon .ts-card-frame {
    border: 2px solid #4a0e4e;
    box-shadow: inset 0 0 0 1.5px rgba(212, 175, 55, 0.7);
}
.rarity-uncommon .ts-card-header { background: rgba(74, 14, 78, 0.6); }
.rarity-uncommon .ts-rarity-badge {
    background: #4a0e4e;
    color: var(--tp-gold);
    box-shadow: 0 0 10px #4a0e4e;
    border-color: var(--tp-gold);
}

/* RARE: Holographic Gold */
.rarity-rare .ts-card-frame {
    border: 3px solid var(--tp-gold);
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.1) 100%);
    box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.5);
}
.rarity-rare .ts-card-header { background: rgba(212, 175, 55, 0.2); }
.rarity-rare .ts-rarity-badge {
    background: var(--tp-gold);
    color: #1a1a1a;
    box-shadow: 0 0 15px var(--tp-gold);
    border-color: #fff;
}

/* Holographic Shimmer Effect for Rare Cards */
.rarity-rare .ts-card-photo-container::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(105deg, 
        transparent 30%, 
        rgba(255, 219, 112, 0.3) 45%, 
        rgba(255, 255, 255, 0.5) 50%, 
        rgba(255, 219, 112, 0.3) 55%, 
        transparent 70%
    );
    background-size: 200% 200%;
    animation: holo-shimmer 3s infinite linear;
    pointer-events: none;
    z-index: 11;
}

@keyframes holo-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ─── Reveal Animations ─── */
.revealed-card-animation {
    width: 420px;
    max-width: 90vw;
    display: flex;
    justify-content: center;
    animation: card-slam 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform: scale(3) rotate(20deg);
    opacity: 0;
}

@keyframes card-slam {
    0% { transform: scale(4) rotate(45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.reveal-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
    animation: glow-pulse 2s infinite ease-in-out;
    z-index: -1;
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 0.8; }
}

/* ─── Reply Modal ─── */
/* Reply Card Preview */
.reply-card-preview-container {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.preview-img-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tp-gold);
    flex-shrink: 0;
}

.preview-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-girl-name {
    color: var(--tp-gold);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.preview-prompt-quote {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--tp-white);
    line-height: 1.3;
}

/* ─── Username Modal ─── */
.username-modal {
    max-width: 500px;
    width: 90%;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 20px;
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.arcade-trophy-icon {
    font-size: 4rem;
    color: var(--tp-gold);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6));
}

.unlock-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--tp-gold-light), var(--tp-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.username-form {
    margin-top: 2rem;
}

.username-status {
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

.member-bonus-box {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--tp-gold);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--tp-gold);
    font-weight: bold;
    font-size: 0.9rem;
    animation: pulse-gold 2s infinite;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0px rgba(212, 175, 55, 0); }
    50% { box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }
    100% { box-shadow: 0 0 0px rgba(212, 175, 55, 0); }
}

.reply-modal {
    max-width: 500px;
    width: 95%;
    padding: 2.5rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(42, 16, 78, 0.95), rgba(13, 13, 13, 0.98));
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.reply-header h3 {
    margin: 0;
    color: var(--tp-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reply-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--tp-gold);
    opacity: 0.8;
}

.input-group input, 
.input-group textarea {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-group input:focus, 
.input-group textarea:focus {
    border-color: var(--tp-gold);
}

.input-group textarea {
    height: 100px;
    resize: none;
    font-family: inherit;
}

.large-textarea {
    height: 140px !important;
}

.char-counter {
    font-size: 0.7rem;
    text-align: right;
    margin-top: 4px;
    opacity: 0.5;
}

.char-counter.limit { color: #ff4d4d; opacity: 1; }

.toggle-group {
    display: flex;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 10px;
}

.toggle-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.85rem;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: var(--tp-gold);
    color: black;
    font-weight: bold;
}

/* ─── Gallery Screen ─── */
.gallery-feed {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 10px 20px 100px 20px;
    overflow-y: auto;
    scrollbar-width: none;
}

.gallery-feed::-webkit-scrollbar { display: none; }

.gallery-post {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 20px;
    padding: 2.2rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.gallery-post:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(255,255,255,0.04);
}

.gallery-post.gold-glow {
    border: 1px solid var(--tp-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(212,175,55,0.05));
}

.gallery-post.needy-fade {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.post-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 35px;
    height: 35px;
    background: var(--tp-gold);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: black;
    font-weight: bold;
    font-size: 0.8rem;
}

.post-username {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--tp-gold);
}

.post-score-badge {
    padding: 4px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 800;
}

.post-score-badge.positive { color: var(--tp-gold); background: rgba(212, 175, 55, 0.1); }
.post-score-badge.negative { color: #ff4d4d; background: rgba(255, 77, 77, 0.1); }

.post-text {
    font-size: 1.15rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.post-thought-process {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.5;
    border-left: 2px solid rgba(212, 175, 55, 0.3);
    padding-left: 12px;
    margin-bottom: 1.5rem;
}

.post-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vote-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.vote-btn:hover { background: rgba(255,255,255,0.1); }
.vote-btn.active { border-color: var(--tp-gold); background: rgba(212, 175, 55, 0.1); }

/* ─── Post Context Preview ─── */
.post-context-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.context-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(212, 175, 55, 0.4);
    flex-shrink: 0;
}

.context-info {
    flex: 1;
    min-width: 0; /* Prevents overflow */
}

.context-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--tp-gold);
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.context-prompt {
    font-size: 0.85rem;
    font-style: italic;
    color: #ccc;
    line-height: 1.3;
}

.card-detail-content {
    width: 95%;
    max-width: 480px;
    background: #000;
    border: 2px solid var(--tp-gold);
    border-radius: 20px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 50px rgba(0,0,0,1);
    position: relative;
    max-height: 95vh;
    overflow-y: auto;
    animation: modal-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modal-pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#card-full-view-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden; /* Ensure card content doesn't leak out */
}

.reply-action-container {
    width: 100%;
    margin-top: 35px; /* Heavy spacing to prevent overlap */
    position: relative;
    z-index: 100; /* Force button above any card shadows */
}


.card-reveal-result {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.reveal-rarity-text {
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    line-height: 1.4;
    margin-top: 15px;
    max-width: 90%;
}
/* --- VAULT GROUPING & PROGRESS --- */
.vault-category-header {
    width: 100%;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.category-title-group h2 {
    font-size: 1.8rem;
    color: var(--tp-gold);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.category-progress-text {
    font-size: 0.9rem;
    color: var(--tp-white);
    opacity: 0.7;
}

.category-rarity-stats {
    display: flex;
    gap: 15px;
}

.rarity-stat-chip {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rarity-stat-chip.common {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rarity-stat-chip.uncommon {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.rarity-stat-chip.rare {
    background: rgba(212, 175, 55, 0.1);
    color: var(--tp-gold);
    border: 1px solid var(--tp-gold);
}

.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    width: 100%;
    margin-bottom: 30px;
}

/* Ensure empty slots look good */
.empty-slot {
    aspect-ratio: 2/3;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.1);
    font-size: 2rem;
}

/* Rarity specific text styles for Reveal */
.reveal-rarity-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 5px;
    text-align: center;
}

.rarity-text-common { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.rarity-text-uncommon { color: #2ecc71; text-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
.rarity-text-rare { color: var(--tp-gold); text-shadow: 0 0 15px rgba(212, 175, 55, 0.6); }

/* Scrollbar for Vault */
.screen.target-map-screen {
    overflow-y: auto;
    max-height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--tp-gold) transparent;
}

.screen.target-map-screen::-webkit-scrollbar {
    width: 6px;
}

.screen.target-map-screen::-webkit-scrollbar-thumb {
    background: var(--tp-gold);
    border-radius: 10px;
}
/* --- Coming Soon Screen Actions --- */
#coming-soon-screen .btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#coming-soon-screen .btn:hover {
    transform: translateY(-5px) scale(1.02);
}

#coming-soon-screen .glass-card {
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* --- Dynamic Leaderboard Status Indicators --- */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.status-active {
    color: #2ECC71;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-locked {
    color: var(--tp-gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #2ECC71;
    border-radius: 50%;
    box-shadow: 0 0 10px #2ECC71;
    animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { transform: scale(1.2); opacity: 0.8; box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* Responsive adjustments for Coming Soon Screen */
@media (max-width: 600px) {
    #coming-soon-screen .glass-card {
        padding: 25px 15px;
        margin: 10px;
    }
    
    #coming-soon-screen h1 {
        font-size: 1.8rem;
    }
}

/* Magic Mirror Powerup Style (Silver/Chrome Metallic Theme with Vikings Purple Accents) */
.magic-mirror-bar-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  border: 2px solid var(--tp-purple);
  background: var(--tp-black);
  color: var(--tp-purple);
  padding: 0;
  border-radius: 20px;
  margin-left: 10px;
  cursor: pointer;
}
.magic-mirror-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 45%, #94a3b8 70%, #64748b 100%);
  transition: width 0.4s ease-out;
  z-index: 1;
}
.magic-mirror-content {
  position: relative;
  z-index: 2;
  padding: 5px 15px;
  width: 100%;
  font-weight: bold;
  color: var(--tp-purple);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); /* Drop white glow shadow under purple text to make it extremely sharp and readable */
}
.magic-mirror-bar-btn.ready {
  animation: glow-mirror 2s infinite;
  border-color: var(--tp-purple) !important;
}
.magic-mirror-bar-btn.empty .magic-mirror-fill {
  width: 0% !important;
}
.magic-mirror-bar-btn.empty .magic-mirror-content {
  color: #888;
}
.magic-mirror-bar-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes glow-mirror {
  0% { box-shadow: 0 0 5px #cbd5e1; }
  50% { box-shadow: 0 0 20px #cbd5e1, inset 0 0 10px #f1f5f9; }
  100% { box-shadow: 0 0 5px #cbd5e1; }
}

.magic-mirror-popup {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 15, 15, 0.95);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  z-index: 1000;
  text-align: center;
  color: #e2e8f0;
  font-weight: bold;
  font-size: 1.4rem;
  box-shadow: 0 0 40px rgba(203, 213, 225, 0.6);
  pointer-events: none;
  animation: shield-pop 2.5s ease forwards;
}

.magic-mirror-popup i {
  display: block;
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: #cbd5e1;
  filter: drop-shadow(0 0 10px #e2e8f0);
}

.magic-mirror-popup span {
  display: block;
  font-size: 0.9rem;
  color: #DDD;
  margin-top: 0.5rem;
  font-weight: normal;
}


/* --- VAULT LOBBY (LOBBY OF BOSS BABES) --- */
.vault-lobby-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 900px;
    margin-bottom: 40px;
}

.lobby-card {
    display: flex;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    height: 180px;
    width: 100%;
    position: relative;
}

.lobby-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--tp-gold);
    box-shadow: 0 12px 40px rgba(255, 0, 153, 0.2);
}

.lobby-card-portrait {
    width: 150px;
    height: 100%;
    background-size: cover;
    background-position: center top;
    position: relative;
    flex-shrink: 0;
}

.lobby-card-portrait::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(90deg, transparent 50%, rgba(13,13,13,0.8) 100%);
    pointer-events: none;
}

.lobby-card-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
    background: rgba(13,13,13,0.5);
}

.lobby-card-level {
    font-size: 0.75rem;
    color: var(--tp-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.lobby-card-title {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 2px;
}

.lobby-card-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lobby-card-progress {
    font-size: 0.9rem;
    color: #eee;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lobby-card-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.lobby-card-btn {
    align-self: flex-end;
    padding: 10px 25px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--tp-purple) 0%, #ff0099 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 0, 153, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lobby-card-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 0, 153, 0.6);
}

/* Mobile responsive for Lobby Cards */
@media (max-width: 600px) {
    .lobby-card {
        height: auto;
        flex-direction: column;
    }
    .lobby-card-portrait {
        width: 100%;
        height: 180px;
    }
    .lobby-card-portrait::after {
        background: linear-gradient(0deg, rgba(13,13,13,0.8) 0%, transparent 100%);
    }
    .lobby-card-info {
        padding: 15px;
    }
    .lobby-card-btn {
        width: 100%;
        text-align: center;
        margin-top: 15px;
    }
}

/* --- SPECIFIC GIRL VAULT SCREEN --- */
.girl-vault-scroll-feed-container {
    width: 100%;
    max-width: 1000px;
    overflow-y: auto;
    max-height: 75vh;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--tp-gold) transparent;
    margin-bottom: 50px;
}

.girl-vault-scroll-feed-container::-webkit-scrollbar {
    width: 6px;
}

.girl-vault-scroll-feed-container::-webkit-scrollbar-thumb {
    background-color: var(--tp-gold);
    border-radius: 3px;
}

.girl-vault-scroll-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    justify-content: center;
    padding: 15px 5px;
    width: 100%;
    box-sizing: border-box;
}

/* Specific Card overrides for Vault Feed to make them look like beautiful showcase trading cards */
.girl-vault-scroll-feed .ts-card {
    aspect-ratio: 2.5 / 3.8; /* Make cards slightly taller for rich detailed footer */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    background: rgba(10, 10, 10, 0.9);
}

.girl-vault-scroll-feed .ts-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--tp-gold);
    box-shadow: 0 15px 35px rgba(255, 0, 153, 0.25);
}

.girl-vault-scroll-feed .ts-card-footer {
    padding: 12px 14px;
    background: rgba(5, 5, 5, 0.9);
}

.girl-vault-scroll-feed .ts-card-name {
    font-size: 1rem;
}

.girl-vault-scroll-feed .ts-card-age {
    font-size: 0.75rem;
}

.girl-vault-scroll-feed .ts-card-lore {
    font-size: 0.65rem;
    -webkit-line-clamp: 4; /* More lore visibility! */
    margin-bottom: 8px;
    line-height: 1.3;
}

.girl-vault-scroll-feed .ts-card-prompt {
    font-size: 0.75rem;
    background: rgba(255, 0, 153, 0.05);
    border-left: 2px solid var(--tp-gold);
    padding: 6px 8px;
}

/* Premium Gold-Accent Locked Vault Placeholders (nested in card-pocket-slot) */
.locked-vault-placeholder {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(5, 2, 3, 0.95) 0%, rgba(15, 6, 8, 0.9) 100%);
    border: 2px dashed rgba(212, 175, 55, 0.12);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 0 25px rgba(0,0,0,0.9);
    position: relative;
}

.card-pocket-slot:hover .locked-vault-placeholder {
    background: linear-gradient(180deg, rgba(8, 3, 5, 0.95) 0%, rgba(20, 8, 11, 0.9) 100%);
    border-color: rgba(212, 175, 55, 0.45);
    color: rgba(212, 175, 55, 0.6);
    box-shadow: inset 0 0 35px rgba(0,0,0,0.95);
}

.locked-vault-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.8));
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.3s;
}

.card-pocket-slot:hover .locked-vault-placeholder i {
    color: var(--tp-gold);
}

.locked-vault-placeholder span {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animated Token & Gem Highlight Rule */
.hud-pulse-highlight {
    position: relative;
    z-index: 10001;
    animation: hudPulseBorder 1.2s infinite alternate !important;
    border-radius: 8px;
    padding: 4px 8px;
    background: rgba(255, 215, 0, 0.25) !important;
    transition: all 0.3s ease;
}

@keyframes hudPulseBorder {
    0% {
        box-shadow: 0 0 4px rgba(255, 215, 0, 0.4), inset 0 0 2px rgba(255, 215, 0, 0.4);
        border: 1px solid rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 1), inset 0 0 10px rgba(255, 215, 0, 0.8);
        border: 1px solid rgba(255, 215, 0, 1);
        transform: scale(1.1);
    }
}

.pulse-arrow {
    display: inline-block;
    animation: pulseArrowKey 0.8s infinite alternate;
}

@keyframes pulseArrowKey {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(6px);
    }
}

/* ────────────────────────────────────────────────────────
   📚 BINDER ALBUM SCREEN & RESPONSIVE LAYOUT STYLES
   ──────────────────────────────────────────────────────── */

/* Tabs Container inside Binder Screen */
.binder-tabs-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0 25px 0;
    width: 100%;
    max-width: 900px;
    flex-wrap: wrap;
    z-index: 100;
}

.binder-tab {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: #ccc;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.binder-tab:hover {
    background: rgba(255, 0, 153, 0.1);
    border-color: rgba(255, 0, 153, 0.4);
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 153, 0.2);
}

.binder-tab.active {
    background: var(--tp-gold) !important;
    border-color: #fff !important;
    color: black !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

/* Completion HUD Banner inside Binder */
.binder-completion-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 12px 25px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
}

.binder-completion-hud span {
    color: white;
    font-size: 0.95rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Master Virtual Binder Wrapper */
.virtual-binder-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 50px auto;
    perspective: 1500px;
}

.virtual-binder {
    display: flex;
    background: linear-gradient(135deg, #1d0f11 0%, #080304 100%);
    border: 12px solid #281517;
    border-radius: 24px;
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 0.95),
        inset 0 0 60px rgba(0, 0, 0, 0.9);
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-height: 70vh;
    overflow: hidden;
}

/* Binder Spine Rings */
.binder-spine {
    width: 32px;
    background: linear-gradient(90deg, #050202, #200f11 30%, #30171a 50%, #200f11 70%, #050202);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 50px 0;
    position: relative;
    z-index: 10;
    box-shadow: 
        5px 0 15px rgba(0, 0, 0, 0.5),
        -5px 0 15px rgba(0, 0, 0, 0.5);
}

.binder-spine::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-50%);
}

/* Binding Ring Loops: 3D Horizontal Loops overlapping page edges */
.binder-ring {
    width: 52px; /* Wider than spine (32px) so it bleeds over pages on both sides */
    height: 16px;
    background: linear-gradient(180deg, 
        #ffffff 0%, 
        #e2e2e2 20%, 
        #a8a8a8 45%, 
        #666666 65%, 
        #303030 85%, 
        #121212 100%
    );
    border-radius: 8px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.8),
        inset 0 2px 3px rgba(255, 255, 255, 0.75),
        inset 0 -2px 3px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.55);
    position: relative;
    z-index: 15;
    margin: 10px 0;
}

/* Ring shadow casting onto the pages */
.binder-ring::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: -6px;
    left: -12px;
    right: -12px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(2px);
}

/* Individual Page Sheets with realistic Pebbled Calfskin Leather Micro-Texture */
.binder-page {
    flex: 1;
    background-color: #0c0405;
    background-image: 
        radial-gradient(rgba(212, 175, 55, 0.035) 1px, transparent 0),
        radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 0),
        linear-gradient(135deg, #1e090b 0%, #0a0304 100%);
    background-size: 4px 4px, 6px 6px, 100% 100%;
    background-position: 0 0, 2px 2px, 0 0;
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 80vh;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.8);
}

/* Leather stitched gold borders with compressed needle punch shadow */
.binder-page::after {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 14px;
    right: 14px;
    border: 1.5px dashed rgba(212, 175, 55, 0.28);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
    box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.65);
}

.binder-page.left {
    border-right: 1px solid rgba(0, 0, 0, 0.8);
}

.binder-page.right {
    border-left: 1px solid rgba(255, 255, 255, 0.04);
}

.binder-page-header {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.binder-page-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.binder-page-progress {
    color: var(--tp-gold);
    font-size: 0.85rem;
    font-weight: bold;
    background: rgba(212, 175, 55, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Binder Card Grid Layout: Enforced standard physical card dimensions & clean breathing room */
.binder-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 30px 25px;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    box-sizing: border-box;
    padding-bottom: 20px;
}

/* Hover-Inspect Overlay for Binder Cards */
.girl-vault-scroll-feed .ts-card,
.binder-grid .ts-card {
    position: relative;
    overflow: hidden;
}

.card-inspect-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0);
    backdrop-filter: blur(0px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    z-index: 100;
}

.girl-vault-scroll-feed .ts-card:hover .card-inspect-overlay,
.binder-grid .ts-card:hover .card-inspect-overlay {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(4px);
    opacity: 1;
    pointer-events: auto;
}

.card-inspect-btn {
    background: var(--tp-gold);
    color: black;
    border: 1px solid #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.girl-vault-scroll-feed .ts-card:hover .card-inspect-btn,
.binder-grid .ts-card:hover .card-inspect-btn {
    transform: translateY(0);
}

.card-inspect-btn:hover {
    background: white;
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

/* ────────────────────────────────────────────────────────
   ✨ INTERACTIVE HOLOGRAPHIC FOIL & SHADER STYLES
   ──────────────────────────────────────────────────────── */

.rarity-uncommon.rarity-uncommon-holo .ts-card-frame {
    border: 2px solid transparent !important;
    border-image: radial-gradient(
                    circle at var(--x, 50%) var(--y, 50%),
                    rgba(255, 255, 255, 0.9) 0%,
                    rgba(255, 0, 153, 0.6) 30%,
                    rgba(74, 14, 78, 1) 70%
                ) 1 !important;
    background: none !important;
    box-shadow: 0 0 15px rgba(74, 14, 78, 0.5), inset 0 0 0 1.5px rgba(212, 175, 55, 0.3);
}

/* Rare Cards: Full Color-Dodge Holographic Foil */
.rarity-rare.rarity-rare-holo .ts-card-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle at var(--x, 50%) var(--y, 50%),
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 0, 128, 0.18) 25%,
        rgba(0, 242, 255, 0.18) 50%,
        rgba(255, 215, 0, 0.1) 75%,
        transparent 100%
    );
    mix-blend-mode: color-dodge;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 12;
}

.rarity-rare.rarity-rare-holo:hover .ts-card-inner::after {
    opacity: 1;
}

/* locked silhouette sub-tags */
.locked-badge-sub {
    margin-top: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
}

.locked-badge-sub.common {
    color: #ccc;
    background: rgba(255,255,255,0.05);
}

.locked-badge-sub.uncommon {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.locked-badge-sub.rare {
    color: var(--tp-gold);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

/* ────────────────────────────────────────────────────────
   📱 MOBILE RESPONSIVENESS AND COLLAPSING MEDIA QUERIES
   ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .virtual-binder {
        flex-direction: column;
        border-width: 6px;
        min-height: auto;
    }
    
    .binder-spine {
        width: 100%;
        height: 20px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0 40px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    }
    
    .binder-spine::before {
        left: 0; right: 0; top: 50%;
        height: 4px; width: auto;
        transform: translateY(-50%);
    }
    
    .binder-ring {
        width: 40px;
        height: 12px;
        background: linear-gradient(90deg, #e6e6e6 0%, #999 50%, #555 100%);
    }
    
    /* On mobile, stack pages or hide the inactive ones dynamically */
    .binder-page {
        max-height: none;
        overflow-y: visible;
        padding: 20px;
    }
    
    .binder-page.left {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .binder-page.right {
        border-left: none;
    }
    
    .binder-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Force grids to single columns on very small devices */
    @media (max-width: 480px) {
        .binder-grid {
            grid-template-columns: 1fr;
        }
    }
}

/* ==========================================
   Tactile Binder Sleeves & Clear Plastic Slots
   ========================================== */

/* Outer physical plastic binder sleeve pocket - matches ts-card's aspect ratio of 2.5 / 3.5 perfectly! */
.card-pocket-slot {
    position: relative;
    aspect-ratio: 2.5 / 3.5;
    background: rgba(255, 255, 255, 0.015);
    border-radius: 14px;
    padding: 8px; /* Roomy physical sleeve boundary spacing */
    box-sizing: border-box;
    box-shadow: 
        0 10px 24px rgba(0, 0, 0, 0.7),
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.12), /* Opaque heat-welded plastic seam */
        inset 0 0 15px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.95);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2;
}

.card-pocket-slot:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.85),
        0 0 25px rgba(212, 175, 55, 0.18), /* Golden accent glow */
        inset 0 0 0 2px rgba(255, 255, 255, 0.18),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(212, 175, 55, 0.45);
    z-index: 10;
}

/* Outer pocket margin trim line */
.card-pocket-slot::after {
    content: "";
    position: absolute;
    top: 2px; bottom: 2px; left: 2px; right: 2px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    pointer-events: none;
}

/* Curved slot opening cutout at the top */
.card-sleeve-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 16px;
    background: radial-gradient(circle at top, transparent 40%, rgba(255, 255, 255, 0.08) 50%, rgba(8, 4, 5, 0.98) 60%);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 0 35px 35px;
    z-index: 6;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Protective glossy clear-plastic glare overlay with pronounced ambient light sweeps */
.card-sleeve-glare {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 8px;
    right: 8px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 5;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.35) 0%, 
        rgba(255, 255, 255, 0.10) 15%, 
        transparent 45%, 
        rgba(255, 255, 255, 0.04) 60%, 
        rgba(255, 255, 255, 0.22) 85%, 
        rgba(255, 255, 255, 0.45) 100%
    );
    box-shadow: 
        inset 1.5px 1.5px 4px rgba(255, 255, 255, 0.25),
        inset -1.5px -1.5px 4px rgba(0, 0, 0, 0.4);
    mix-blend-mode: overlay;
    opacity: 0.9;
    transition: opacity 0.3s, transform 0.3s;
}

.card-pocket-slot:hover .card-sleeve-glare {
    opacity: 1;
    transform: scale(1.01);
}

/* Overriding card elements nesting within pockets */
.card-pocket-slot .ts-card {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 10px !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Trigger overlay on pocket hover */
.card-pocket-slot:hover .card-inspect-overlay {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(5px);
    opacity: 1;
    pointer-events: auto;
}

.card-pocket-slot:hover .card-inspect-btn {
    transform: translateY(0);
}


/* --- PROGRESSIVE ONBOARDING TUTORIALS --- */
.tutorial-modal-content {
    width: 92%;
    max-width: 460px;
    padding: 35px 25px;
    border-radius: 16px;
    border: 2px solid rgba(255, 0, 153, 0.5); /* Neon Pink Border */
    background: rgba(15, 10, 20, 0.96);
    box-shadow: 0 0 35px rgba(255, 0, 153, 0.3);
    text-align: center;
    animation: scaleUpTutorial 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUpTutorial {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.tutorial-close-x {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #ff0099;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s, color 0.2s;
    user-select: none;
}

.tutorial-close-x:hover {
    color: white;
    transform: rotate(90deg);
}

.tutorial-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255, 0, 153, 0.5));
}

.tutorial-icon.gold {
    color: var(--tp-gold);
    filter: drop-shadow(0 0 10px rgba(218, 165, 32, 0.5));
}

.tutorial-icon.pink {
    color: #ff0099;
}

.tutorial-title {
    color: white;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.tutorial-desc {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.tutorial-feature-list {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: #e0e0e0;
    line-height: 1.4;
}

.tutorial-feature-item i {
    font-size: 1.05rem;
    margin-top: 2px;
}

/* --- ARCADE UNLOCK SCREEN --- */
.arcade-unlock-content {
    width: 92%;
    max-width: 460px;
    padding: 40px 30px;
    border-radius: 20px;
    border: 2.5px solid var(--tp-gold); /* Neon Gold Border */
    background: rgba(15, 12, 10, 0.98);
    box-shadow: 0 0 45px rgba(218, 165, 32, 0.35);
    animation: scaleUpTutorial 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.unlock-glow-icon {
    font-size: 4.5rem;
    color: var(--tp-gold);
    margin-bottom: 20px;
    display: inline-block;
    animation: pulseUnlockCoin 2s infinite ease-in-out;
}

@keyframes pulseUnlockCoin {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(218, 165, 32, 0.5)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(218, 165, 32, 0.8)); }
}

.unlock-title {
    color: var(--tp-gold);
    font-size: 1.7rem;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
}

.unlock-desc {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.unlock-features-box {
    background: rgba(218, 165, 32, 0.03);
    border: 1px solid rgba(218, 165, 32, 0.15);
    border-radius: 12px;
    padding: 18px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 25px;
}

.unlock-feature-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #e0e0e0;
    font-size: 0.92rem;
    line-height: 1.45;
}

.unlock-feature-row i {
    font-size: 1.15rem;
    margin-top: 2px;
}

.text-gold {
    color: var(--tp-gold);
}

.text-pink {
    color: #ff0099;
}

/* --- SFX / AUDIO RESET SPIN ANIMATION --- */
.arrows-rotate-anim {
    animation: spinSyncBtn 0.8s ease-in-out;
}

@keyframes spinSyncBtn {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── Gallery Sub-Tabs Nav Pills ─── */
.gallery-tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
    justify-content: center;
}

.gallery-tab-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.15);
    color: #bbb;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-tab-btn:hover {
    background: rgba(79, 38, 131, 0.2); /* var(--tp-purple) with opacity */
    border-color: rgba(212, 175, 55, 0.4);
    color: white;
}

.gallery-tab-btn.active {
    background: linear-gradient(135deg, var(--tp-purple-dark), #3b1670);
    border: 1.5px solid var(--tp-gold);
    color: var(--tp-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

/* ─── Intel Challenge Cards ─── */
.challenge-card {
    position: relative;
    padding: 24px;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.challenge-card.glass-card {
    background: rgba(26, 26, 26, 0.85);
    border: 1.5px solid rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.challenge-card:hover {
    transform: translateY(-4px);
    border-color: var(--tp-gold);
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.15);
}

.challenge-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid var(--tp-gold);
    color: var(--tp-gold);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.challenge-badge.anomaly {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid var(--color-incorrect);
    color: var(--color-incorrect);
}

.challenge-header-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.challenge-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.challenge-icon-box.bg-anomaly {
    background: rgba(231, 76, 60, 0.05);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.challenge-info {
    flex-grow: 1;
    text-align: left;
}

.challenge-title {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
}

.challenge-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.45;
}

.challenge-desc strong {
    color: white;
}

/* ─── Spin & Pulse Keyframes ─── */
.token-spin {
    animation: rotateToken 4s linear infinite;
}

@keyframes rotateToken {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.gem-pulse {
    animation: pulseGem 2s ease-in-out infinite;
}

@keyframes pulseGem {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px #ff007f); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 15px #ff007f); }
}

/* ─── Completed State ─── */
.challenge-card.completed {
    opacity: 0.65;
    pointer-events: none;
    border-color: rgba(212, 175, 55, 0.1) !important;
    background: rgba(10, 10, 10, 0.8) !important;
    box-shadow: none !important;
    transform: none !important;
}

.challenge-card.completed .challenge-badge {
    background: rgba(0, 255, 0, 0.1) !important;
    border-color: #00ff00 !important;
    color: #00ff00 !important;
}

.challenge-card.completed .btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #666 !important;
    cursor: default;
}

/* ─── Glowing Inputs for Modals ─── */
.reply-form textarea:focus,
.reply-form select:focus {
    border-color: var(--tp-gold) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3) !important;
    outline: none;
}

#anomaly-modal-overlay textarea:focus,
#anomaly-modal-overlay select:focus {
    border-color: var(--color-incorrect) !important;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3) !important;
    outline: none;
}

/* ─── Shop & Mystery Pack Animations ─── */
.pack-gift-bounce {
    animation: packGiftBounce 3s ease-in-out infinite;
}

@keyframes packGiftBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-3deg); }
    75% { transform: translateY(-5px) rotate(3deg); }
}

.pack-gift-bounce:hover {
    animation: packGiftTear 0.5s linear infinite;
}

@keyframes packGiftTear {
    0%, 100% { transform: scale(1) rotate(0); }
    20% { transform: scale(1.08) rotate(-4deg); }
    40% { transform: scale(0.96) rotate(4deg); }
    60% { transform: scale(1.08) rotate(-2deg); }
    80% { transform: scale(0.96) rotate(2deg); }
}

.shop-bundle-card {
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s !important;
}

.shop-bundle-card:hover {
    transform: translateY(-5px) scale(1.03);
}
