@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f2f1ec;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --border: #e2e0d8;
  --border-strong: #cbc9c0;

  --text: #232320;
  --text-muted: #83817a;

  --grey-mid: #b3b1a9;
  --grey-dark: #8d8b83;
  --grey-darker: #5c5a54;

  --amber: #b9832e;
  --amber-bg: #b9832e18;
  --green: #3f7d5c;
  --green-bg: #3f7d5c16;
  --red: #b8493f;
  --red-bg: #b8493f16;

  /* Aksen "fire" + glow — dipake seperlunya di podium/reward, biar gak norak */
  --accent: #ff5c33;
  --accent-2: #ffb03a;
  --accent-glow: rgba(255, 92, 51, 0.5);

  --font-display: 'Oswald', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
}

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

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(60% 40% at 15% 0%, #ffffffaa 0%, transparent 60%),
    radial-gradient(50% 30% at 100% 0%, #e8e6de 0%, transparent 55%);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 64px;
}

/* ---------- Top nav ---------- */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.brand img {
  height: 26px;
  width: auto;
  display: block;
}

.brand span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-links a.active {
  color: var(--surface);
  background: var(--text);
}

/* ---------- Hero ---------- */

.hero { padding: 20px 2px 22px; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey-darker);
  margin: 0 0 8px;
}

#weekLabel { letter-spacing: 0.04em; }

.hero h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.hero p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* ---------- Week selector ---------- */

.week-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scrollbar-width: none;
}
.week-scroll::-webkit-scrollbar { display: none; }

.week-chip {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}

.week-chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

/* ---------- Rewards ---------- */

.rewards-card {
  background: linear-gradient(155deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 20px;
}

.rewards-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey-darker);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reward-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}

.reward-row:last-child { border-bottom: none; }

.reward-rank {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px 1px var(--accent-glow);
  min-width: 28px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  flex-shrink: 0;
}

.reward-desc { font-weight: 600; }

/* ---------- Podium ---------- */

.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 22px;
}

.podium-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px 14px;
  text-align: center;
  position: relative;
}

.podium-card.rank-1 {
  order: 2;
  padding-top: 24px;
  border-color: var(--border-strong);
  background: linear-gradient(165deg, #ffffff, #f4f3ee);
  box-shadow: 0 0 0 1px var(--accent), 0 0 34px 4px var(--accent-glow), 0 14px 28px -16px rgba(35,35,32,0.28), inset 0 0 0 1px #ffffff;
}

.podium-card.rank-2 { order: 1; }
.podium-card.rank-3 { order: 3; }

.podium-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  color: var(--grey-dark);
  background: var(--surface-2);
}

.podium-card.rank-1 .podium-rank {
  color: #fff;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 16px 2px var(--accent-glow);
}

.podium-card.rank-2 .podium-rank {
  color: #4a4a46;
  background: linear-gradient(145deg, #e6e5df, #c7c5bc);
  box-shadow: 0 0 8px 1px rgba(150,148,138,0.4);
}

.podium-card.rank-3 .podium-rank {
  color: #fff;
  background: linear-gradient(145deg, #cf9160, #a86438);
  box-shadow: 0 0 8px 1px rgba(168,100,56,0.4);
}

.podium-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  margin: 8px 0 2px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.podium-wins {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--text);
}

.podium-card.rank-1 .podium-wins {
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}

.podium-wins span {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 3px;
}

/* ---------- Leaderboard list ---------- */

.board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.board-row:last-child { border-bottom: none; }

.board-rank {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  width: 24px;
  flex-shrink: 0;
}

.board-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.board-wins {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  white-space: nowrap;
}

.board-wins span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

/* ---------- Empty / loading states ---------- */

.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- CTA ---------- */

.cta-bar { margin-top: 22px; display: flex; justify-content: center; }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s ease, opacity .12s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--text); color: var(--surface); transition: box-shadow .2s ease, transform .15s ease; }
.btn-primary:hover, .btn-primary:focus-visible { box-shadow: 0 0 20px 2px var(--accent-glow); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.field input[type="text"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease;
}

.field input:focus, .field textarea:focus { border-color: var(--grey-darker); }
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

.upload-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  position: relative;
  background: var(--surface-2);
}

.upload-box:hover { border-color: var(--grey-darker); }

.upload-box input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

.upload-box .upload-hint { font-size: 13px; color: var(--text-muted); }

.upload-preview {
  margin-top: 12px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: none;
}

.msg {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
}

.msg.show { display: block; }
.msg.error { background: var(--red-bg); color: var(--red); }
.msg.success { background: var(--green-bg); color: var(--green); }

/* ---------- Admin ---------- */

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }

.tab {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.tab.active { color: var(--surface); background: var(--text); border-color: var(--text); }

.sub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.sub-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.sub-title { font-weight: 700; font-size: 15px; }
.sub-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sub-wa {
  font-size: 12.5px; color: var(--grey-darker); font-weight: 600;
  margin-top: 4px; display: flex; align-items: center; gap: 5px;
}

.status-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pending { background: var(--amber-bg); color: var(--amber); }
.status-approved { background: var(--green-bg); color: var(--green); }
.status-rejected { background: var(--red-bg); color: var(--red); }

.sub-img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  cursor: zoom-in;
}

.sub-note { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.sub-actions { display: flex; gap: 8px; }

.btn-sm { flex: 1; padding: 10px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-approve { background: var(--green); color: #fff; }
.btn-reject { background: var(--surface); color: var(--red); border: 1px solid var(--red); }

.login-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card { width: 100%; max-width: 340px; text-align: center; }
.login-card img { height: 44px; margin-bottom: 14px; }

.login-card h1 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.login-card p { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }
.login-card .field { text-align: left; }

/* Rewards editor (admin) */

.reward-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.reward-edit-row input[type="number"] {
  width: 56px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-family: var(--font-body);
  font-size: 14px;
  text-align: center;
}

.reward-edit-row input[type="text"] {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
}

.reward-edit-row button {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.lb-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.lb-row:last-child { border-bottom: none; }

.lb-rank { width: 28px; font-weight: 700; color: var(--text-muted); font-size: 13px; }

.lb-name {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-points-input {
  width: 60px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  font-family: var(--font-body);
  font-size: 14px;
  text-align: center;
}

.lb-restore, .lb-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
}

.lb-remove { color: var(--red); }

.lb-add-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 6px;
}

.lb-add-row input[type="text"] {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
}

.lb-add-row input[type="number"] {
  width: 64px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-family: var(--font-body);
  font-size: 14px;
  text-align: center;
}

.log-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.log-row:last-child { border-bottom: none; }

.log-main { color: var(--text); }

.log-time {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

@media (max-width: 380px) {
  .hero h1 { font-size: 27px; }
  .podium-wins { font-size: 17px; }
}
