/* ==============================
   LINCOLN X - PROFESSIONAL GAMER THEME
   ============================== */
:root {
  --primary: #00a8ff;
  --primary-dark: #0088cc;
  --secondary: #ff6b00;
  --secondary-dark: #e65c00;
  --accent: #ff9500;
  --bg-dark: #0a0a0f;
  --bg-card: #14141c;
  --bg-elevated: #1e1e2a;
  --text: #f0f0f5;
  --text-dim: #9a9ab0;
  --border: rgba(0, 168, 255, 0.2);
  --glow-primary: 0 0 20px rgba(0, 168, 255, 0.35);
  --glow-secondary: 0 0 20px rgba(255, 107, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Orbitron', 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;
}

[data-theme="light"] {
  --primary: #0066cc;
  --primary-dark: #0052a3;
  --secondary: #ff6b00;
  --secondary-dark: #e65c00;
  --accent: #ff9500;
  --bg-dark: #f0f4f8;
  --bg-card: #ffffff;
  --bg-elevated: #e8edf3;
  --text: #1a1a2e;
  --text-dim: #5a6270;
  --border: rgba(0, 102, 204, 0.2);
  --glow-primary: 0 0 20px rgba(0, 102, 204, 0.15);
  --glow-secondary: 0 0 20px rgba(255, 107, 0, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(0, 168, 255, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 0, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-dark) 0%, #0a0a0f 100%);
  background-attachment: fixed;
}

/* ==============================
   HEADER - FLOATING/FIXED BANNER
   ============================== */
.nextgen-header {
  position: static;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 99999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

[data-theme="light"] .nextgen-header {
  background: rgba(240, 244, 248, 0.9);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  box-shadow: var(--glow-primary);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.brand-logo {
  width: 150px;
  height: 46px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.logo-glow-ring,
.logo-glow {
  display: none;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  z-index: 2;
}

.brand-logo-image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.brand-logo-image.loaded {
  display: block;
}

.brand-logo-image.loaded + .brand-logo-fallback {
  display: none;
}

.brand-logo-fallback {
  position: relative;
  z-index: 2;
  color: #f3f5ff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.brand-logo-fallback b {
  color: #00d4e8;
  font-size: 24px;
}

.logo-glow-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60%);
  animation: logoShine 3s infinite;
}

@keyframes logoShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 1px;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: var(--glow-primary);
}

.brand-tagline {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
}

.header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ==============================
   SOCIAL LINKS
   ============================== */
.social-links-header {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-right: 4px;
}

.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.social-icon:hover {
  transform: translateY(-2px) scale(1.05);
}

.social-icon:active {
  transform: scale(0.95);
}

.fb-icon {
  background: linear-gradient(135deg, #1877f2, #0a5cc7);
  color: #fff;
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
}

.fb-icon:hover {
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.6);
}

.tt-icon {
  background: linear-gradient(135deg, #25f4ee, #fe2c55);
  color: #fff;
  box-shadow: 0 4px 15px rgba(254, 44, 85, 0.4);
}

.tt-icon:hover {
  box-shadow: 0 6px 20px rgba(254, 44, 85, 0.6);
}

.sp-icon {
  background: linear-gradient(135deg, #ee4d2d, #ff6b00);
  color: #fff;
  box-shadow: 0 4px 15px rgba(238, 77, 45, 0.4);
}

.sp-icon:hover {
  box-shadow: 0 6px 20px rgba(238, 77, 45, 0.6);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
  border-color: var(--primary);
}

.icon-btn:active {
  transform: scale(0.95);
}

.tutorial-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tutorial-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-secondary);
}

/* ==============================
   MODALS
   ============================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.welcome-modal {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-primary);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.modal-close:hover {
  background: var(--primary);
  color: #0a0a0a;
}

.welcome-logo {
  font-size: 48px;
  margin-bottom: 10px;
  animation: float 3s ease-in-out infinite;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.welcome-logo {
  animation: none;
}

.welcome-logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  z-index: 2;
}

.welcome-logo-image {
  display: none;
  width: 106px;
  height: 106px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.welcome-logo-image.loaded {
  display: block;
}

.welcome-logo-image.loaded + .welcome-logo-fallback {
  display: none;
}

.welcome-logo-fallback {
  position: relative;
  z-index: 2;
  color: #f3f5ff;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.welcome-logo-fallback b {
  color: #00d4e8;
  font-size: 38px;
}

.logo-glow {
  position: absolute;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  animation: pulseGlow 2s ease-in-out infinite;
  z-index: -1;
  opacity: 0.3;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 107, 0, 0.5);
    transform: scale(1.1);
  }
}

.brand-accent {
  color: var(--secondary);
  text-shadow: var(--glow-secondary);
}

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

.welcome-header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 8px;
  text-shadow: var(--glow-primary);
}

.welcome-header h2 {
  font-size: 16px;
  color: var(--secondary);
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.welcome-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.welcome-step {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  transition: var(--transition);
}

.welcome-step:hover {
  border-color: var(--secondary);
  transform: translateY(-3px);
  box-shadow: var(--glow-secondary);
}

.step-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--primary);
  display: flex;
  justify-content: center;
}

.welcome-step p {
  font-size: 12px;
  color: var(--text);
}

.welcome-ai-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(0, 168, 255, 0.1), rgba(255, 107, 0, 0.1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.ai-tip-icon {
  font-size: 32px;
  flex-shrink: 0;
  animation: float 2s ease-in-out infinite;
  color: var(--primary);
  display: flex;
}

.ai-tip-text strong {
  color: var(--primary);
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.ai-tip-text p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.welcome-btn.mobile-friendly {
  width: 100%;
  max-width: 320px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 16px;
  margin: 15px 0 5px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--glow-secondary);
}

.welcome-btn.mobile-friendly:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255, 107, 0, 0.4);
}

.welcome-btn.mobile-friendly:active {
  transform: scale(0.97);
}

/* ==============================
   ALERT MODAL
   ============================== */
.alert-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.alert-modal.show {
  display: flex;
}

.alert-box {
  background: var(--bg-card);
  border: 1px solid var(--secondary);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-secondary);
}

.alert-icon {
  font-size: 48px;
  margin-bottom: 10px;
  color: var(--secondary);
  display: flex;
  justify-content: center;
}

.alert-box h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--secondary);
  margin-bottom: 10px;
}

