/* ===========================================
   PartyUp - 16-bit RPG Party Select Theme
   =========================================== */

/* Google Fonts - Pixel Font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* CSS Variables */
:root {
  /* Colors - RPG Menu Palette */
  --bg-dark: #0d0d1a;
  --bg-panel: #1a1a2e;
  --bg-panel-light: #2d2d44;
  --border-color: #4a4a6a;
  --border-highlight: #6a6a8a;

  /* Brand Colors (Discord) */
  --primary: #5865f2;
  --primary-dark: #4752c4;
  --primary-light: #7b88ff;
  --accent-green: #57f287;
  --accent-green-dark: #3fb56d;

  /* RPG Accent Colors */
  --gold: #ffd700;
  --gold-dark: #cc9900;
  --red: #ff6b6b;
  --cyan: #00d4ff;

  /* Text */
  --text-primary: #e8e8e8;
  --text-secondary: #9999aa;
  --text-muted: #666677;

  /* Sizing */
  --pixel: 4px;
  --radius: 0; /* Pixel art = no border radius */

  /* Spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 60px;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Core Layout */
body {
  font-family:
    'Segoe UI',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-dark);
  background-image:
    /* Subtle grid pattern */
    linear-gradient(rgba(74, 74, 106, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 74, 106, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Typography */
.pixel-font {
  font-family: 'Press Start 2P', cursive;
  line-height: 1.8;
  letter-spacing: 1px;
}

h1,
h2,
h3 {
  font-family: 'Press Start 2P', cursive;
  line-height: 1.6;
  letter-spacing: 1px;
}

h1 {
  font-size: 1.75rem;
  color: var(--gold);
  text-shadow:
    3px 3px 0 var(--gold-dark),
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

h2 {
  font-size: 1rem;
  color: var(--text-primary);
}

h3 {
  font-size: 0.75rem;
  color: var(--accent-green);
}

/* Links */
a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold);
}

/* ===========================================
   Pixel Border System (Pure CSS)
   =========================================== */

.pixel-panel {
  background: var(--bg-panel);
  position: relative;
  border: var(--pixel) solid var(--border-color);
  /* Double border effect */
  box-shadow:
    inset 0 0 0 var(--pixel) var(--bg-panel-light),
    0 var(--pixel) 0 0 rgba(0, 0, 0, 0.5);
}

.pixel-panel::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--pixel));
  left: calc(-1 * var(--pixel));
  right: calc(-1 * var(--pixel));
  bottom: calc(-1 * var(--pixel));
  border: var(--pixel) solid transparent;
  border-image: linear-gradient(135deg, var(--border-highlight) 0%, var(--border-color) 50%, #2a2a3a 100%) 1;
  pointer-events: none;
}

/* Corner Decorations */
.pixel-corners {
  position: relative;
}

.pixel-corners::before,
.pixel-corners::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: var(--pixel) solid var(--gold);
}

.pixel-corners::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.pixel-corners::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

/* ===========================================
   Buttons - Chunky Pixel Style
   =========================================== */

.pixel-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  padding: 16px 28px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: transform 0.1s ease;

  /* 3D Beveled Effect */
  box-shadow:
    inset calc(-1 * var(--pixel)) calc(-1 * var(--pixel)) 0 0 var(--primary-dark),
    inset var(--pixel) var(--pixel) 0 0 var(--primary-light),
    0 var(--pixel) 0 0 #000,
    0 calc(2 * var(--pixel)) 0 0 rgba(0, 0, 0, 0.3);
}

.pixel-btn:hover,
.pixel-btn:hover:visited {
  background: var(--primary-light);
  color: white !important;
  box-shadow:
    inset calc(-1 * var(--pixel)) calc(-1 * var(--pixel)) 0 0 var(--primary),
    inset var(--pixel) var(--pixel) 0 0 #9ba3ff,
    0 var(--pixel) 0 0 #000,
    0 calc(2 * var(--pixel)) 0 0 rgba(0, 0, 0, 0.3);
}

.pixel-btn:active {
  transform: translateY(var(--pixel));
  box-shadow:
    inset var(--pixel) var(--pixel) 0 0 var(--primary-dark),
    inset calc(-1 * var(--pixel)) calc(-1 * var(--pixel)) 0 0 var(--primary-light),
    0 0 0 0 #000;
}

