@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* =============================================
   TONTON — Neobrutalism UI
   ============================================= */
:root {
  --ink:     #1A1A1A;
  --bg:      #FFFDF5;
  --white:   #FFFFFF;

  /* Pastel palette */
  --yellow:  #FFE566;
  --mint:    #A8F0DC;
  --lavender:#C4B5FD;
  --salmon:  #FCA5A5;
  --sky:     #BAE6FD;
  --lime:    #BBF7D0;
  --peach:   #FED7AA;
  --orange:  #FF6B35;

  /* Functional */
  --brand:   #FF6B35;
  --green:   #22C55E;
  --red:     #EF4444;
  --blue:    #3B82F6;

  /* Shadows & borders */
  --border:  2.5px solid var(--ink);
  --shadow:  4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);

  --radius:  14px;
  --radius-sm: 10px;
  --max-w:   480px;
  --nav-h:   64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── App Shell ─────────────────────────── */
.app-shell {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Topbar ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: var(--border);
  padding: 0 20px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar__logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 900; font-size: 19px; color: var(--ink);
  text-decoration: none;
}
.topbar__logo strong { color: var(--brand); }
.topbar__right { display: flex; align-items: center; gap: 8px; }
.topbar__balance {
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 12px; font-weight: 800;
  padding: 5px 10px; border-radius: 8px;
}
.topbar__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px;
  text-decoration: none;
}

/* ── Page content ──────────────────────── */
.page-content {
  flex: 1;
  padding: 20px 16px;
  padding-bottom: calc(var(--nav-h) + 20px);
}