.alert-box p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 15px;
}

.alert-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 15px 0;
  padding: 15px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.detail-item span {
  color: var(--text-dim);
}

.detail-item strong {
  color: var(--primary);
}

.alert-suggestions {
  text-align: left;
  margin: 15px 0;
  padding: 15px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
}

.alert-suggestions p {
  margin-bottom: 8px;
  color: var(--text);
}

.alert-suggestions ul {
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-dim);
}

.alert-suggestions li {
  margin-bottom: 4px;
}

.alert-close-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.alert-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-secondary);
}

/* ==============================
   TUTORIAL MODAL
   ============================== */
#tutorialModal .modal-content {
  max-width: 500px;
  text-align: left;
}

#tutorialModal h2 {
  font-family: var(--font-display);
  color: var(--primary);
  font-size: 22px;
  margin-bottom: 20px;
  text-align: center;
}

.tutorial-section {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

.tutorial-section h3 {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 8px;
  font-family: var(--font-display);
}

.tutorial-section p,
.tutorial-section ul {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.tutorial-section ul {
  padding-left: 20px;
  margin-top: 5px;
}

.tutorial-section li {
  margin-bottom: 3px;
}

.close-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.close-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-secondary);
}

/* ==============================
   MAIN CONTENT
   ============================== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  padding-top: 16px;
  padding-bottom: 100px;
}

/* ==============================
   STORAGE SECTION
   ============================== */
.storage-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin: 16px 0;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.storage-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--primary);
  margin: 0;
}

.storage-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
}

