* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #0d0f18;
  color: #f1f5f9;
  min-height: 100vh;
  padding-bottom: 84px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #151824;
  border-bottom: 1px solid #232738;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ff5e9a;
}

.nav-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Status Tiket */
.ticket-status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #1f2438, #181c2b);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #2b324d;
}

.ticket-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: #38bdf8;
}

.gacha-sub-bar {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 4px;
}

.btn-info-link {
  background: none;
  border: none;
  color: #f59e0b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

/* Pity Meter */
.pity-container {
  background: #171a29;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #232738;
}

.pity-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.pity-bar {
  width: 100%;
  height: 8px;
  background: #252b42;
  border-radius: 8px;
  overflow: hidden;
}

.pity-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ec4899);
  transition: width 0.4s ease;
}

/* =========================================
   KARTU 3D & POSISI FLIP
   ========================================= */
.card-stage {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 26px auto;
  width: 230px;
  height: 335px;
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 16px;
  box-shadow: 0 14px 35px rgba(0,0,0,0.6);
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.tarot-back {
  background: radial-gradient(circle at center, #1b2038 0%, #0c0f1c 100%);
  border: 2px solid #f59e0b;
}

.sleeve-border {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.015),
    rgba(255, 255, 255, 0.015) 10px,
    transparent 10px,
    transparent 20px
  );
}

.sleeve-inner-pattern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.magic-circle {
  font-size: 3.2rem;
  color: #f59e0b;
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
  animation: pulseGlow 2.5s infinite ease-in-out;
}

.sleeve-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #f8fafc;
  margin-top: 10px;
}

.sleeve-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #38bdf8;
  margin-top: 4px;
}

.shimmer-sweep {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 40%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 60%
  );
  transform: rotate(25deg);
  animation: sweep 4s infinite linear;
}

@keyframes sweep {
  0% { transform: translateY(-80%) rotate(25deg); }
  100% { transform: translateY(80%) rotate(25deg); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; text-shadow: 0 0 24px rgba(245, 158, 11, 1); }
}

.card-back {
  background: #151824;
  transform: rotateY(180deg);
  border: 2px solid #3b82f6;
}

.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-info-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(13, 15, 24, 0.95));
  padding: 12px;
}

.rarity-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  z-index: 2;
}

.rarity-badge.SSR { background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 0 10px #f59e0b; }
.rarity-badge.SR { background: #8b5cf6; }
.rarity-badge.R { background: #3b82f6; }

/* Buttons */
.btn-primary, .btn-gacha, .btn-secondary, .btn-danger, .btn-download {
  border: none;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary { width: 100%; padding: 12px; background: #4f46e5; color: white; }
.btn-gacha { width: 100%; padding: 16px; background: linear-gradient(90deg, #ec4899, #8b5cf6); color: white; font-size: 1.1rem; }
.btn-secondary { padding: 8px 14px; background: #2563eb; color: white; width: auto; }
.btn-danger { width: 100%; padding: 12px; background: #ef4444; color: white; margin-top: 16px; }
.btn-download { width: 100%; padding: 13px; background: #10b981; color: white; font-size: 0.95rem; margin-top: 14px; }
.btn-download:hover { background: #059669; }
.btn-gacha:disabled { opacity: 0.5; cursor: not-allowed; }

/* Album Koleksi */
.album-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

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

.count-pill {
  background: #1e2438;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  border: 1px solid #334155;
}

.filter-group {
  display: flex;
  gap: 6px;
}

.btn-filter {
  flex: 1;
  padding: 8px 4px;
  background: #1a1e30;
  border: 1px solid #2b324d;
  color: #94a3b8;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-filter.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
}

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

.album-status-text {
  font-size: 0.75rem;
  color: #94a3b8;
}

.select-sort {
  padding: 6px 10px;
  background: #171a29;
  border: 1px solid #2b324d;
  color: #f1f5f9;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
}

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

.album-card-item {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 10px;
  overflow: hidden;
  background: #1e2438;
  border: 1px solid #334155;
  cursor: pointer;
}

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

/* Profil */
.profile-card {
  text-align: center;
  padding: 16px;
  background: #171a29;
  border-radius: 14px;
}

.profile-avatar { font-size: 2.5rem; margin-bottom: 6px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.stat-card {
  background: #1a1e30;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}

.stat-card span { display: block; font-size: 1.3rem; font-weight: 700; color: #38bdf8; }

.shard-exchange-box, .notif-toggle-box {
  background: #171a29;
  padding: 14px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.badge-notif-active {
  background: #064e3b;
  color: #34d399;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Navigasi Bawah */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #151824;
  display: flex;
  border-top: 1px solid #232738;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  color: #94a3b8;
  font-weight: 600;
  cursor: pointer;
}

.nav-item.active { color: #ff5e9a; }

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 16px;
}

.modal.hidden { display: none; }
.modal-box {
  background: #161b2e;
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid #2b3553;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* =========================================
   DESAIN MODAL LOGIN RAPI & MODERN
   ========================================= */
.auth-box {
  max-width: 360px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo-wrapper {
  display: inline-flex;
  padding: 8px;
  background: rgba(255, 94, 154, 0.1);
  border: 1px solid rgba(255, 94, 154, 0.3);
  border-radius: 16px;
  margin-bottom: 10px;
  box-shadow: 0 0 16px rgba(255, 94, 154, 0.2);
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.auth-brand h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.auth-brand p {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.35;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  text-align: left;
}

.input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  background: #0d111d;
  border: 1px solid #242c44;
  border-radius: 10px;
  color: #f1f5f9;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.35);
}

#authPin {
  letter-spacing: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.auth-hint {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.73rem;
  color: #94a3b8;
  margin-bottom: 16px;
  text-align: left;
}

.btn-auth {
  padding: 13px;
  font-size: 1rem;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.btn-auth:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
}

/* Modal Detail & Rules */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #94a3b8;
  cursor: pointer;
}

.card-detail-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  max-height: 52vh;
  background: #0d0f18;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
}

.card-detail-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-detail-meta {
  text-align: center;
  margin-top: 12px;
}

.card-detail-meta h3 {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.card-detail-meta p {
  color: #38bdf8;
  font-size: 0.88rem;
}

.artist-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

.rules-box {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.rules-body {
  overflow-y: auto;
  padding-right: 4px;
}

.rate-badge-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.rate-badge-item {
  padding: 8px 6px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
}

.rate-badge-item.ssr { background: rgba(245, 158, 11, 0.15); border-color: #f59e0b; color: #fbbf24; }
.rate-badge-item.sr { background: rgba(139, 92, 246, 0.15); border-color: #8b5cf6; color: #c4b5fd; }
.rate-badge-item.r { background: rgba(59, 130, 246, 0.15); border-color: #3b82f6; color: #93c5fd; }

.badge-title { font-weight: 800; font-size: 0.95rem; display: block; }
.badge-rate { font-weight: 700; font-size: 1.1rem; }
.rate-badge-item small { display: block; font-size: 0.65rem; }

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.rule-item {
  display: flex;
  gap: 10px;
  background: #111422;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.rule-icon { font-size: 1.2rem; }
.rule-item strong { display: block; color: #f1f5f9; margin-bottom: 2px; }
.rule-item p { color: #94a3b8; line-height: 1.3; }

.featured-pool-section h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.pool-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 10px;
}

.ssr-pool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ssr-pool-thumb {
  aspect-ratio: 2/3;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #f59e0b;
}

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

.error-msg { color: #ef4444; font-size: 0.85rem; margin-top: 8px; text-align: center; }