/* ── Bottom Nav ────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-w);
  height: var(--nav-h);
  background: var(--white);
  border-top: var(--border);
  display: flex; z-index: 200;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none;
  color: #999; font-size: 10px; font-weight: 800;
  transition: color .15s;
}
.nav-item.active { color: var(--brand); }
.nav-item.active svg { transform: scale(1.1); }
.nav-item--center { position: relative; top: -10px; }
.nav-item--center .nav-center-btn {
  width: 52px; height: 52px;
  background: var(--brand);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}

/* ── Cards ──────────────────────────────── */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card__header {
  padding: 14px 18px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.card__title { font-weight: 800; font-size: 15px; }
.card__body { padding: 14px 18px; }
.card__link { font-size: 13px; color: var(--brand); text-decoration: none; font-weight: 800; }

/* ── Colored Cards (Neobrutalism) ──────── */
.card--yellow  { background: var(--yellow); }
.card--mint    { background: var(--mint); }
.card--lavender{ background: var(--lavender); }
.card--salmon  { background: var(--salmon); }
.card--sky     { background: var(--sky); }
.card--lime    { background: var(--lime); }
.card--peach   { background: var(--peach); }

/* ── Hero Balance Card ──────────────────── */
.hero-card {
  background: var(--yellow);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 20px;
}
.hero-card__label { font-size: 13px; font-weight: 700; color: #555; margin-bottom: 4px; }
.hero-card__amount { font-size: 32px; font-weight: 900; letter-spacing: -1px; color: var(--ink); }
.hero-card__sub { font-size: 12px; color: #555; margin-top: 2px; }
.hero-card__actions { display: flex; gap: 8px; margin-top: 16px; }
.hero-card__btn {
  flex: 1;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 12px; font-weight: 800;
  text-align: center; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, box-shadow .12s;
}
.hero-card__btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
.hero-card__btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }

/* ── Stat Row ───────────────────────────── */
.stat-row {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px;
}
.stat-mini {
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px 10px; text-align: center;
}
.stat-mini:nth-child(1) { background: var(--mint); }
.stat-mini:nth-child(2) { background: var(--lavender); }
.stat-mini:nth-child(3) { background: var(--peach); }
.stat-mini__val { font-size: 16px; font-weight: 900; color: var(--ink); }
.stat-mini__lbl { font-size: 10px; color: #555; margin-top: 2px; font-weight: 700; }

/* ── Video Card ─────────────────────────── */
.video-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; text-decoration: none; color: inherit; display: block;
  transition: transform .12s, box-shadow .12s;
}
.video-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.video-card:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--ink); }
.video-card__thumb-wrap { position: relative; overflow: hidden; }
.video-card__thumb-wrap img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.video-card__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25);
}
.video-card__play-btn {
  width: 48px; height: 48px;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.video-card__badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink); font-size: 11px; font-weight: 900;
  padding: 3px 8px; border-radius: 6px;
}
.video-card__body { padding: 12px 14px; }
.video-card__title { font-weight: 800; font-size: 14px; line-height: 1.4; margin-bottom: 8px; }
.video-card__meta { display: flex; align-items: center; justify-content: space-between; }
.video-card__reward {
  background: var(--lime);
  border: 1.5px solid var(--ink);
  color: var(--ink); font-size: 12px; font-weight: 800;
  padding: 3px 9px; border-radius: 20px;
  display: flex; align-items: center; gap: 4px;
}
.video-card__duration { font-size: 11px; color: #666; font-weight: 700; }

/* ── Section header ─────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title { font-size: 16px; font-weight: 900; }
.section-link { font-size: 13px; color: var(--brand); text-decoration: none; font-weight: 800; }

/* ── Page title bar ─────────────────────── */
.page-title-bar { margin-bottom: 18px; }
.page-title-bar h1 { font-size: 22px; font-weight: 900; }
.page-title-bar p { font-size: 13px; color: #666; margin-top: 2px; font-weight: 600; }

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px; font-weight: 800; font-family: inherit;
  cursor: pointer;
  text-decoration: none; line-height: 1;
  transition: transform .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.btn--full { width: 100%; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--yellow  { background: var(--yellow); color: var(--ink); }
.btn--green   { background: var(--lime); color: var(--ink); }
.btn--ghost   { background: var(--white); color: var(--ink); }
.btn--danger  { background: var(--salmon); color: var(--ink); }
.btn--sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn--lg { padding: 14px 24px; font-size: 15px; }

/* ── Forms ──────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 5px; }
.form-control {
  width: 100%;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px; font-family: inherit; font-weight: 600;
  color: var(--ink);
  outline: none;
  transition: box-shadow .15s;
  box-shadow: 3px 3px 0 var(--ink);
}
.form-control:focus { box-shadow: 5px 5px 0 var(--ink); }
.form-control::placeholder { color: #aaa; font-weight: 600; }
.form-hint { font-size: 12px; color: #666; margin-top: 4px; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap .form-control { padding-left: 42px; }
.input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #aaa; pointer-events: none; }
.input-wrap .input-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #aaa; padding: 4px; font-size: 16px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231A1A1A' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px;
}

/* ── Alerts ─────────────────────────────── */
.alert {
  padding: 11px 14px;
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 14px;
}
.alert--success { background: var(--lime); }
.alert--error   { background: var(--salmon); }
.alert--info    { background: var(--sky); }
.alert--warn    { background: var(--peach); }

/* ── Badges ─────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  font-size: 11px; font-weight: 800;
}
.badge--success { background: var(--lime); }
.badge--warn    { background: var(--peach); }
.badge--error   { background: var(--salmon); }
.badge--neutral { background: var(--white); }
.badge--brand   { background: var(--yellow); }

/* ── List items ─────────────────────────── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 2px solid var(--ink);
}
.list-item:last-child { border-bottom: none; }
.list-item__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__sub   { font-size: 12px; color: #666; margin-top: 2px; font-weight: 600; }
.list-item__right { text-align: right; flex-shrink: 0; }
.list-item__amount { font-size: 14px; font-weight: 800; }
.list-item__amount--green { color: #16a34a; }
.list-item__amount--red   { color: #dc2626; }
.list-item__date  { font-size: 11px; color: #666; margin-top: 2px; }

/* ── Tabs ───────────────────────────────── */
.tabs-row {
  display: flex; gap: 6px;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 6px; border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.tab-btn {
  flex: 1; text-align: center;
  padding: 8px 6px; font-size: 13px; font-weight: 800;
  border-radius: 7px; cursor: pointer; border: none;
  background: none; color: #aaa; font-family: inherit;
  transition: all .15s; text-decoration: none;
}
.tab-btn.active { background: var(--ink); color: var(--white); box-shadow: 2px 2px 0 #555; }

/* ── Membership Cards ───────────────────── */
.membership-card {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  background: var(--white);
  position: relative;
}
.membership-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.membership-card.active { background: var(--yellow); }
.membership-card__badge {
  position: absolute; top: -10px; right: 14px;
  background: var(--brand); color: #fff;
  border: var(--border); box-shadow: 2px 2px 0 var(--ink);
  font-size: 10px; font-weight: 900; padding: 3px 10px; border-radius: 20px;
}
.membership-card__name  { font-size: 16px; font-weight: 900; margin-bottom: 3px; }
.membership-card__price { font-size: 22px; font-weight: 900; }
.membership-card__price span { font-size: 13px; color: #666; font-weight: 600; }
.membership-card__feature {
  font-size: 13px; color: #444;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px; font-weight: 700;
}
.membership-card__feature::before { content: '✓'; color: var(--green); font-weight: 900; }

/* ── Auth Page ──────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%; max-width: 480px;
  background: var(--white);
  border: var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
}
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo__icon {
  width: 64px; height: 64px;
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 28px;
}
.auth-logo__title { font-size: 24px; font-weight: 900; }
.auth-logo__sub   { font-size: 13px; color: #666; margin-top: 3px; font-weight: 600; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13px; color: #666; font-weight: 700; }
.auth-switch a { color: var(--brand); font-weight: 900; text-decoration: none; }

/* ── Slider CAPTCHA ─────────────────────── */
.slider-captcha { margin-bottom: 14px; }
.slider-captcha-label { font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.slider-track {
  position: relative;
  height: 50px;
  background: #f0f0f0;
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
  user-select: none;
}
.slider-fill {
  position: absolute; top: 0; left: 0;
  height: 100%; width: 0%;
  background: var(--mint);
  transition: background .3s;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.slider-fill.done { background: var(--lime); }
.slider-thumb {
  position: absolute; top: 5px; left: 5px;
  width: 40px; height: 40px;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; font-size: 18px;
  transition: background .3s;
  z-index: 2;
}
.slider-thumb:active { cursor: grabbing; }
.slider-thumb.done { background: var(--lime); cursor: default; }
.slider-hint {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 12px; font-weight: 800; color: #888;
  pointer-events: none; white-space: nowrap; z-index: 1;
}
.slider-hint.done { color: #16a34a; }

/* ── Watch page ─────────────────────────── */
.video-wrapper { position: relative; background: #000; aspect-ratio: 16/9; }
.video-wrapper iframe { width: 100%; height: 100%; border: none; }
.video-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; gap: 10px; z-index: 10;
}
.video-overlay.hidden { display: none; }
.timer-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; color: var(--ink);
}
.reward-popup {
  position: fixed; bottom: 80px;
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--lime);
  border: var(--border); box-shadow: var(--shadow-lg);
  color: var(--ink); padding: 14px 24px;
  border-radius: 20px; font-size: 15px; font-weight: 900;
  z-index: 300; opacity: 0; transition: all .4s; white-space: nowrap;
}
.reward-popup.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Misc ───────────────────────────────── */
.divider { height: 2px; background: var(--ink); margin: 14px 0; border-radius: 2px; }
.empty-state { text-align: center; padding: 40px 20px; color: #aaa; }
.empty-state p { font-size: 14px; font-weight: 700; margin-top: 10px; }

/* ── Desktop shell ──────────────────────── */
@media (min-width: 520px) {
  body { background: #E8E4DA; }
  .app-shell { border-left: var(--border); border-right: var(--border); }
  .auth-page { background: #E8E4DA; }
}

/* ── Dual Balance (topbar) ──────────────── */
.topbar__balances {
  display: flex; align-items: center; gap: 5px;
}
.topbar__bal-item {
  display: flex; flex-direction: column; align-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 3px 7px;
  line-height: 1.2;
}
.topbar__bal-item--wd  { background: var(--mint); }
.topbar__bal-item--dep { background: var(--yellow); }
.topbar__bal-label { font-size: 8px; font-weight: 900; color: #555; text-transform: uppercase; letter-spacing: .5px; }
.topbar__bal-val   { font-size: 11px; font-weight: 800; color: var(--ink); }

/* ── Dual Balance (hero card) ───────────── */
.dual-balance {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.dual-balance__item {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 12px 14px;
}
.dual-balance__item--wd  { background: var(--mint); }
.dual-balance__item--dep { background: var(--sky); }
.dual-balance__label { font-size: 11px; font-weight: 800; color: #444; margin-bottom: 4px; }
.dual-balance__val   { font-size: 18px; font-weight: 900; color: var(--ink); line-height: 1; }
.dual-balance__hint  { font-size: 10px; color: #666; margin-top: 3px; font-weight: 700; }

/* ── Tab btn active fix ─────────────────── */
.tab-btn--active { background: var(--ink); color: var(--white) !important; box-shadow: 2px 2px 0 #555; }