.storage label {
  font-size: 13px;
  display: block;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

.storage select {
  width: 100%;
  padding: 14px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 16px;
  outline: none;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2300a8ff' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath d='M7.14.589a1 1 0 0 1 1.42 0l3.71 7.22a1 1 0 0 1-.58 1.29l-3.71 7.22a1 1 0 0 1-1.57 0l-3.71-7.22a1 1 0 0 1-.58-1.29L8.58.58z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
}

.storage select:focus {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.storage-info {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}

.info-item span {
  color: var(--text-dim);
}

.info-item strong {
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
}

#storageBarContainer {
  width: 100%;
  height: 16px;
  background: var(--bg-elevated);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

#storageBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1), background 0.4s ease;
  position: relative;
  border-radius: 20px;
}

#storageBar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
  pointer-events: none;
  border-radius: 20px;
}

@keyframes shimmer {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

#storageBar.full-bar {
  background: linear-gradient(90deg, var(--secondary), #ff4d4d);
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
}

.storage .error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--secondary);
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  transition: var(--transition);
}

.storage .error.blink-warning {
  animation: pulseWarning 0.8s infinite;
  box-shadow: var(--glow-secondary);
  background: rgba(255, 107, 0, 0.1);
}

@keyframes pulseWarning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ==============================
   PRICE LIST
   ============================== */
.price-list {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

.price-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
}

.price-toggle:hover {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.price-toggle:active {
  transform: scale(0.98);
}

.price-arrow {
  transition: var(--transition);
  font-size: 12px;
  color: var(--primary);
}

.price-list.open .price-arrow {
  transform: rotate(180deg);
}

.price-list-content {
  margin-top: 10px;
  animation: fadeInUp 0.3s ease;
}

.price-table {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  text-align: center;
}

.price-row span:first-child {
  text-align: left;
}

.price-row:last-child {
  border-bottom: none;
}

.price-row:hover {
  background: rgba(0, 168, 255, 0.05);
}

.price-row span:nth-child(2) {
  color: var(--secondary);
  font-weight: 700;
}

.price-row span:nth-child(3) {
  color: var(--primary);
  font-weight: 700;
}

.price-header {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.price-header span:nth-child(2),
.price-header span:nth-child(3) {
  color: #fff;
}

.price-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
}

/* ==============================
   SEARCH
   ============================== */
.search {
  margin: 16px 0;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  font-size: 18px;
  color: var(--text-dim);
  transition: var(--transition);
  pointer-events: none;
  z-index: 2;
  display: flex;
}

.search input {
  width: 100%;
  padding: 14px 45px 14px 45px;
  font-size: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  outline: none;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  transition: var(--transition);
  font-weight: 500;
}

.search input:focus {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.clear-search {
  position: absolute;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.clear-search:hover {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

/* ==============================
   CATEGORY NAVIGATION
   ============================== */
.category-middle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin: 16px 0;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.category-middle h3 {
  margin: 0 0 15px 0 !important;
  font-size: 16px;
  color: var(--primary);
  font-family: var(--font-display);
  text-align: center;
  letter-spacing: 1px;
}

.category-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.category-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: var(--transition);
  min-height: 60px;
}

.cat-icon {
  font-size: 20px;
  color: var(--primary);
  display: flex;
}

.category-nav button:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

.category-nav button:active {
  transform: scale(0.95);
}

.category-nav button.active {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  border-color: var(--secondary);
  box-shadow: var(--glow-secondary);
  font-weight: 900;
}

.category-nav button.active .cat-icon {
  color: #fff;
}

.category-nav button.category-locked {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(1);
}

.category-nav button.category-locked:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

.category-lock-notice {
  display: none;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 149, 0, 0.45);
  border-radius: 8px;
  background: rgba(255, 149, 0, 0.1);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.category-lock-notice.visible {
  display: block;
}

/* ==============================
   SPECS BOX
   ============================== */
.specs-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
  padding: 16px 20px;
  font-size: 13px;
  transition: var(--transition);
}

.specs-box h3 {
  margin: 0 0 10px 0;
  color: var(--primary);
  font-size: 16px;
  font-family: var(--font-display);
}

.specs-box p {
  line-height: 1.6;
  color: var(--text);
  font-size: 13px;
}

.specs-box .warning {
  color: var(--secondary);
  font-weight: 600;
}

/* ==============================
   GAME GRID
   ============================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 0;
  margin: 16px 0;
}

/* ==============================
   GAME CARD
   ============================== */
.game {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.game:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow-primary);
  border-color: var(--primary);
}

.game img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: var(--transition);
  cursor: pointer;
}

