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

:root {
  --bg: #0d0820;
  --bg2: #130f2a;
  --card: #1a1535;
  --purple: #7c3aed;
  --purple-light: #a855f7;
  --gold: #f59e0b;
  --pink: #ec4899;
  --text: #e9d5ff;
  --dim: #9ca3af;
  --border: rgba(124,58,237,0.3);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Sarabun', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(13,8,32,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.coin-badge {
  background: linear-gradient(135deg, #78350f, var(--gold));
  color: #1a0a00;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
}
.user-btn { cursor: pointer; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid var(--border);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero {
  text-align: center;
  padding: 40px 20px 28px;
  background: radial-gradient(ellipse at top, rgba(124,58,237,0.15), transparent 70%);
}
.hero-badge {
  display: inline-block;
  background: rgba(124,58,237,0.2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--purple-light);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
  color: white;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--dim); font-size: 14px; line-height: 1.6; }

.main { padding: 0 16px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}
.free-tag {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: #34d399;
}
.coin-tag {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--gold);
}
.premium-tag {
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.3);
  color: var(--purple-light);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card:hover {
  background: #221c42;
  border-color: var(--purple-light);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(124,58,237,0.25);
}
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
}
.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.card-desc {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
  flex: 1;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(124,58,237,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
  font-size: 13px;
}
.card:hover .arrow { background: var(--purple); color: white; }

.premium-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(236,72,153,0.15));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 20px;
  padding: 18px;
  margin-top: 24px;
  cursor: pointer;
  transition: all 0.3s;
}
.premium-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,0.3);
}
.premium-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.premium-text { flex: 1; }
.premium-text h3 { font-size: 15px; font-weight: 700; color: white; margin-bottom: 4px; }
.premium-text p { font-size: 12px; color: var(--dim); }
.premium-price { text-align: center; flex-shrink: 0; }
.price {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.unit { font-size: 11px; color: var(--dim); }

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(13,8,32,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 10px 0 20px;
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  color: var(--dim);
  transition: color 0.2s;
}
.nav-item span:first-child { font-size: 22px; }
.nav-item.active { color: var(--purple-light); }

.user-menu {
  position: fixed;
  top: 70px;
  right: 16px;
  width: 280px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  z-index: 999;
  display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.user-menu.open { display: block; }
.menu-title { font-size: 15px; font-weight: 700; color: white; margin-bottom: 4px; }
.menu-sub { font-size: 12px; color: var(--dim); margin-bottom: 16px; line-height: 1.5; }
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  color: #333;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Sarabun', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.menu-user-info { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-name { font-size: 15px; font-weight: 700; color: white; }
.menu-email { font-size: 12px; color: var(--dim); }
.menu-badge {
  background: rgba(124,58,237,0.15);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--purple-light);
  margin-bottom: 12px;
  text-align: center;
}
.menu-badge.premium {
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(236,72,153,0.2));
  border-color: rgba(245,158,11,0.3);
  color: var(--gold);
}
.menu-divider { height: 1px; background: var(--border); margin: 12px 0; }
.menu-item {
  padding: 10px 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
}
.menu-item:hover { background: rgba(255,255,255,0.05); }
.menu-item.danger { color: #f87171; }
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 998;
}
.overlay.open { display: block; }
.cursor {
  display: inline-block; width: 2px; height: 16px;
  background: var(--purple-light); margin-left: 2px;
  animation: blink 0.8s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%, 100% { opacity: 1; } 50% { opacity: 0; }
}
.btn-speak {
  width: 100%; background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3); border-radius: 14px;
  padding: 12px; color: var(--purple-light);
  font-size: 14px; font-weight: 700;
  font-family: 'Sarabun', sans-serif; cursor: pointer;
  transition: all 0.2s; margin-top: 12px;
}
.btn-speak:hover { background: rgba(124,58,237,0.25); }
.followup-box {
  margin-top: 16px; padding: 16px;
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 16px;
}
.followup-title {
  font-size: 13px; color: var(--gold);
  font-weight: 700; margin-bottom: 10px;
}
.followup-input {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; color: white; font-size: 14px;
  font-family: 'Sarabun', sans-serif; outline: none;
  resize: none; margin-bottom: 10px;
}
.followup-input:focus { border-color: var(--purple-light); }
.followup-input::placeholder { color: rgba(255,255,255,0.25); }
.followup-btn {
  width: 100%; background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: 12px; padding: 12px; color: var(--purple-light);
  font-size: 14px; font-weight: 700;
  font-family: 'Sarabun', sans-serif; cursor: pointer;
  transition: all 0.2s; margin-bottom: 12px;
}
.followup-btn:hover { background: rgba(124,58,237,0.3); }
.followup-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.followup-result {
  font-size: 14px; line-height: 1.9; color: var(--text);
  white-space: pre-wrap; margin-top: 8px;
}
.followup-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 12px 0;
}