/* ========== SPLASH SCREEN ========== */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0b1020, #1a0b2e);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.splash-logo {
  width: 120px;        /* ปรับตามขนาด logo คุณ */
  height: auto;
  display: block;
}

/* ========== AUTH PAGES (login, signup, profile-setup) ========== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.auth-card {
  background: var(--card);
  border-radius: 32px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--muted);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--muted);
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 18px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  margin-left: 8px;
  font-weight: 600;
}
/* ========== PROFILE SETUP ========== */
.setup-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.setup-card {
  background: var(--card);
  border-radius: 32px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
}

.setup-header {
  text-align: center;
  margin-bottom: 28px;
}

.setup-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.setup-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.setup-avatar-section {
  margin-bottom: 20px;
}

.setup-avatar-section label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--muted);
}

.avatar-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-option {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
}

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

.avatar-option.selected {
  border-color: var(--primary);
}

.upload-option svg {
  width: 28px;
  height: 28px;
  stroke: white;
}

select {
  width: 100%;
  padding: 14px 16px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 18px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--primary);
}

input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 18px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
}
/* ========== MAIN APP (INDEX) ========== */
:root {
  --bg: #0b1020;
  --card: #161d33;
  --card2: #1d2644;
  --primary: #7c3aed;
  --secondary: #ec4899;
  --text: #ffffff;
  --muted: #94a3b8;
  --border: rgba(255,255,255,0.06);
}

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

body {
  background: var(--bg);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}

.app {
  max-width: 420px;
  margin: auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ========== SPLASH ========== */
.splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0b1020, #1a0b2e);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
  gap: 16px;
}

.splash-logo {
  width: 80px;
  height: 80px;
}

.splash h1 {
  font-size: 28px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========== AUTH PAGES ========== */
.auth-container, .profile-setup {
  padding: 40px 24px;
  min-height: 100vh;
  background: var(--bg);
}

.auth-card {
  background: var(--card);
  border-radius: 28px;
  padding: 32px 24px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--muted);
}

.input-group input, .input-group select {
  width: 100%;
  padding: 14px 16px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 18px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
}

.input-group input:focus, .input-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

/* Avatar Selector */
.avatar-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.avatar-option {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
}

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

.avatar-option svg {
  width: 34px;
  height: 34px;
}

.avatar-option.selected {
  border-color: var(--primary);
  background: rgba(124,58,237,0.2);
}

/* ========== MAIN APP ========== */
.main-app {
  display: none;
  min-height: 100vh;
  padding-bottom: 72px;
}

/* STICKY TOP (เฉพาะ Header + Category เท่านั้น) */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

/* Header */
.header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.header-actions {
  display: flex;
  gap: 12px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: white;
  stroke-width: 1.8;
  fill: none;
}

/* Category Scroll */
.category {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 0 16px 12px;
  scrollbar-width: none;
}

.category::-webkit-scrollbar {
  display: none;
}

.cat {
  padding: 8px 18px;
  background: var(--card);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.cat.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Banner (ไม่ตรึง เลื่อนตามได้) */
.banner {
  margin: 0 16px 20px;
  height: 120px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  position: relative;
}

.banner-slider-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
}

.banner-slide.active {
  opacity: 1;
  visibility: visible;
}

.banner-content {
  padding: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.banner-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.banner-sub {
  font-size: 12px;
  opacity: 0.9;
}

.banner-svg {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 110px;
  height: 110px;
  opacity: 0.2;
}

.banner-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.banner-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}

.banner-dot.active {
  width: 20px;
  border-radius: 4px;
  background: white;
}

/* Grid วีเจ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}

.cover {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #2b3560, #141a2c);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ef4444;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
}

.live-dot {
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

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

.viewer-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  height: 22px;
  padding: 0 8px;
  background: rgba(0,0,0,0.6);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.viewer-count svg {
  width: 10px;
  height: 10px;
}

.info {
  padding: 8px;
}

.name {
  font-weight: 700;
  font-size: 12px;
}

.desc {
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Navigation (ตรึง) */
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 420px;
  margin: auto;
  height: 72px;
  background: rgba(15,21,41,0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border);
  z-index: 100;
}

.nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
}

.nav.active {
  color: var(--primary);
}

.nav svg {
  width: 20px;
  height: 20px;
}

.live-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-10px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.4);
  cursor: pointer;
}

/* Placeholder Pages */
.placeholder-page {
  padding: 80px 24px;
  text-align: center;
  color: var(--muted);
}

