:root {
  --bg: #0b0f14;
  --bg-elevated: #151b24;
  --bg-card: #1a222e;
  --bg-nav: rgba(18, 24, 33, 0.92);
  --text: #f3f6fb;
  --text-muted: #8b97a8;
  --accent: #3db4ff;
  --accent-soft: #5bc2ff;
  --accent-deep: #1a8fd9;
  --success: #2ecc71;
  --success-bg: rgba(46, 204, 113, 0.14);
  --border: rgba(255, 255, 255, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(61, 180, 255, 0.12), transparent 55%),
    var(--bg);
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: 16px 16px calc(110px + var(--safe-bottom));
  position: relative;
}

/* Header */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  animation: fadeUp 0.45s ease both;
}

.brand {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 2px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.btn-ambil {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #041018;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(61, 180, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-ambil:active {
  transform: scale(0.96);
}

/* Promo */
.promo {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #1a7fd4 0%, #2aa3f5 45%, #0d6cb5 100%);
  min-height: 128px;
  box-shadow: 0 10px 28px rgba(26, 127, 212, 0.35);
  animation: fadeUp 0.5s ease 0.05s both;
}

.promo-glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 65%);
  pointer-events: none;
}

.promo-content {
  position: relative;
  z-index: 1;
  max-width: 62%;
}

.promo-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.95;
  margin-bottom: 6px;
}

.promo-logo {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

.promo-headline {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.promo-cta {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: #0a5a9c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.promo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.9;
}

.promo-art {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 110px;
  height: 110px;
  pointer-events: none;
}

.star {
  position: absolute;
  color: #ffe566;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  animation: float 3s ease-in-out infinite;
}

.star.s1 { font-size: 42px; right: 18px; top: 8px; }
.star.s2 { font-size: 26px; right: 58px; top: 48px; animation-delay: 0.6s; }

.plane {
  position: absolute;
  right: 8px;
  bottom: 10px;
  font-size: 36px;
  transform: rotate(-18deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: float 2.6s ease-in-out 0.3s infinite;
}

/* Stats */
.stats-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  animation: fadeUp 0.55s ease 0.1s both;
}

.stats-main {
  flex: 1;
  min-width: 0;
}

.stats-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stats-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.stats-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stats-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-sub strong {
  color: var(--text);
  font-weight: 700;
}

.stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
}

.stats-action {
  width: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent-deep));
  color: #041018;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(61, 180, 255, 0.28);
  transition: transform 0.15s ease;
}

.stats-action:active {
  transform: scale(0.95);
}

/* Pages / list */
.pages {
  position: relative;
}

.page {
  display: none;
  animation: fadeUp 0.35s ease both;
}

.page.active {
  display: block;
}

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

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: background 0.15s ease;
}

.user-item:active {
  background: #1c2430;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #041018;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent-deep));
  flex-shrink: 0;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-handle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--success-bg);
  color: var(--success);
}

.btn-eye {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.btn-eye:active {
  color: var(--accent);
}

/* Empty / terms */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--accent);
}

.empty h2 {
  color: var(--text);
  font-size: 20px;
  margin-bottom: 8px;
}

.empty p {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #041018;
  font-weight: 700;
  font-size: 14px;
}

.terms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.term-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.term-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.term-icon-gold {
  color: #e8b84a;
  background: rgba(232, 184, 74, 0.14);
}

.term-icon-blue {
  color: var(--accent-soft);
  background: rgba(61, 180, 255, 0.14);
}

.term-icon-green {
  color: var(--success);
  background: var(--success-bg);
}

.term-icon-muted {
  color: #9aa6b5;
  background: rgba(154, 166, 181, 0.12);
}

.term-body h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.term-body p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.term-body strong {
  color: var(--text);
  font-weight: 700;
}

.terms-foot {
  margin-top: 16px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.32);
}

body.page-ketentuan .btn-ambil {
  visibility: hidden;
  pointer-events: none;
}

/* Bottom nav */
.select-bar {
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(18, 24, 33, 0.96);
  border: 1px solid rgba(61, 180, 255, 0.35);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.select-bar.hidden {
  display: none;
}

.select-bar-count {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.select-bar-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #041018;
  font-size: 13px;
  font-weight: 800;
}

.select-bar-clear {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  border-radius: 22px;
  background: var(--bg-nav);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 16px;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-item.active {
  color: var(--accent);
  background: rgba(61, 180, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(61, 180, 255, 0.35);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.plane {
  animation-name: floatPlane;
}

@keyframes floatPlane {
  0%, 100% { transform: rotate(-18deg) translateY(0); }
  50% { transform: rotate(-18deg) translateY(-6px); }
}

/* Skeleton */
.skeleton {
  height: 66px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #151b24 25%, #1c2430 50%, #151b24 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Hide usernames chrome on other pages */
body.page-accounts #usernamesChrome,
body.page-ketentuan #usernamesChrome {
  display: none;
}

/* Accounts tip */
.tip-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(61, 180, 255, 0.12), rgba(26, 34, 46, 0.95));
  border: 1px solid rgba(61, 180, 255, 0.2);
  margin-bottom: 14px;
}

.tip-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(61, 180, 255, 0.18);
  color: var(--accent);
}

.tip-body h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.tip-body strong {
  color: var(--text);
  font-weight: 700;
}

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

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.account-card.is-selected {
  border-color: rgba(61, 180, 255, 0.45);
  background: rgba(61, 180, 255, 0.06);
}

.account-flag {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.account-flag:active {
  transform: scale(0.94);
}

.account-flag .flag-emoji {
  font-size: 26px;
  line-height: 1;
}

.account-flag .flag-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(61, 180, 255, 0.88);
  color: #041018;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.account-flag.is-checked {
  border-color: var(--accent);
}

.account-flag.is-checked .flag-check {
  opacity: 1;
}

.account-flag.is-checked .flag-emoji {
  opacity: 0.25;
}

.account-meta {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.account-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 8px;
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-blue {
  background: rgba(61, 180, 255, 0.16);
  color: var(--accent-soft);
}

.badge-green {
  background: var(--success-bg);
  color: var(--success);
}

.badge-action {
  cursor: pointer;
  border: 1px dashed rgba(61, 180, 255, 0.45);
}

.badge-action:active {
  transform: scale(0.97);
  background: rgba(61, 180, 255, 0.28);
}

.btn-ping {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.btn-ping:active {
  color: var(--accent);
  border-color: rgba(61, 180, 255, 0.35);
}

.empty-accounts {
  padding: 28px 16px;
}

.empty-accounts p {
  margin: 0;
}

.empty-accounts .empty-hint {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.empty-accounts strong {
  color: var(--accent-soft);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background: #141b25;
  border: 1px solid var(--border);
  border-bottom: none;
  animation: fadeUp 0.25s ease both;
}

.modal-sheet h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

.modal-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-align: left;
}

.modal-option strong {
  font-size: 14px;
}

.modal-option span {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-option:active {
  border-color: rgba(61, 180, 255, 0.4);
}

.modal-cancel {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.field input:focus {
  border-color: rgba(61, 180, 255, 0.5);
}

.btn-block {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 4px;
}
