:root {
  --bg: #0f1320;
  --card: #141a2a;
  --muted: #a7b0c0;
  --text: #e6ecff;
  --primary: #7ce38b;
  --accent: #ffd166;
  --pink: #ff8dc7;
  --purple: #b795ff;
  --gold: #ffd86b;
  --green: #72f1b8;
  --gray: #8892a6;
  --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,0.35), 0 8px 16px rgba(0,0,0,0.25);
  --grid-size: 26px;
  --grid-line: rgba(255,255,255,0.05);
  --bg-accent-1: rgba(114, 241, 184, 0.08);
  --bg-accent-2: rgba(183, 149, 255, 0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html {
  /* Prevent iOS scaling issues */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* Prevent layout shifts */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Fredoka', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent iOS issues */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Allow text selection for inputs and content areas */
input, textarea, .feed-text, .item-title, .loot-title {
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* fixed decorative background so it never restarts on scroll */
body::before {
  content: "";
  position: fixed;
  inset: -80px; /* extend beyond viewport to avoid visible cut-off when drifting */
  z-index: -1;
  background-image:
    radial-gradient(1000px 600px at 50% -10%, #1d2540 0%, var(--bg) 60%),
    radial-gradient(600px 600px at 15% 20%, var(--bg-accent-1), transparent 60%),
    radial-gradient(800px 800px at 85% 70%, var(--bg-accent-2), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06), rgba(255,255,255,0.06) 1px, transparent 1px, transparent var(--grid-size)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.06) 1px, transparent 1px, transparent var(--grid-size));
  background-position:
    center,
    0 0,
    0 0,
    0 0,
    0 0;
  pointer-events: none;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate3d(-10px, -6px, 0); }
  100% { transform: translate3d(10px, 6px, 0); }
}

/* soften edges so the glow never looks harsh */
body::after {
  content: "";
  position: fixed;
  inset: -60px; /* expand vignette to hide outer seams */
  z-index: -1;
  pointer-events: none;
  box-shadow:
    inset 0 0 180px rgba(0,0,0,0.55),
    inset 0 0 60px rgba(0,0,0,0.4);
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; clip-path: inset(50%);
}

#app { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.section { display: none; width: 100%; max-width: 980px; }
.section.is-active { display: block; }

.hero {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* Logo styling */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

/* Notification Feed */
.notification-feed {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.feed-header {
  text-align: center;
  margin-bottom: 24px;
}

.feed-header h3 {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.feed-subtitle {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.feed-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.3s ease;
  animation: slideInRight 0.5s ease-out;
}

.feed-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.feed-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-icon {
  font-size: 20px;
  animation: bounce 2s ease-in-out infinite;
  flex-shrink: 0;
}

.feed-text {
  flex: 1;
  line-height: 1.4;
  color: var(--text);
  font-size: 14px;
}

.feed-text strong {
  color: var(--primary);
  font-weight: 600;
}

.feed-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 8px;
}

@keyframes slideInRight {
  0% { 
    transform: translateX(100%); 
    opacity: 0; 
  }
  100% { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { 
    transform: translateY(0); 
  }
  40% { 
    transform: translateY(-3px); 
  }
  60% { 
    transform: translateY(-2px); 
  }
}

.main-logo {
  max-width: 350px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.main-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4));
}

.hero-title { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hero-title h1 {
  margin: 0;
  font-family: 'Baloo 2', cursive;
  font-size: clamp(28px, 4.5vw, 56px);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.hero-title .year { color: var(--pink); }
.sparkle { filter: drop-shadow(0 2px 6px rgba(255, 141, 199, 0.65)); }
.tagline { text-align: center; margin: 10px 0 22px; color: var(--muted); font-size: 18px; }



.start-form { display: flex; flex-direction: column; gap: 12px; justify-content: center; align-items: stretch; }

.username-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.start-form input {
  background: #0e1425;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 100%;
  outline: none;
  font-size: 16px;
  flex: 1;
}
.start-form input::placeholder { color: #77809a; }

.start-form input.valid {
  border-color: var(--green);
  background: rgba(114, 241, 184, 0.05);
}

.start-form input.invalid {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.05);
}

.start-form input.checking {
  border-color: var(--accent);
  background: rgba(255, 209, 102, 0.05);
  animation: checking-pulse 1.5s ease-in-out infinite;
}

@keyframes checking-pulse {
  0%, 100% { 
    border-color: var(--accent);
    box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.4);
  }
  50% { 
    border-color: #ffed4e;
    box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.1);
  }
}

.user-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--green);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: avatarSlideIn 0.3s ease-out;
}

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

