/* ROH-Ads Earning — dark navy + gold glassmorphism theme */
:root {
  --bg: #0d1117;
  --bg-deep: #080b10;
  --card: #161d27;
  --card2: #1c2430;
  --gold: #d4af37;
  --gold-hi: #f2d16b;
  --gold-deep: #a8842a;
  --gold-dim: #9c8225;
  --gold-glow: rgba(212, 175, 55, 0.28);
  --text: #f0f3f7;
  --text-dim: #9aa4b2;
  --border: #26303e;
  --green: #2ea043;
  --red: #f85149;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  padding-bottom: 78px; /* room for tab bar */
  background:
    radial-gradient(1200px 600px at 15% -5%, rgba(30, 44, 72, 0.55), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(212, 175, 55, 0.07), transparent 55%),
    linear-gradient(180deg, #0e141d 0%, var(--bg) 35%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

.hidden { display: none !important; }

/* ---------- drifting glow orbs ---------- */
.orbs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.orb.o1 {
  width: 280px; height: 280px;
  left: -90px; top: 6%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.28), transparent 70%);
  animation: drift1 22s ease-in-out infinite alternate;
}
.orb.o2 {
  width: 340px; height: 340px;
  right: -120px; top: 42%;
  background: radial-gradient(circle, rgba(43, 72, 130, 0.5), transparent 70%);
  animation: drift2 28s ease-in-out infinite alternate;
}
.orb.o3 {
  width: 220px; height: 220px;
  left: 30%; bottom: -80px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.16), transparent 70%);
  animation: drift1 25s ease-in-out infinite alternate-reverse;
}
@keyframes drift1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 90px) scale(1.15); }
}
@keyframes drift2 {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(-70px, -60px) scale(0.95); }
}

#app { position: relative; z-index: 1; }

