/* =========================================================
   VI Launcher — Mobile-First Neon Pink / Purple / Black Theme
   ========================================================= */

:root {
  --bg-black: #07060b;
  --bg-surface: rgba(17, 13, 29, 0.78);
  --bg-surface-strong: rgba(22, 16, 38, 0.92);
  --neon-pink: #ff2a85;
  --neon-pink-soft: #ff66a8;
  --neon-purple: #8b2fc9;
  --neon-purple-bright: #a855f7;
  --text-primary: #ffffff;
  --text-secondary: #c4bdd6;
  --text-muted: #8a80a3;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-pink: rgba(255, 42, 133, 0.42);
  --border-purple: rgba(168, 85, 247, 0.38);
  --shadow-glow: 0 12px 36px rgba(255, 42, 133, 0.24), 0 4px 20px rgba(139, 47, 201, 0.25);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background-color: var(--bg-black);
  color: var(--text-primary);
  font-family: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* =========================================================
   Full-Viewport Background Slot
   ========================================================= */
.bg-slot {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 18%, #210d35 0%, #0d0817 48%, #07060b 100%);
}

.bg-slot__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.72;
}

.bg-slot__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 42, 133, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 85%);
}

.bg-slot__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.bg-slot__glow--pink {
  width: 280px;
  height: 280px;
  top: -60px;
  right: -60px;
  background: rgba(255, 42, 133, 0.28);
}

.bg-slot__glow--purple {
  width: 320px;
  height: 320px;
  bottom: 60px;
  left: -90px;
  background: rgba(139, 47, 201, 0.28);
}

.bg-slot__vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(7, 6, 11, 0.35) 0%,
    rgba(7, 6, 11, 0.55) 55%,
    rgba(7, 6, 11, 0.94) 100%
  );
}

.slot-tag {
  position: absolute;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.36);
  background: rgba(7, 6, 11, 0.55);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
}

.slot-tag--bg {
  bottom: calc(82px + var(--safe-bottom));
  right: 14px;
}

/* =========================================================
   App Container & Topbar
   ========================================================= */
.launcher-app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 18px calc(96px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.launcher-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(18, 13, 31, 0.8);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.status-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink);
}

.tester-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 47, 201, 0.2);
  border: 1px solid var(--border-purple);
  color: #f3e8ff;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease;
}

.tester-trigger:hover,
.tester-trigger:active {
  background: rgba(255, 42, 133, 0.26);
  border-color: var(--border-pink);
  transform: translateY(-1px);
}

/* =========================================================
   Hero & Logo Placeholder Slot
   ========================================================= */
.launcher-main {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin: auto 0;
}

.hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.logo-slot {
  width: 100%;
  max-width: 340px;
  min-height: 146px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(25, 16, 42, 0.72), rgba(11, 9, 19, 0.84));
  border: 1.5px dashed rgba(255, 42, 133, 0.5);
  box-shadow: inset 0 0 28px rgba(139, 47, 201, 0.18), 0 14px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.logo-slot.has-asset {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  box-shadow: none;
  padding: 8px;
}

.logo-slot:active {
  transform: scale(0.985);
}

.logo-slot__image {
  max-width: 100%;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(255, 42, 133, 0.32));
}

.logo-slot__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.logo-slot__eyebrow {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--neon-pink-soft);
}

.logo-slot__title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 15%, #ff66a8 60%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-slot__hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.hero-subtitle {
  margin: 0;
  max-width: 310px;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Primary Launch Button */
.btn-launch {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 52px;
  border: none;
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}

.btn-launch__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--neon-pink) 0%, #c026d3 52%, var(--neon-purple) 100%);
}

.btn-launch__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.btn-launch:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(255, 42, 133, 0.38);
}

.btn-launch:active {
  transform: scale(0.98);
}

/* =========================================================
   Feature Modules Grid
   ========================================================= */
.modules-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.section-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--neon-pink-soft);
  background: rgba(255, 42, 133, 0.14);
  border: 1px solid rgba(255, 42, 133, 0.3);
  padding: 3px 9px;
  border-radius: 999px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}

.module-card:hover,
.module-card:active {
  transform: translateY(-2px);
  background: rgba(28, 20, 46, 0.9);
  border-color: var(--border-pink);
}

.module-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.module-card__icon--pink {
  background: rgba(255, 42, 133, 0.16);
  color: var(--neon-pink-soft);
  border: 1px solid rgba(255, 42, 133, 0.32);
}

.module-card__icon--purple {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.32);
}

.module-card__body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.module-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.module-card__name {
  font-size: 0.98rem;
  font-weight: 600;
}

.module-card__tag {
  font-size: 0.64rem;
  font-weight: 500;
  color: #d8b4fe;
  background: rgba(139, 47, 201, 0.28);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.module-card__desc {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* =========================================================
   Bottom Mobile Dock
   ========================================================= */
.mobile-dock {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 20;
  width: calc(100% - 28px);
  max-width: 484px;
  padding: 7px;
  border-radius: 20px;
  background: rgba(14, 10, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.dock-item {
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.dock-item.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.26), rgba(139, 47, 201, 0.3));
  box-shadow: inset 0 0 0 1px rgba(255, 42, 133, 0.36);
}

.dock-item:not(.is-active):hover {
  color: var(--text-secondary);
}

/* =========================================================
   Toast Notification
   ========================================================= */
.launcher-toast {
  position: fixed;
  top: calc(62px + var(--safe-top));
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 40;
  width: calc(100% - 36px);
  max-width: 440px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-pink);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.launcher-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.launcher-toast__badge {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--neon-pink-soft);
  margin-bottom: 3px;
}

.launcher-toast__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.launcher-toast__desc {
  margin: 3px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* =========================================================
   Asset Tester Modal
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 3, 8, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 540px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-panel {
  width: 100%;
  max-width: 440px;
  border-radius: 22px;
  background: #120d20;
  border: 1px solid var(--border-purple);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-panel__eyebrow {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--neon-pink-soft);
}

.modal-panel__title {
  margin: 2px 0 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-panel__note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.upload-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(168, 85, 247, 0.45);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-box:hover {
  border-color: var(--neon-pink);
  background: rgba(255, 42, 133, 0.08);
}

.upload-box__label {
  font-size: 0.84rem;
  font-weight: 500;
  color: #ffffff;
}

.upload-box__file {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.modal-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.btn-secondary,
.btn-primary-sm {
  border-radius: 12px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-primary-sm {
  border: none;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  color: #ffffff;
  font-weight: 600;
}