/* CSS fallback for small avatar */
.user-avatar.no-avatar::before {
	content: attr(data-initials);
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
	background: linear-gradient(135deg, #2E8B57, #3CB371);
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.avatar-check {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f1320;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #0f1320;
}

.username-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: -6px;
  margin-bottom: 6px;
  font-weight: 500;
}

@keyframes avatarSlideIn {
  0% { 
    opacity: 0; 
    transform: translateX(20px) scale(0.8); 
  }
  100% { 
    opacity: 1; 
    transform: translateX(0) scale(1); 
  }
}

.primary-btn, .ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  background: rgba(114, 241, 184, 0.15);
  color: var(--green);
  border: 1px solid rgba(114, 241, 184, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px rgba(114, 241, 184, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
.primary-btn:active { transform: translateY(1px); }
.primary-btn:hover:not(:disabled) { 
  background: rgba(114, 241, 184, 0.25);
  border-color: rgba(114, 241, 184, 0.5);
  box-shadow: 0 12px 24px rgba(114, 241, 184, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary-btn:disabled {
  background: rgba(255, 209, 102, 0.15);
  color: var(--accent);
  border-color: rgba(255, 209, 102, 0.3);
  cursor: not-allowed;
  animation: button-pulse 1.5s ease-in-out infinite;
}

@keyframes button-pulse {
  0%, 100% { 
    box-shadow: 0 8px 18px rgba(255, 209, 102, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% { 
    box-shadow: 0 12px 24px rgba(255, 209, 102, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

.start-form .primary-btn { width: 100%; }

.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Tabs */
.tabs { 
  display: grid; 
  grid-auto-flow: column; 
  gap: 8px; 
  background: rgba(14, 20, 37, 0.6); 
  border: 1px solid rgba(255,255,255,0.12); 
  padding: 6px; 
  border-radius: 999px; 
  margin-bottom: 14px; 
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.tab-btn { 
  background: rgba(255, 255, 255, 0.05); 
  color: var(--muted); 
  border: 1px solid rgba(255, 255, 255, 0.08); 
  padding: 10px 14px; 
  border-radius: 999px; 
  font-weight: 700; 
  cursor: pointer; 
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.tab-btn.is-active { 
  background: rgba(255,255,255,0.12); 
  color: var(--text); 
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.tab-panels { 
  background: rgba(14, 20, 37, 0.6); 
  border: 1px solid rgba(255,255,255,0.12); 
  border-radius: 14px; 
  padding: 12px; 
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.tabs { margin-bottom: 10px; }
.tab-panel[hidden], .card-grid[hidden] { display: none !important; }

/* Picker */
.picker { display: grid; gap: 12px; }
.picker-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: #0f1528; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px; }
.thumb { width: 44px; height: 44px; display: grid; place-items: center; background: #0e1425; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; font-size: 22px; }
.picker-fields { display: grid; gap: 6px; }
.picker-label { color: var(--muted); font-size: 12px; }
select, .qty input[type="number"] { width: 100%; background: #0e1425; color: var(--text); border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 10px 12px; }
.qty { width: 88px; }

/* Profile Section */
.profile-section {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 21, 40, 0.6);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 300px;
}

.profile-avatar {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

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

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #7ce38b, #b795ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f1320;
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-info h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-status {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mobile responsive adjustments for profile section */
@media (max-width: 768px) {
  .profile-section {
    max-width: 100%;
    padding: 12px;
    gap: 12px;
  }
  
  .profile-avatar {
    width: 50px;
    height: 50px;
  }
  
  .profile-info h3 {
    font-size: 16px;
  }
  
  .profile-status {
    font-size: 11px;
  }
}

/* Profile section positioning for different pages */
#profile-section-results {
  margin-bottom: 24px;
}

#profile-section-generation {
  margin-bottom: 24px;
}

/* Picker/cards */
.picker-header { text-align: center; margin-bottom: 12px; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.item-card { 
  background: rgba(15, 21, 40, 0.6); 
  border: 1px solid rgba(255,255,255,0.12); 
  border-radius: 14px; 
  padding: 12px; 
  display: grid; 
  gap: 8px; 
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
}
.item-card:hover {
  background: rgba(15, 21, 40, 0.8);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

/* Glowing gradient borders for popular items */
.item-card.rarity-prismatic {
  border: 2px solid transparent;
  background: linear-gradient(rgba(15, 21, 40, 0.6), rgba(15, 21, 40, 0.6)) padding-box,
              linear-gradient(45deg, #ff6b6b, #ffd166, #7ce38b, #b795ff) border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
              0 0 20px rgba(255, 107, 107, 0.3),
              0 0 40px rgba(255, 209, 102, 0.2),
              0 0 60px rgba(124, 227, 139, 0.1);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

.item-card.rarity-rare {
  border: 2px solid transparent;
  background: linear-gradient(rgba(15, 21, 40, 0.6), rgba(15, 21, 40, 0.6)) padding-box,
              linear-gradient(45deg, #b795ff, #ff8dc7, #ffd86b, #72f1b8) border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
              0 0 20px rgba(183, 149, 255, 0.3),
              0 0 40px rgba(255, 141, 199, 0.2),
              0 0 60px rgba(255, 216, 107, 0.1);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 0 20px rgba(255, 107, 107, 0.3),
                0 0 40px rgba(255, 209, 102, 0.2),
                0 0 60px rgba(124, 227, 139, 0.1);
  }
  100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                0 0 30px rgba(255, 107, 107, 0.4),
                0 0 60px rgba(255, 209, 102, 0.3),
                0 0 90px rgba(124, 227, 139, 0.2);
  }
}

/* Most Popular label */
.most-popular-label {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff6b6b, #ffd166, #7ce38b);
  color: #0f1320;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
  animation: labelFloat 2s ease-in-out infinite alternate;
}

@keyframes labelFloat {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-2px); }
}

/* Pricing display */
.pricing-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  padding: 8px;
  background: rgba(124, 227, 139, 0.08);
  border: 1px solid rgba(124, 227, 139, 0.2);
  border-radius: 10px;
}

.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  line-height: 1.3;
}

.crossed-price {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 12px;
  opacity: 0.8;
  font-weight: 500;
}

.free-label {
  background: linear-gradient(135deg, #7ce38b, #72f1b8);
  color: #0f1320;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(124, 227, 139, 0.4);
  animation: freeGlow 2s ease-in-out infinite alternate;
}

@keyframes freeGlow {
  0% { box-shadow: 0 2px 8px rgba(124, 227, 139, 0.4); }
  100% { box-shadow: 0 4px 16px rgba(124, 227, 139, 0.6), 0 0 20px rgba(124, 227, 139, 0.3); }
}

/* Enhanced hover effects for popular items */
.item-card.rarity-prismatic:hover,
.item-card.rarity-rare:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(255, 107, 107, 0.4),
              0 0 60px rgba(255, 209, 102, 0.3),
              0 0 90px rgba(124, 227, 139, 0.2);
}

.item-media {
	width: 100%;
	aspect-ratio: 1/1;
	background: rgba(14, 20, 37, 0.6);
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 10px;
	display: grid;
	place-items: center;
	font-size: 32px;
	position: relative;
	backdrop-filter: blur(8px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.item-media img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain; /* Ensure image fits without cropping */
	filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); /* Add a subtle shadow */
}

.rarity-image {
	position: absolute;
	bottom: 12px;             /* float above bottom */
	left: 50%;
	transform: translateX(-50%);
	width: 70%;               /* narrower than the item image */
	max-width: 90px;          /* cap for large cards */
	height: auto;
	object-fit: contain;
	opacity: 0.95;
	z-index: 1;
	pointer-events: none;
}


.item-title { margin: 0; font-size: 16px; }
.item-controls { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.stepper { display: grid; grid-auto-flow: column; gap: 6px; align-items: center; }
.stepper button { 
  background: rgba(255, 255, 255, 0.05); 
  color: var(--text); 
  border: 1px solid rgba(255,255,255,0.15); 
  border-radius: 999px; 
  padding: 6px 10px; 
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  cursor: pointer;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255,255,255,0.25);
  transform: scale(1.05);
}

.stepper button:disabled {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255,255,255,0.08);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.stepper button:active:not(:disabled) {
	transform: scale(0.95);
}

/* Stepper limit reached state */
.stepper.limit-reached {
	background: rgba(255, 107, 107, 0.1);
	box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
	animation: limitPulse 2s ease-in-out infinite;
}

.stepper.limit-reached button {
	border-color: #ff6b6b;
	color: #ff6b6b;
}

.stepper.limit-reached button:hover:not(:disabled) {
	background: rgba(255, 107, 107, 0.2);
	border-color: #ff8e8e;
}

.stepper.limit-reached .qty-display {
	color: #ff6b6b;
	font-weight: 700;
}

@keyframes limitPulse {
	0%, 100% { 
		box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
		border-color: #ff6b6b;
	}
	50% { 
		box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
		border-color: #ff8e8e;
	}
}
.qty-display { min-width: 28px; text-align: center; }
.picker-actions { 
	position: sticky; 
	bottom: 0; 
	padding: 16px 0 16px 0; 
	margin-top: 14px; 
	display: flex; 
	justify-content: center; 
	z-index: 10;
}

/* Generation */
.gen-card { 
  background: rgba(20, 26, 42, 0.6); 
  border: 1px solid rgba(255,255,255,0.12); 
  border-radius: 16px; 
  padding: 32px; 
  text-align: center; 
  box-shadow: var(--shadow), 0 0 40px rgba(114, 241, 184, 0.1);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

/* Progress Steps */
.gen-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.4s ease;
  position: relative;
}

.step-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.4s ease;
}

.step-text {
  flex: 1;
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.4s ease;
}

.step-status {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  transition: all 0.4s ease;
}

/* Step States */
.step.pending .step-status {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.step.active {
  background: rgba(114, 241, 184, 0.1);
  border-color: rgba(114, 241, 184, 0.3);
  transform: translateX(8px);
}

.step.active .step-icon {
  background: rgba(114, 241, 184, 0.2);
  animation: stepPulse 1s ease-in-out infinite;
}

.step.active .step-text {
  color: var(--text);
}

.step.active .step-status {
  background: rgba(114, 241, 184, 0.2);
  color: var(--green);
}

.step.completed {
  background: rgba(114, 241, 184, 0.08);
  border-color: rgba(114, 241, 184, 0.2);
}

.step.completed .step-icon {
  background: rgba(114, 241, 184, 0.2);
  color: var(--green);
}

.step.completed .step-text {
  color: var(--text);
}

.step.completed .step-status {
  background: rgba(114, 241, 184, 0.2);
  color: var(--green);
}

@keyframes stepPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Progress Bar */
.gen-progress {
  margin: 24px 0;
}

.gen-bar { 
  height: 16px; 
  background: #0b1020; 
  border-radius: 999px; 
  overflow: hidden; 
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
} 

.gen-fill { 
  height: 100%; 
  width: 0%; 
  background: linear-gradient(90deg, var(--green), #5ad1ef, var(--green)); 
  background-size: 200% 100%;
  transition: width 300ms ease;
  animation: progressGlow 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(114, 241, 184, 0.5);
} 

.gen-percent { 
  font-size: 28px; 
  font-weight: 800; 
  margin: 16px 0; 
  color: var(--green);
  text-shadow: 0 0 20px rgba(114, 241, 184, 0.5);
} 

@keyframes progressGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Animated Background */
.gen-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.floating-item {
  position: absolute;
  font-size: 24px;
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
  animation-delay: var(--delay);
}

.floating-item:nth-child(1) { top: 20%; left: 10%; }
.floating-item:nth-child(2) { top: 30%; right: 15%; }
.floating-item:nth-child(3) { top: 60%; left: 20%; }
.floating-item:nth-child(4) { top: 70%; right: 25%; }
.floating-item:nth-child(5) { top: 40%; left: 50%; }
.floating-item:nth-child(6) { top: 80%; left: 80%; }

@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
    opacity: 0.1;
  }
  50% { 
    transform: translateY(-20px) rotate(180deg); 
    opacity: 0.2;
  }
}

/* Verification */
.verify-card { background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 24px; text-align: center; box-shadow: var(--shadow); }

/* Modal captcha */
.modal { position: fixed; inset: 0; display: none; }
.modal.show { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }
/* User Confirmation Modal */
.confirmation-card { 
	position: relative; 
	z-index: 1; 
	width: min(450px, 92vw); 
	margin: 8vh auto; 
	background: linear-gradient(135deg, #101626, #1a2238); 
	border: 1px solid rgba(255,255,255,0.15); 
	border-radius: 16px; 
	padding: 28px; 
	box-shadow: var(--shadow), 0 0 40px rgba(114, 241, 184, 0.1);
	animation: modalSlideIn 0.4s ease-out;
}

.confirmation-header {
	text-align: center;
	margin-bottom: 24px;
}

.confirmation-icon {
	font-size: 32px;
	margin-bottom: 12px;
	animation: iconPulse 2s ease-in-out infinite;
}

.confirmation-header h3 { 
	margin: 0 0 6px; 
	color: var(--text);
	font-size: 22px;
	font-weight: 700;
}

.confirmation-subtitle {
	color: var(--muted);
	font-size: 14px;
	margin-bottom: 8px;
}

.user-display {
	display: flex;
	align-items: center;
	gap: 20px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	padding: 20px;
	margin: 20px 0;
}

.user-avatar-large {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	overflow: hidden;
	border: 3px solid var(--green);
	background: rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.user-avatar-large img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* CSS fallback avatar */
.user-avatar-large.no-avatar::before {
	content: attr(data-initials);
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	font-weight: 700;
	color: #ffffff;
	background: linear-gradient(135deg, #2E8B57, #3CB371);
	text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.user-details {
	flex: 1;
}

.user-name {
	font-size: 20px;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 4px;
}

.user-id {
	font-size: 14px;
	color: var(--muted);
	margin-bottom: 8px;
}

.verification-badge {
	background: rgba(114, 241, 184, 0.15);
	color: var(--green);
	border: 1px solid rgba(114, 241, 184, 0.3);
	padding: 4px 8px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 600;
	display: inline-block;
}

.confirmation-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin-top: 24px;
}

.confirmation-actions .ghost-btn,
.confirmation-actions .primary-btn {
	flex: 1;
	max-width: 140px;
}

/* Username Error Modal */
.error-card { 
	position: relative; 
	z-index: 1; 
	width: min(400px, 90vw); 
	margin: 20vh auto; 
	background: linear-gradient(135deg, var(--card), #1a2238); 
	border: 1px solid rgba(255, 107, 107, 0.4); 
	border-radius: 16px; 
	padding: 28px; 
	box-shadow: var(--shadow), 0 0 30px rgba(255, 107, 107, 0.1);
	animation: modalSlideIn 0.3s ease-out;
}

.error-header {
	text-align: center;
	margin-bottom: 24px;
}

.error-icon {
	font-size: 28px;
	margin-bottom: 16px;
	animation: iconBounce 0.6s ease-out;
}

.error-header h3 { 
	margin: 0 0 16px; 
	color: var(--danger);
	font-size: 22px;
	font-weight: 700;
}

.error-header p {
	margin: 0;
	color: var(--text);
	font-size: 15px;
	line-height: 1.5;
}

.error-actions {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.error-actions .primary-btn {
	min-width: 120px;
	background: rgba(255, 107, 107, 0.15);
	border-color: rgba(255, 107, 107, 0.4);
	color: var(--danger);
}

.error-actions .primary-btn:hover {
	background: rgba(255, 107, 107, 0.25);
	border-color: rgba(255, 107, 107, 0.6);
}

@keyframes iconBounce {
	0% { transform: scale(0.3); opacity: 0; }
	50% { transform: scale(1.1); }
	100% { transform: scale(1); opacity: 1; }
}

.captcha-card { 
	position: relative; 
	z-index: 1; 
	width: min(400px, 92vw); 
	margin: 8vh auto; 
	background: linear-gradient(135deg, #101626, #1a2238); 
	border: 1px solid rgba(255,255,255,0.15); 
	border-radius: 16px; 
	padding: 24px; 
	box-shadow: var(--shadow), 0 0 40px rgba(114, 241, 184, 0.1);
	animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
	0% { transform: translateY(30px) scale(0.95); opacity: 0; }
	100% { transform: translateY(0) scale(1); opacity: 1; }
}

.captcha-header {
	text-align: center;
	margin-bottom: 20px;
}

.captcha-icon {
	font-size: 32px;
	margin-bottom: 8px;
	animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

.captcha-header h3 { 
	margin: 0 0 6px; 
	color: var(--text);
	font-size: 20px;
}

.captcha-subtitle {
	color: var(--muted);
	font-size: 14px;
	margin-bottom: 8px;
}

.captcha-container {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 16px;
	margin: 16px 0;
}

.captcha-warning {
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 107, 107, 0.1);
	border: 1px solid rgba(255, 107, 107, 0.3);
	border-radius: 8px;
	padding: 12px 16px;
	margin-top: 16px;
	color: var(--danger);
	font-size: 13px;
	font-weight: 600;
}

.warning-icon {
	font-size: 16px;
}

.cap-check { display: flex; align-items: center; gap: 10px; background: #0e1425; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 12px; }
.cap-brand { color: var(--muted); font-size: 12px; margin-top: 6px; text-align: right; }
.cap-instructions { margin: 10px 0; color: var(--muted); font-size: 14px; }
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cap-tile { aspect-ratio: 1 / 1; background: #0f1528; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; display: grid; place-items: center; font-size: 28px; cursor: pointer; }
.cap-tile.is-selected { outline: 2px solid var(--green); }
.cap-actions { display: flex; justify-content: space-between; margin-top: 10px; }
.cap-spinner { width: 26px; height: 26px; border: 3px solid rgba(255,255,255,0.2); border-top-color: var(--green); border-radius: 50%; animation: spin 900ms linear infinite; margin: 12px auto; }
.cap-wait-text { text-align: center; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results-header { text-align: center; margin-bottom: 18px; }
.results-sub { color: var(--muted); margin-top: 6px; }
.loot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.loot-card { 
  background: rgba(15, 21, 40, 0.6); 
  border: 1px solid rgba(255,255,255,0.12); 
  border-radius: 14px; 
  padding: 14px; 
  position: relative; 
  overflow: hidden; 
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}
.loot-card:hover {
  background: rgba(15, 21, 40, 0.8);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

/* Glowing gradient borders for popular items in results */
.loot-card.rarity-prismatic {
  border: 2px solid transparent;
  background: linear-gradient(rgba(15, 21, 40, 0.6), rgba(15, 21, 40, 0.6)) padding-box,
              linear-gradient(45deg, #ff6b6b, #ffd166, #7ce38b, #b795ff) border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
              0 0 20px rgba(255, 107, 107, 0.3),
              0 0 40px rgba(255, 209, 102, 0.2),
              0 0 60px rgba(124, 227, 139, 0.1);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

.loot-card.rarity-rare {
  border: 2px solid transparent;
  background: linear-gradient(rgba(15, 21, 40, 0.6), rgba(15, 21, 40, 0.6)) padding-box,
              linear-gradient(45deg, #b795ff, #ff8dc7, #ffd86b, #72f1b8) border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
              0 0 20px rgba(183, 149, 255, 0.3),
              0 0 40px rgba(255, 141, 199, 0.2),
              0 0 60px rgba(255, 216, 107, 0.1);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

.loot-card.rarity-prismatic:hover,
.loot-card.rarity-rare:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(255, 107, 107, 0.4),
              0 0 60px rgba(255, 209, 102, 0.3),
              0 0 90px rgba(124, 227, 139, 0.2);
}

.loot-title { margin: 0; font-size: 18px; }
.loot-qty { color: var(--muted); font-size: 14px; margin-top: 4px; }
.rarity { position: absolute; top: 10px; right: 10px; padding: 4px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; letter-spacing: 0.4px; }
.rarity.common { background: #2b2f3f; color: #c6cbd9; }
.rarity.rare { background: rgba(114, 241, 184, 0.15); color: var(--green); border: 1px solid rgba(114, 241, 184, 0.25); }
.rarity.legendary { background: rgba(255, 216, 107, 0.15); color: var(--gold); border: 1px solid rgba(255, 216, 107, 0.25); }
.rarity.cosmic { background: rgba(183, 149, 255, 0.15); color: var(--purple); border: 1px solid rgba(183, 149, 255, 0.3); }
.results-actions { 
	position: sticky; 
	bottom: 0; 
	padding: 16px 0 16px 0; 
	margin-top: 18px; 
	display: flex; 
	gap: 10px; 
	justify-content: center; 
	z-index: 100;
}

.share-hint { text-align: center; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #10182a; border: 1px solid rgba(255,255,255,0.1); color: var(--text); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 200ms ease, transform 200ms ease; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* Limit Alert */
.limit-alert {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: white;
  z-index: 1001;
  animation: slideDown 0.4s ease-out;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.limit-alert-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  font-weight: 600;
  font-size: 16px;
}

.limit-icon {
  font-size: 20px;
  animation: pulse 1s ease-in-out infinite;
}

.limit-text {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@keyframes slideDown {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Privacy modal */
.policy-card { position: relative; z-index: 1; width: min(680px, 94vw); max-height: 90vh; overflow: auto; margin: 8vh auto; background: rgba(16, 22, 38, 0.92); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.policy-card h3 { margin: 0 0 6px; }
.policy-updated { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.policy-body h4 { margin: 14px 0 6px; }
.policy-body p { color: #cbd3e6; }
.policy-disclaimer { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); color: var(--muted); font-size: 12px; }
.modal-close { position: absolute; top: 10px; right: 12px; background: transparent; color: var(--muted); border: none; cursor: pointer; font-size: 18px; }
.privacy-btn { position: fixed; right: 14px; bottom: 14px; background: rgba(59,130,246,0.15); color: #a7c3ff; border: 1px solid rgba(59,130,246,0.35); border-radius: 999px; padding: 8px 12px; font-weight: 600; box-shadow: none; cursor: pointer; }
.privacy-btn:hover { background: rgba(59,130,246,0.22); }
.privacy-btn:active { transform: translateY(1px); }

/* Mobile responsive design - stable version */
@media (max-width: 768px) {
  #app { padding: 16px; }
  
  .hero { padding: 28px 20px; margin-bottom: 20px; }
  .notification-feed { padding: 24px 20px; }
  
  /* Larger touch targets */
  .primary-btn, .ghost-btn {
    padding: 16px 24px;
    font-size: 16px;
    min-height: 48px;
  }
  
  .start-form input {
    padding: 16px 18px;
    font-size: 16px;
    min-height: 48px;
  }
  
  .tab-btn { 
    padding: 12px 16px; 
    font-size: 16px;
    min-height: 44px;
  }
  
  .stepper button {
    min-width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  /* Keep 2-column but make cards bigger */
  .item-card { 
    padding: 16px; 
    gap: 12px; 
  }
  
  .loot-card { padding: 16px; }
  
  /* Stack action buttons */
  .results-actions, .picker-actions { 
    flex-direction: column; 
    gap: 12px;
  }
  
  /* Bigger modal */
  .confirmation-card {
    padding: 24px 20px;
  }
  
  .confirmation-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .confirmation-actions .ghost-btn,
  .confirmation-actions .primary-btn {
    max-width: none;
    min-height: 48px;
  }
}