.game:hover img {
  transform: scale(1.03);
}

.game .info {
  padding: 12px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game .info b {
  font-size: 13px;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  line-height: 1.3;
}

.game .info small {
  color: var(--text-dim);
  font-size: 10px;
  display: block;
}

.game button {
  width: 100%;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  transition: var(--transition);
  background: var(--primary);
  color: #fff;
  min-height: 40px;
}

.game button:hover {
  filter: brightness(1.1);
}

.game button.remove {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
}

.new-badge {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: bold;
  vertical-align: middle;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

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

.game:nth-child(1) { animation-delay: 0.05s; }
.game:nth-child(2) { animation-delay: 0.1s; }
.game:nth-child(3) { animation-delay: 0.15s; }
.game:nth-child(4) { animation-delay: 0.2s; }
.game:nth-child(5) { animation-delay: 0.25s; }
.game:nth-child(6) { animation-delay: 0.3s; }
.game:nth-child(7) { animation-delay: 0.35s; }
.game:nth-child(8) { animation-delay: 0.4s; }

/* ==============================
   FLOATING VIEW BUTTON
   ============================== */
#floatingView {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(255, 107, 0, 0.4);
  transition: var(--transition);
  z-index: 999;
  min-height: 48px;
}

#floatingView:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 12px 40px rgba(255, 107, 0, 0.5);
}

#floatingView:active {
  transform: translateX(-50%) scale(0.97);
}

.floating-icon {
  font-size: 18px;
  display: flex;
}

.floating-count {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0 5px;
}

/* ==============================
   AI ASSISTANT BUTTON
   ============================== */
.ai-assistant-btn {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(0, 168, 255, 0.5);
  transition: var(--transition);
  z-index: 998;
}

.ai-assistant-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 40px rgba(255, 107, 0, 0.6);
}

.ai-assistant-btn:active {
  transform: scale(0.95);
}

.ai-btn-icon {
  position: relative;
  z-index: 2;
  display: flex;
}

.ai-btn-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  animation: aiPulse 2s infinite;
  z-index: 1;
}

@keyframes aiPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ==============================
   AI CHAT WIDGET
   ============================== */
.ai-chat-widget {
  position: fixed;
  bottom: 145px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 180px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--glow-primary);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  flex-shrink: 0;
}

.ai-chat-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ai-chat-title {
  flex: 1;
  min-width: 0;
}

.ai-chat-title strong {
  font-size: 14px;
  display: block;
  font-family: var(--font-display);
}

.ai-chat-title small {
  font-size: 10px;
  opacity: 0.8;
  display: block;
}

.ai-chat-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-dark);
}

.ai-message {
  display: flex;
  max-width: 85%;
}

.ai-message.ai-bot {
  align-self: flex-start;
}

.ai-message.ai-user {
  align-self: flex-end;
}

.ai-message-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.ai-bot .ai-message-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.ai-user .ai-message-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-chat-input-area {
  padding: 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.ai-quick-questions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ai-quick-btn {
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.ai-quick-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: var(--glow-secondary);
}

.ai-input-row {
  display: flex;
  gap: 8px;
}

.ai-input-row input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  min-height: 44px;
}

.ai-input-row input:focus {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.ai-send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--glow-secondary);
}

.ai-send-btn:active {
  transform: scale(0.95);
}

.ai-typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.ai-typing span {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.ai-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ==============================
   BACK TO TOP
   ============================== */
.back-to-top {
  position: fixed;
  bottom: 80px;
  left: 16px;
  right: auto;
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  z-index: 997;
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-primary);
  border-color: var(--primary);
}

/* ==============================
   VIEW PANEL (BOTTOM SHEET)
   ============================== */