.pixel-btn svg {
  width: 20px;
  height: 20px;
}

/* Button with idle animation */
.pixel-btn-animated::before {
  content: '>';
  position: absolute;
  left: 10px;
  animation: cursor-bounce 0.8s ease-in-out infinite;
}

.pixel-btn-animated {
  padding-left: 36px;
}

/* Secondary/Ghost Button */
.pixel-btn-secondary {
  background: transparent;
  border: var(--pixel) solid var(--border-color);
  color: var(--text-primary);
  box-shadow:
    inset calc(-1 * var(--pixel)) calc(-1 * var(--pixel)) 0 0 #1a1a2e,
    inset var(--pixel) var(--pixel) 0 0 var(--border-highlight);
}

.pixel-btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(88, 101, 242, 0.1);
}

/* ===========================================
   Cards - Party Member Style
   =========================================== */

.party-card {
  background: var(--bg-panel);
  border: var(--pixel) solid var(--border-color);
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;

  /* Inner highlight */
  box-shadow:
    inset 0 0 0 var(--pixel) rgba(255, 255, 255, 0.03),
    0 var(--pixel) 0 0 rgba(0, 0, 0, 0.4);
}

.party-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow:
    inset 0 0 0 var(--pixel) rgba(255, 215, 0, 0.1),
    0 8px 0 0 rgba(0, 0, 0, 0.3),
    0 0 20px rgba(255, 215, 0, 0.2);
}

.party-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--bg-panel-light);
  border: var(--pixel) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;

  /* Pixel art container */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.party-card h3 {
  margin-bottom: 8px;
  font-size: 0.65rem;
}

.party-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Selected state */
.party-card.selected {
  border-color: var(--accent-green);
  box-shadow:
    inset 0 0 0 var(--pixel) rgba(87, 242, 135, 0.1),
    0 0 20px rgba(87, 242, 135, 0.3);
}

/* ===========================================
   Speech Bubbles - RPG Dialog Style
   =========================================== */

.speech-bubble {
  background: var(--bg-panel);
  border: var(--pixel) solid var(--border-color);
  padding: 12px 16px;
  position: relative;
  text-align: left;

  box-shadow:
    inset var(--pixel) var(--pixel) 0 0 var(--bg-panel-light),
    0 var(--pixel) 0 0 rgba(0, 0, 0, 0.3);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: 20px;
  bottom: calc(-12px - var(--pixel));
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--border-color);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: 22px;
  bottom: -8px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--bg-panel);
  z-index: 1;
}

.speaker-name {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  margin-bottom: 6px;
  display: block;
}

.speaker-name.green {
  color: var(--accent-green);
}
.speaker-name.purple {
  color: var(--primary-light);
}
.speaker-name.gold {
  color: var(--gold);
}
.speaker-name.red {
  color: var(--red);
}

/* ===========================================
   Quest Panel / Objective List
   =========================================== */

.quest-panel {
  background: var(--bg-panel);
  border: var(--pixel) solid var(--border-color);

  box-shadow:
    inset 0 0 0 var(--pixel) var(--bg-panel-light),
    0 var(--pixel) 0 0 rgba(0, 0, 0, 0.4);
}

.quest-header {
  background: var(--bg-panel-light);
  border-bottom: var(--pixel) solid var(--border-color);
  padding: 12px 16px;
}

.quest-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-body {
  padding: 16px;
}

.quest-objective {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quest-objective:last-child {
  border-bottom: none;
}

.quest-checkbox {
  width: 20px;
  height: 20px;
  border: var(--pixel) solid var(--border-color);
  background: var(--bg-dark);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.quest-checkbox.checked {
  background: var(--accent-green);
  border-color: var(--accent-green-dark);
  color: #000;
}

.quest-objective-text code {
  display: block;
  margin-top: 4px;
}

/* ===========================================
   Code Blocks
   =========================================== */

code {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  padding: 8px 12px;
  color: var(--accent-green);
  display: inline-block;
}

/* ===========================================
   Animations
   =========================================== */

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

@keyframes cursor-bounce {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(4px);
  }
}

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

@keyframes sparkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
}

@keyframes glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
  }
}