.profile-page {
  padding: 40px 24px;
  text-align: center;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  overflow: hidden;
}

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

.uid-box {
  background: var(--card);
  padding: 14px;
  border-radius: 18px;
  margin: 20px 0;
  font-size: 12px;
  word-break: break-all;
}

a {
  text-decoration: none;
  color: var(--primary);
}
:root {
  --bg: #0b1020;
  --card: #161d33;
  --card2: #1d2644;
  --primary: #7c3aed;
  --secondary: #ec4899;
  --text: #ffffff;
  --muted: #94a3b8;
  --border: rgba(255,255,255,0.06);
}

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

body {
  background: var(--bg);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
}

/* ========== PROFILE PAGE ========== */
.profile-container {
  max-width: 420px;
  margin: auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 80px;
}

.header-bg {
  background: linear-gradient(135deg, #3b1c5c, #1d1b3c, #0f121d);
  padding: 20px;
  text-align: center;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.back-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.back-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.avatar-area {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
}

.username {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.user-id {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  padding: 4px 12px;
  border-radius: 40px;
  cursor: pointer;
}

.copy-icon {
  width: 14px;
  height: 14px;
}

.stats-row {
  display: flex;
  justify-content: space-around;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

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

.stat-num {
  font-size: 20px;
  font-weight: 700;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.banner-row {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.banner-btn {
  flex: 1;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.banner-deposit {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.banner-vj {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.banner-icon {
  width: 24px;
  height: 24px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
}

.grid-item {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.grid-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 6px;
  display: block;
}

.grid-label {
  font-size: 11px;
  color: var(--muted);
}

.badge-new {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ef4444;
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 10px;
  color: white;
}

.logout-btn {
  margin: 20px 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 14px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: calc(100% - 32px);
}

@keyframes pulseViewer {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); background: rgba(124,58,237,0.3); }
  100% { opacity: 1; transform: scale(1); }
}
/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 420px;
  margin: auto;
  height: 70px;
  background: rgba(15,21,41,0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.live-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-10px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.4);
  cursor: pointer;
}

.loading {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}

.banner {
  margin: 0 16px 20px;
  height: 120px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background: transparent; /* ไม่มีพื้นหลัง */
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* หรือ cover แล้วแต่รูป */
}

.splash-logo {
  width: 200px;      /* กำหนดขนาดตายตัว */
  height: auto;
}

/* หรือ */
.splash-logo {
  width: 40vw;       /* 40% ของความกว้างหน้าจอ */
  height: auto;
}
/* ========== SPLASH SCREEN ========== */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0b1020, #1a0b2e);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden;
}

/* โลโก้หลัก */
.splash-logo-main {
  width: 200px;
  height: auto;
  z-index: 10;
  animation: fadeInUp 0.8s ease-out;
}

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

/* ไอคอนลอย */
.floating-icons {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.float-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  opacity: 0;
  animation: floatUp 3s ease-in-out infinite;
}

.icon1 { bottom: -20px; left: 10%; animation-delay: 0s; }
.icon2 { bottom: -30px; left: 25%; animation-delay: 0.5s; width: 50px; height: 50px; }
.icon3 { bottom: -15px; left: 45%; animation-delay: 1s; }
.icon4 { bottom: -40px; left: 65%; animation-delay: 0.3s; width: 35px; height: 35px; }
.icon5 { bottom: -25px; left: 80%; animation-delay: 0.8s; }
.icon6 { bottom: -10px; left: 90%; animation-delay: 1.2s; width: 45px; height: 45px; }

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(1.2);
  }
}
/* ========== RESET & FULLSCREEN ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ลบ scroll bar ด้านข้าง */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

/* ลบ highlight ตอนกดบนมือถือ */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ทำให้เต็มจอ ไม่มีขอบขาว */
body {
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

/* รองรับ safe area (notch) */
.app, .profile-container, .live-container, .auth-container {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ลบ outline ตอนกด */
button:focus, 
button:active {
  outline: none;
}

/* ลบ scrollbar แต่ยังเลื่อนได้ */
body::-webkit-scrollbar {
  display: none;
}

/* รองรับทุกหน้าจอ ให้ max-width 100% */
img, svg {
  max-width: 100%;
  height: auto;
}
/* ✅ ซ่อน scrollbar ทุก element ทั้งหมด */
* {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}

*::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari/Opera */
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}