*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; background: #f3f4f6; font-family: 'Inter', sans-serif; -webkit-font-smoothing: antialiased; color: #1f2937; }
.hidden { display: none !important; }
.text-center { text-align: center; }

.page-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 40px 20px; }

.gleam-wrapper { width: 100%; max-width: 600px; background: #fff; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.06); overflow: hidden; border: 1px solid #e5e7eb; }

/* Hero */
.hero-img { height: 240px; background-size: cover; background-position: center; background-color: #e5e7eb; }

/* Stats Bar */
.stats-bar { display: flex; border-bottom: 1px solid #e5e7eb; background: #fafafa; }
.stat-box { flex: 1; padding: 16px; text-align: center; border-right: 1px solid #e5e7eb; }
.stat-box:last-child { border-right: none; }
.stat-val { display: block; font-size: 1.35rem; font-weight: 700; color: #111827; }
.stat-label { display: block; font-size: 0.75rem; color: #6b7280; text-transform: uppercase; margin-top: 6px; letter-spacing: 0.05em; font-weight: 600; }
.colon { margin: 0 4px; color: #9ca3af; }

/* Content area */
.content-pad { padding: 28px 24px; }
h1 { font-size: 1.65rem; font-weight: 800; color: #111827; margin: 0 0 10px; line-height: 1.2; }
.blurb { color: #4b5563; font-size: 1rem; line-height: 1.6; margin: 0 0 28px; }

/* Entry List Accordion */
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry-item { border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; background: #fff; transition: all 0.2s; }
.entry-header { display: flex; align-items: center; padding: 14px 16px; cursor: pointer; background: #fff; transition: background 0.2s; }
.entry-header:hover { background: #f9fafb; }

.entry-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; margin-right: 16px; color: #6b7280; }
.entry-icon svg { width: 100%; height: 100%; }
.entry-label { flex: 1; font-weight: 600; color: #374151; font-size: 1rem; }
.entry-points { background: #f3f4f6; color: #4b5563; font-weight: 700; font-size: 0.85rem; padding: 4px 10px; border-radius: 4px; min-width: 40px; text-align: center; }

/* States */
.entry-item.active-task { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.entry-item.active-task .entry-points { background: #3b82f6; color: #fff; }

.entry-item.locked { opacity: 0.65; pointer-events: none; background: #f9fafb; border-color: #e5e7eb; }
.entry-item.locked .entry-header { background: #f9fafb; }

.entry-item.completed { border-color: #10b981; }
.entry-item.completed .entry-points { background: #10b981; color: white; }
.entry-item.completed .entry-icon { color: #10b981; }

.entry-body { padding: 16px; border-top: 1px solid #e5e7eb; background: #fafafa; }

/* Forms & Buttons */
input { width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 6px; margin-bottom: 12px; font-family: inherit; font-size: 1rem; color: #1f2937; background: #fff; transition: border-color 0.2s; }
input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
input[readonly] { background: #f9fafb; cursor: text; }

.btn { width: 100%; padding: 14px; background: #2563eb; color: white; font-weight: 600; font-size: 1rem; border: none; border-radius: 6px; cursor: pointer; transition: background 0.2s; }
.btn:hover { background: #1d4ed8; }
.btn:disabled { background: #93c5fd; cursor: not-allowed; }

#error-alert { background: #fee2e2; color: #b91c1c; padding: 12px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; text-align: center; border: 1px solid #f87171; }

/* Referral Block */
.referral-highlight { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 24px; margin-bottom: 24px; text-align: center; }
.referral-highlight h3 { color: #1e3a8a; font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; }
.referral-highlight p { color: #3b82f6; font-size: 0.95rem; margin: 0 0 18px; }

.share-row { display: flex; gap: 8px; margin-bottom: 16px; }
.share-row input { margin-bottom: 0; border-color: #93c5fd; font-family: monospace; font-size: 0.9rem; color: #1e40af; }
.share-row button { width: auto; padding: 0 20px; flex-shrink: 0; background: #3b82f6; }
.share-row button:hover { background: #2563eb; }

.social-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; }
.soc-btn { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; color: white; text-decoration: none; font-weight: bold; font-family: sans-serif; font-size: 1.1rem; transition: transform 0.2s; }
.soc-btn:hover { transform: scale(1.05); }
.soc-btn.fb { background: #1877f2; }
.soc-btn.x { background: #000000; }
.soc-btn.wa { background: #25d366; }

.progress-container { position: relative; margin: 30px 0 10px; }
.progress-bar { height: 10px; background: #dbeafe; border-radius: 5px; overflow: hidden; position: relative; }
.progress-fill { height: 100%; background: #2563eb; border-radius: 5px; transition: width 0.5s ease; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: #2563eb; margin-top: 8px; font-weight: 600; }

.leaderboard-mock { background: #fff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 14px; margin-top: 24px; text-align: left; }
.leaderboard-mock h4 { margin: 0 0 12px; font-size: 0.8rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
.lb-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; border-bottom: 1px dashed #e5e7eb; }
.lb-row:last-child { border-bottom: none; }
.lb-name { font-weight: 600; color: #374151; }
.lb-score { color: #2563eb; font-weight: 700; }

/* Footer */
.footer-links { text-align: center; padding: 16px; border-top: 1px solid #e5e7eb; background: #f9fafb; }
.text-link { background: none; border: none; color: #6b7280; font-size: 0.85rem; cursor: pointer; text-decoration: underline; font-family: inherit; }
.text-link:hover { color: #374151; }

/* Modals */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; backdrop-filter: blur(4px); }
.modal-content { background: #fff; width: 100%; max-width: 500px; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); overflow: hidden; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #e5e7eb; }
.modal-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.close-btn { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #6b7280; padding: 0; }
.modal-body { padding: 24px; overflow-y: auto; }

.iw-content { padding: 32px 24px; }

@media (max-width: 480px) {
  .page-wrap { padding: 20px 10px; }
  .content-pad { padding: 20px 16px; }
  .hero-img { height: 180px; }
  .stat-val { font-size: 1.2rem; }
  .stat-label { font-size: 0.7rem; }
}