/* ---------- splash ---------- */
.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.splash-logo {
  font-size: 64px;
  filter: drop-shadow(0 6px 18px var(--gold-glow));
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.splash-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 50%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.splash-msg { color: var(--text-dim); font-size: 14px; padding: 0 32px; text-align: center; }

/* ---------- header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.14);
  padding: 12px 16px;
}
.app-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 6px rgba(212, 175, 55, 0.35));
}

/* ---------- tabs ---------- */
.tab-view { display: none; padding: 16px 16px 24px; max-width: 560px; margin: 0 auto; }
.tab-view.active { display: block; animation: fadeUp 0.25s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.section-title {
  margin: 4px 0 6px;
  font-size: 23px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-sub { margin: 0 0 14px; color: var(--text-dim); font-size: 13px; }

/* ---------- glass cards ---------- */
.card {
  background: linear-gradient(160deg, rgba(28, 36, 48, 0.78), rgba(15, 20, 28, 0.78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; color: var(--gold); }

.balance-row { display: flex; gap: 10px; margin-bottom: 14px; }
.balance-card { flex: 1; text-align: center; padding: 14px 6px; margin-bottom: 0; }
.balance-icon { font-size: 24px; margin-bottom: 6px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.balance-value {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.balance-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.spins { display: block; margin-top: 2px; }

/* ---------- profile header ---------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.profile-card::before {
  content: "";
  position: absolute;
  top: -60px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 70%);
  pointer-events: none;
}
.avatar-wrap {
  width: 68px; height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 200deg, var(--gold-hi), var(--gold), var(--gold-deep), var(--gold-hi));
  box-shadow:
    0 0 18px var(--gold-glow),
    0 8px 20px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}
.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0d1117;
}
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #191207;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
}
.profile-info { position: relative; min-width: 0; }
.profile-name {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff8e1, var(--gold-hi) 40%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(212, 175, 55, 0.25);
}
.profile-id {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

/* ---------- check-in ---------- */
.checkin-days { display: flex; gap: 6px; margin-bottom: 12px; }
.checkin-day {
  flex: 1;
  background: rgba(28, 36, 48, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 2px;
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
}
.checkin-day .day-reward { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.checkin-day.current {
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow), inset 0 0 12px rgba(212, 175, 55, 0.08);
}
.checkin-day.current .day-reward { color: var(--gold); }
.checkin-day.done { opacity: 0.55; }
.checkin-day.done::after { content: "✓"; display: block; color: var(--green); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.btn:active { transform: scale(0.96); filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-gold {
  background: linear-gradient(160deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  color: #191207;
  box-shadow: 0 6px 18px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-gold:active { box-shadow: 0 2px 8px var(--gold-glow); }
.btn-outline {
  background: rgba(212, 175, 55, 0.06);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.6);
  box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.06);
}
.btn-outline:active { background: rgba(212, 175, 55, 0.14); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13px; }

/* ---------- inputs ---------- */
.input {
  width: 100%;
  background: rgba(8, 11, 16, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
.field-label { display: block; font-size: 13px; color: var(--text-dim); margin: 12px 0 6px; }
.hint { font-size: 12px; color: var(--text-dim); margin: 8px 0; text-align: center; }

/* ---------- tasks ---------- */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.task-desc { font-size: 12px; color: var(--text-dim); }
.reward-badge {
  display: inline-block;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.65);
  color: var(--gold-hi);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}
.task-actions { display: flex; flex-direction: column; gap: 8px; min-width: 96px; }
.completed-tag { color: #4ade80; font-weight: 700; font-size: 13px; text-align: center; }

/* ---------- skeleton shimmer ---------- */
.skel {
  position: relative;
  overflow: hidden;
  background: rgba(28, 36, 48, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(212, 175, 55, 0.14) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}
.skel-task { height: 92px; }
.skel-row { height: 54px; }

/* ---------- ad banner slot ---------- */
.ad-slot:empty { display: none; }
.ad-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
}
.ad-title { font-weight: 800; font-size: 14px; color: var(--gold-hi); }
.ad-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.ad-card .btn { flex-shrink: 0; }

/* ---------- spin wheel ---------- */
.spin-card { text-align: center; }
.wheel-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 12px auto 16px;
}
#wheel-canvas {
  width: 260px;
  height: 260px;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 0 26px rgba(212, 175, 55, 0.25)) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--gold-hi);
  z-index: 3;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 8px var(--gold-glow));
}
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 3px solid #191207;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  color: #191207;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  cursor: pointer;
  z-index: 2;
  box-shadow:
    0 6px 20px var(--gold-glow),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -4px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.wheel-center:active { transform: translate(-50%, -50%) scale(0.93); }
.wheel-center:disabled { opacity: 0.5; cursor: not-allowed; }
.spin-card.spinning #wheel-canvas { filter: drop-shadow(0 0 34px rgba(212, 175, 55, 0.45)) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6)); }
.spin-cost { color: var(--text-dim); font-size: 13px; margin-bottom: 4px; }
.spin-balance { font-size: 14px; }
.spin-balance b { color: var(--gold-hi); }

/* ---------- referral ---------- */
.ref-note { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; }
.ref-link-box { margin-bottom: 12px; }
.ref-link-box .input { font-size: 12px; color: var(--gold); }
.ref-actions { display: flex; gap: 10px; }
.ref-actions .btn { flex: 1; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-item {
  display: flex;
  justify-content: space-between;
  background: rgba(28, 36, 48, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.team-item .joined { color: var(--text-dim); font-size: 11px; }

/* ---------- wallet ---------- */
.wallet-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(38, 48, 62, 0.7);
  font-size: 15px;
}
.wallet-row:last-of-type { border-bottom: none; }
.wallet-row b {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wallet-rate { font-size: 12px; color: var(--text-dim); padding: 2px 0 8px; }
.gift-row { display: flex; gap: 10px; }
.gift-row .input { flex: 1; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  background: rgba(28, 36, 48, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.history-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.history-meta { color: var(--text-dim); font-size: 11px; }
.status-badge {
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.status-pending { background: rgba(212,175,55,0.15); color: var(--gold); border: 1px solid var(--gold); }
.status-approved { background: rgba(46,160,67,0.15); color: #4ade80; border: 1px solid var(--green); }
.status-rejected { background: rgba(248,81,73,0.15); color: #ff7b72; border: 1px solid var(--red); }
.empty-note { color: var(--text-dim); font-size: 13px; text-align: center; padding: 12px 0; }

/* ---------- tab bar ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(212, 175, 55, 0.16);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}
.tab-btn {
  position: relative;
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0 4px;
  transition: color 0.18s ease, transform 0.1s ease;
}
.tab-btn:active { transform: scale(0.93); }
.tab-btn .tab-icon { font-size: 22px; transition: transform 0.18s ease, filter 0.18s ease; }
.tab-btn.active { color: var(--gold-hi); }
.tab-btn.active .tab-icon {
  transform: translateY(-2px) scale(1.12);
  filter: drop-shadow(0 0 8px var(--gold-glow));
}
.tab-btn.active::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 25%;
  right: 25%;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, transparent, var(--gold-hi), var(--gold), transparent);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* ---------- popup ---------- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.popup {
  background: linear-gradient(160deg, rgba(32, 40, 54, 0.95), rgba(16, 21, 29, 0.95));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 0 50px var(--gold-glow), 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: popIn 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.popup-icon { font-size: 56px; margin-bottom: 12px; filter: drop-shadow(0 4px 14px var(--gold-glow)); }
.popup-text {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(42, 26, 26, 0.95);
  border: 1px solid var(--red);
  color: #ffb4ab;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  max-width: 90%;
  z-index: 300;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toastIn 0.22s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast.success { background: rgba(18, 41, 26, 0.95); border-color: var(--green); color: #7ee2a0; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .splash-logo { animation: none; }
  .skel::after { animation: none; }
  .tab-view.active { animation: none; }
  .popup { animation: none; }
  .toast { animation: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

@media (min-width: 600px) {
  .tab-view { padding: 24px; }
}