.floating-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  max-height: 80vh;
  overflow-y: auto;
  z-index: 5000;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  animation: sheetIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.panel-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
  font-family: var(--font-display);
}

.panel-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.panel-close:hover {
  background: var(--secondary);
  color: #fff;
}

.panel-storage {
  margin-bottom: 15px;
  padding: 12px 15px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
}

.panel-list {
  margin-top: 10px;
}

.view-item {
  background: var(--bg-elevated);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
  gap: 8px;
}

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

.view-item-info b {
  color: var(--primary);
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.view-item-info small {
  color: var(--text-dim);
  font-size: 10px;
  display: block;
  margin-top: 2px;
}

.view-item-remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(255, 107, 0, 0.15);
  border: 1px solid var(--secondary);
  border-radius: 8px;
  color: var(--secondary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.view-item-remove:hover {
  background: var(--secondary);
  color: #fff;
  transform: scale(1.1);
}

.panel-actions {
  margin-top: 10px;
}

.btn-clear {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 0, 0.1);
  color: var(--secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
}

.btn-clear:hover {
  background: var(--secondary);
  color: #fff;
  box-shadow: var(--glow-secondary);
}

.button-group {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.btn-secondary,
.btn-copy,
.btn-invoice,
.btn-tiktok {
  flex: 1;
  min-width: 100px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  font-family: var(--font-body);
  min-height: 44px;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--text-dim);
  color: #fff;
}

.btn-copy {
  background: var(--primary);
  color: #fff;
}

.btn-copy:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-invoice {
  background: linear-gradient(135deg, #1a1a2e, #2d2d44);
  color: #ff6a00;
  border: 1px solid rgba(255,106,0,0.3);
}

.btn-invoice:hover {
  background: linear-gradient(135deg, #2d2d44, #3d3d5c);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,106,0,0.25);
}

.btn-tiktok {
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  color: #fff;
}

.btn-tiktok:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-secondary);
}

/* ==============================
   PANEL SOCIAL LINKS
   ============================== */
.panel-social {
  margin-top: 15px;
  padding: 12px 15px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-social-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.panel-social-links {
  display: flex;
  gap: 8px;
}

.panel-social-links .social-icon {
  width: 40px;
  height: 40px;
}

/* ==============================
   ORDER METHOD
   ============================== */
.order-method {
  margin-top: 15px;
  padding: 15px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.order-method h4 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.order-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.order-option:hover {
  border-color: var(--primary);
}

.order-option input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.order-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.order-option small {
  font-size: 10px;
  color: var(--text-dim);
  display: block;
}

.order-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(0, 168, 255, 0.08);
  box-shadow: var(--glow-primary);
}

/* ==============================
   ORDER FORM
   ============================== */
.order-form {
  margin-top: 15px;
  padding: 15px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.order-form h4 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.form-group {
  margin-bottom: 10px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
  min-height: 44px;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

.form-input::placeholder {
  color: var(--text-dim);
}

/* ==============================
   PS4 ERROR MODAL
   ============================== */
.ps4-error-box {
  border-color: var(--secondary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glow-secondary);
}

.ps4-error-box .alert-icon {
  font-size: 56px;
  margin-bottom: 15px;
  animation: pulse 1.5s infinite;
}

.ps4-error-box h3 {
  color: var(--secondary);
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 15px;
}

.ps4-error-box p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
}

/* ==============================
   STICKY STORAGE BAR
   ============================== */
.sticky-storage {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-storage.show {
  transform: translateY(0);
}

[data-theme="light"] .sticky-storage {
  background: rgba(240, 244, 248, 0.95);
}

.sticky-icon {
  font-size: 16px;
  flex-shrink: 0;
  color: var(--primary);
  display: flex;
}

#stickyStorageText {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.sticky-bar-container {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

#stickyStorageBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1), background 0.4s ease;
}

.sticky-percent {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 35px;
  text-align: right;
}

/* ==============================
   HIGHLIGHT FLASH
   ============================== */
.highlight-flash {
  animation: highlightFlash 0.8s ease-in-out;
}

@keyframes highlightFlash {
  0% { box-shadow: 0 0 0 0 rgba(0, 168, 255, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(0, 168, 255, 0.2); }
  100% { box-shadow: 0 0 0 0 rgba(0, 168, 255, 0); }
}

/* ==============================
   TOUCH ACTIVE STATE
   ============================== */
.touch-active {
  transform: scale(0.97) !important;
}

/* ==============================
   MODAL BLUR
   ============================== */
.modal-blur {
  overflow: hidden;
}

/* ==============================
   RESPONSIVE BREAKPOINTS
   ============================== */
@media (max-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }

  .game img {
    height: 140px;
  }

  .game .info {
    padding: 10px;
  }

  .game .info b {
    font-size: 12px;
  }

  .game .info small {
    font-size: 10px;
  }

  .game button {
    padding: 10px;
    font-size: 11px;
  }

  .category-buttons {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  .welcome-steps {
    grid-template-columns: 1fr 1fr;
  }

  .modal-content {
    padding: 25px 20px;
  }

  .welcome-header h1 {
    font-size: 22px;
  }

  .welcome-header h2 {
    font-size: 14px;
  }

  .brand-text h1 {
    font-size: 16px;
  }

  .tutorial-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .social-icon {
    width: 32px;
    height: 32px;
  }

  .social-links-header {
    gap: 4px;
  }

  .ai-chat-widget {
    width: calc(100vw - 32px);
    height: 60vh;
    bottom: 140px;
  }

  .ai-assistant-btn {
    bottom: 80px;
    right: 12px;
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
  }

  .game img {
    height: 120px;
  }

  .game .info b {
    font-size: 11px;
  }

  .game .info small {
    font-size: 9px;
  }

  .game button {
    font-size: 10px;
    padding: 8px;
  }

  .category-buttons {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 6px;
  }

  .category-nav button {
    padding: 10px 6px;
    font-size: 10px;
    min-height: 55px;
  }

  .cat-icon {
    font-size: 18px;
  }

  .welcome-steps {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .welcome-step {
    padding: 12px 10px;
  }

  .step-icon {
    font-size: 24px;
  }

  .welcome-step p {
    font-size: 11px;
  }

  .storage-main {
    padding: 15px;
  }

  .storage-header h2 {
    font-size: 16px;
  }

  .main-content {
    padding: 0 10px;
    padding-bottom: 90px;
  }

  #floatingView {
    bottom: 15px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .floating-text {
    display: none;
  }

  #floatingView {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    justify-content: center;
    padding: 0;
  }

  .floating-icon {
    font-size: 22px;
  }

  .floating-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .back-to-top {
    bottom: 80px;
    left: 12px;
    right: auto;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .button-group {
    flex-direction: column;
  }

  .btn-secondary,
  .btn-copy,
  .btn-invoice,
  .btn-tiktok {
    width: 100%;
    min-width: 100%;
  }

  .panel-social {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .panel-social-links {
    width: 100%;
    justify-content: center;
  }

  .ai-chat-widget {
    bottom: 135px;
    right: 8px;
    width: calc(100vw - 16px);
    height: 65vh;
  }

  .ai-assistant-btn {
    bottom: 80px;
    right: 8px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .ai-quick-questions {
    gap: 4px;
  }

  .ai-quick-btn {
    font-size: 9px;
    padding: 5px 8px;
  }
}

/* ==============================
   ANDROID FIXES
   ============================== */
@supports (-webkit-appearance: none) {
  input, select, textarea {
    font-family: inherit;
  }
}

/* Prevent zoom on input focus for iOS/Android */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  font-size: 16px;
}

/* ==============================
   REDUCED MOTION
   ============================== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ==============================
   MOBILE PICKER REFINEMENT
   ============================== */
@media (max-width: 640px) {
  body {
    background-image: linear-gradient(180deg, #0a0a0f 0%, #10121b 100%);
    background-attachment: scroll;
  }

  .nextgen-header {
    min-height: 64px;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  }

  .brand-logo {
    width: 132px;
    height: 40px;
    border-radius: 0;
  }

  .brand-text h1 {
    font-size: 15px;
  }

  .brand-tagline {
    font-size: 8px;
    letter-spacing: 1.4px;
  }

  .social-links-header,
  #tutorialBtn {
    display: none;
  }

  .header-controls {
    gap: 6px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .main-content {
    padding: 0 12px 112px;
  }

  .storage-main,
  .search,
  .category-middle,
  .specs-box {
    border-radius: 8px;
  }

  .storage-main {
    padding: 16px;
    margin-top: 14px;
  }

  .search {
    margin: 14px 0;
  }

  .search input {
    min-height: 48px;
  }

  .category-middle {
    padding: 14px 12px;
    margin: 0 0 14px;
  }

  .category-middle h3 {
    margin-bottom: 12px !important;
    font-size: 13px;
  }

  .category-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .category-nav button {
    min-height: 64px;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 10px;
  }

  .cat-icon {
    font-size: 19px;
  }

  .specs-box {
    margin: 0 0 14px;
    padding: 14px;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 8px;
  }

  .game {
    min-width: 0;
    border-radius: 8px;
  }

  .game img {
    height: 108px !important;
    object-fit: cover;
  }

  .game .info {
    min-height: 58px;
    padding: 7px 6px;
  }

  .game .info b {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 2;
    font-size: 10px;
    line-height: 1.2;
  }

  .game .info small {
    margin-top: 4px;
    font-size: 8px;
  }

  .game button {
    min-height: 36px;
    padding: 7px 4px;
    font-size: 10px;
  }

  #floatingView {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
  }

  .floating-text {
    display: none;
  }

  .ai-assistant-btn {
    right: 16px;
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
  }

  .sticky-storage {
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  }

  .modal,
  .alert-modal {
    align-items: center;
    justify-content: center;
    padding: 14px;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .modal-content.welcome-content,
  .alert-box {
    width: min(100%, 420px);
    max-height: min(86dvh, 680px);
    overflow-y: auto;
    border-radius: 12px;
    padding: 20px 18px;
  }

  .modal-content.welcome-content {
    max-width: 350px;
    padding: 18px 16px;
  }

  .welcome-logo {
    min-height: 58px;
    margin-bottom: 4px;
  }

  .welcome-logo-image {
    width: 70px;
    height: 70px;
  }

  .welcome-logo-fallback {
    font-size: 15px;
  }

  .welcome-logo-fallback b {
    font-size: 28px;
  }

  .logo-glow {
    width: 58px;
    height: 58px;
  }

  .welcome-header h1 {
    font-size: 16px;
    margin-bottom: 5px;
  }

  .welcome-header h2 {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .welcome-subtitle {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .welcome-steps {
    gap: 8px;
    margin-top: 12px;
  }

  .welcome-step {
    border-radius: 8px;
    padding: 10px 7px;
  }

  .step-icon {
    margin-bottom: 5px;
    font-size: 22px;
  }

  .welcome-step p {
    font-size: 10px;
    line-height: 1.35;
  }

  .welcome-ai-tip {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
  }

  .ai-tip-icon {
    font-size: 24px;
  }

  .ai-tip-text strong {
    font-size: 12px;
  }

  .ai-tip-text p {
    font-size: 10px;
  }

  .welcome-btn.mobile-friendly {
    min-height: 46px;
    margin: 12px 0 0;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
  }

  .alert-box {
    padding: 20px 16px;
  }

  .alert-box h3,
  .ps4-error-box h3 {
    font-size: 18px;
  }

  .alert-box p,
  .ps4-error-box p {
    font-size: 13px !important;
    line-height: 1.55;
  }

  .alert-details,
  .alert-suggestions {
    border-radius: 8px;
    padding: 12px;
  }

  .alert-close-btn {
    min-height: 46px;
    border-radius: 8px;
  }
}

/* ==============================
   NEXT-GEN SURFACE REFINEMENT
   ============================== */
body {
  background-color: #080b12;
  background-image:
    linear-gradient(rgba(44, 148, 206, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 148, 206, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #080b12 0%, #0c1019 100%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}

.nextgen-header {
  min-height: 68px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.storage-main,
.category-middle,
.specs-box,
.search {
  position: relative;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.storage-main::before,
.category-middle::before,
.specs-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: rgba(0, 168, 255, 0.55);
}

.game {
  border: 1px solid rgba(0, 168, 255, 0.16);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.game:hover {
  border-color: rgba(0, 168, 255, 0.7);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3), 0 0 18px rgba(0, 168, 255, 0.13);
}

.game button {
  letter-spacing: 0.7px;
}

.catalog-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 2px 10px;
  color: var(--text-dim);
  font-size: 12px;
}

#catalogCategory {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
}

#catalogCount {
  padding: 5px 9px;
  border: 1px solid rgba(0, 168, 255, 0.24);
  border-radius: 999px;
  background: rgba(0, 168, 255, 0.08);
  color: var(--primary);
  font-weight: 700;
}

.empty-games {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 36px 18px;
  border: 1px dashed rgba(0, 168, 255, 0.38);
  border-radius: 8px;
  background: rgba(20, 20, 28, 0.72);
  color: var(--text-dim);
  text-align: center;
}

.empty-games strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
}

.empty-games button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .nextgen-header {
    min-height: 64px;
  }

  .brand-logo {
    width: 132px;
    height: 40px;
  }

  .brand-logo-fallback {
    font-size: 10px;
  }

  .brand-logo-fallback b {
    font-size: 21px;
  }

  .storage-main::before,
  .category-middle::before,
  .specs-box::before {
    left: 12px;
    right: 12px;
  }

  .catalog-status {
    margin-top: 14px;
  }
  
  .main-content {
    padding-top: 0;
  }
}


/* GamePicker welcome: compact, readable four-step onboarding on every phone. */
.welcome-modal{padding:clamp(10px,3vw,24px);padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(10px,env(safe-area-inset-bottom));}
.modal-content.welcome-content{width:min(100%,480px);max-width:480px;max-height:min(92dvh,820px);max-height:min(92svh,820px);overflow-y:auto;overscroll-behavior:contain;padding:clamp(16px,4vw,26px);}
.welcome-header h1{font-size:clamp(19px,5vw,27px);line-height:1.18;}
.welcome-header h2{font-size:clamp(12px,3.2vw,15px);margin-bottom:10px;}
.welcome-subtitle{font-size:clamp(12px,3vw,14px);line-height:1.55;}
.welcome-steps{grid-template-columns:minmax(0,1fr);gap:8px;margin-top:14px;}
.welcome-step{display:flex;align-items:center;gap:12px;text-align:left;padding:12px;border-radius:13px;}
.welcome-step:hover{transform:none;}
.welcome-step .step-icon{flex:0 0 38px;width:38px;height:38px;align-items:center;justify-content:center;border-radius:11px;background:rgba(0,168,255,.11);margin:0;}
.welcome-step p{font-size:12px;line-height:1.45;margin:0;}
.welcome-step p strong{display:inline-block;margin-bottom:2px;color:#fff;font-size:13px;}
.welcome-privacy-note{font-size:11px;line-height:1.45;margin:12px 0 0;}
.welcome-button-container{position:sticky;bottom:calc(-1 * clamp(16px,4vw,26px));padding:12px 0 2px;background:linear-gradient(180deg,rgba(12,18,30,0),var(--bg-card) 26%);}
.welcome-btn{width:100%;min-height:50px;border-radius:13px;font-size:14px;}
.welcome-tour-link{min-height:40px;}
@media(max-width:360px){
  .modal-content.welcome-content{padding:14px 12px;border-radius:15px;}
  .welcome-logo-image{width:62px;height:62px;}
  .welcome-step{gap:9px;padding:10px;}
  .welcome-step .step-icon{flex-basis:34px;width:34px;height:34px;}
  .welcome-step p{font-size:11px;}
  .welcome-step p strong{font-size:12px;}
}