/* Staggered fade-in for lists */
.fade-in-1 {
  animation: fadeIn 0.5s ease-out 0.1s both;
}
.fade-in-2 {
  animation: fadeIn 0.5s ease-out 0.2s both;
}
.fade-in-3 {
  animation: fadeIn 0.5s ease-out 0.3s both;
}
.fade-in-4 {
  animation: fadeIn 0.5s ease-out 0.4s both;
}
.fade-in-5 {
  animation: fadeIn 0.5s ease-out 0.5s both;
}

/* ===========================================
   Achievement / Success Banner
   =========================================== */

.achievement-banner {
  background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-panel-light) 100%);
  border: var(--pixel) solid var(--gold);
  padding: 24px;
  margin-bottom: var(--space-3);
  text-align: center;
  position: relative;
  animation: glow-pulse 2s ease-in-out infinite;

  box-shadow:
    inset 0 0 0 var(--pixel) rgba(255, 215, 0, 0.1),
    0 0 30px rgba(255, 215, 0, 0.3);
}

.achievement-banner::before {
  content: 'QUEST COMPLETE';
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  color: var(--gold);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  padding: 4px 12px;
  border: 2px solid var(--gold);
}

/* ===========================================
   Sparkle/Confetti Effect
   =========================================== */

.sparkle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  animation: sparkle 1.5s ease-in-out infinite;
}

.sparkle:nth-child(1) {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
}
.sparkle:nth-child(2) {
  left: 20%;
  top: 40%;
  animation-delay: 0.3s;
  background: var(--primary);
}
.sparkle:nth-child(3) {
  left: 80%;
  top: 15%;
  animation-delay: 0.6s;
  background: var(--accent-green);
}
.sparkle:nth-child(4) {
  left: 70%;
  top: 60%;
  animation-delay: 0.9s;
}
.sparkle:nth-child(5) {
  left: 30%;
  top: 70%;
  animation-delay: 1.2s;
  background: var(--red);
}
.sparkle:nth-child(6) {
  left: 90%;
  top: 45%;
  animation-delay: 0.4s;
  background: var(--cyan);
}
.sparkle:nth-child(7) {
  left: 5%;
  top: 80%;
  animation-delay: 0.7s;
}
.sparkle:nth-child(8) {
  left: 60%;
  top: 25%;
  animation-delay: 1s;
  background: var(--primary);
}

/* ===========================================
   Utility Classes
   =========================================== */

.text-gold {
  color: var(--gold);
}
.text-green {
  color: var(--accent-green);
}
.text-muted {
  color: var(--text-secondary);
}
.text-center {
  text-align: center;
}

/* Margin utilities */
.mb-1 {
  margin-bottom: var(--space-1);
}
.mb-2 {
  margin-bottom: var(--space-2);
}
.mb-3 {
  margin-bottom: var(--space-3);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-5 {
  margin-bottom: var(--space-5);
}
.mb-6 {
  margin-bottom: var(--space-6);
}

.mt-1 {
  margin-top: var(--space-1);
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-3 {
  margin-top: var(--space-3);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}

.ml-1 {
  margin-left: var(--space-1);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Padding utilities */
.p-3 {
  padding: var(--space-3);
}
.p-4 {
  padding: var(--space-4);
}
.px-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 768px) {
  h1 {
    font-size: 1.1rem;
  }

  h2 {
    font-size: 0.8rem;
  }

  .pixel-btn {
    font-size: 0.6rem;
    padding: 14px 20px;
  }

  code {
    font-size: 0.45rem;
    word-break: break-all;
  }
}

/* ===========================================
   Legacy Support (Discord button for success page)
   =========================================== */

.discord-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  padding: 16px 28px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;

  box-shadow:
    inset calc(-1 * var(--pixel)) calc(-1 * var(--pixel)) 0 0 var(--primary-dark),
    inset var(--pixel) var(--pixel) 0 0 var(--primary-light),
    0 var(--pixel) 0 0 #000,
    0 calc(2 * var(--pixel)) 0 0 rgba(0, 0, 0, 0.3);

  transition: all 0.15s ease;
}

.discord-btn:hover,
.discord-btn:hover:visited {
  background: var(--primary-light);
  color: white !important;
  transform: translateY(-2px);
}

.discord-btn:active {
  transform: translateY(var(--pixel));
}

/* Footer */
.footer {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer a {
  color: var(--primary);
}
