/* 태국 모바일 우선. 프레임워크 없이 — 3G/4G에서 첫 화면이 빨라야 매일 오는 습관이 붙는다. */
:root {
  --bg: #0f1115;
  --card: #181c23;
  --line: #262c36;
  --text: #eef1f6;
  --muted: #98a2b3;
  --brand: #06c755;   /* LINE green */
  --hot: #ff5c39;
  --tap: 44px;        /* 손가락 최소 터치 영역 */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Noto Sans Thai", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 16px;
  background: rgba(15, 17, 21, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.4px; }
.who { color: var(--muted); font-size: 13px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 16px; max-width: 640px; margin: 0 auto; }
/* .tab에 display를 주면 클래스 선택자가 UA의 [hidden]{display:none}을 덮어써서
   탭이 전부 동시에 보인다. 감추는 쪽을 명시해 둔다. */
.tab[hidden] { display: none; }
.muted { color: var(--muted); }
.msg { margin: 8px 0 0; font-size: 14px; }
.msg.ok { color: var(--brand); }
.msg.err { color: var(--hot); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.list { display: flex; flex-direction: column; gap: 12px; }

/* 출석 카드 — 첫 화면의 주인공 */
.streak { text-align: center; }
.streak-num { font-size: 56px; font-weight: 800; line-height: 1; color: var(--hot); }
.streak-num small { font-size: 16px; color: var(--muted); margin-left: 6px; font-weight: 600; }
.stats { display: flex; justify-content: space-around; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.stats div { text-align: center; }
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 4px 0 0; font-weight: 700; font-size: 17px; }

button { font: inherit; cursor: pointer; border-radius: 10px; min-height: var(--tap); }
.primary { width: 100%; margin-top: 14px; padding: 12px; border: 0; background: var(--brand); color: #04220f; font-weight: 800; font-size: 16px; }
.primary[disabled] { background: #2a3140; color: var(--muted); }
.ghost { padding: 8px 14px; border: 1px solid var(--brand); background: transparent; color: var(--brand); font-weight: 700; font-size: 14px; }

/* 딜 카드 */
.deal { display: flex; gap: 12px; align-items: flex-start; }
.deal .body { flex: 1; min-width: 0; }
.deal h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.price { font-size: 20px; font-weight: 800; }
.was { color: var(--muted); text-decoration: line-through; margin-left: 8px; font-size: 13px; font-weight: 400; }
.off { background: var(--hot); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 800; margin-left: 8px; }
.deal-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.deal-actions button, .deal-actions a {
  min-height: var(--tap); padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #11151b; color: var(--text);
  font-size: 14px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.deal-actions button.on { border-color: var(--brand); color: var(--brand); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #11151b; color: var(--muted); font-size: 14px; }
.chip.on { border-color: var(--brand); color: var(--brand); }

/* 순위표 */
.entry { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.rank { width: 26px; font-weight: 800; color: var(--muted); }
.entry .name { flex: 1; }
.entry .votes { font-weight: 700; min-width: 32px; text-align: right; }
/* 순위표 투표 버튼. 지정하지 않으면 UA 기본(흰 배경)이 나와 다크 테마에서 튄다. */
.entry button {
  padding: 8px 14px; border: 1px solid var(--brand); border-radius: 10px;
  background: transparent; color: var(--brand); font-weight: 700; font-size: 14px;
}
.entry button[disabled] { border-color: var(--line); color: var(--muted); }
.wallet { margin: 4px 0 12px; font-size: 13px; }

/* 캠페인 */
.camp h3 { margin: 0 0 4px; font-size: 16px; }
.camp .reward { color: var(--brand); font-weight: 700; }
.camp form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.camp input, .camp select {
  min-height: var(--tap); padding: 10px; border-radius: 10px;
  border: 1px solid var(--line); background: #11151b; color: var(--text); font: inherit; width: 100%;
}
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; background: rgba(15, 17, 21, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbtn {
  flex: 1; min-height: 56px; border: 0; background: transparent; color: var(--muted);
  font-size: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tabbtn span { font-size: 20px; line-height: 1; }
.tabbtn.on { color: var(--brand); }
