@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/pretendard/Pretendard-ExtraBold.otf') format('opentype');
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --card: #ffffff;
  --ink: #111111;
  --text: #1f2429;
  --dim: #8a929c;
  --line: #e9e9ed;
  --blue: #4a90d9;
  --purple: #5b35ff;
  --gold: #f5b324;
  --green: #12b886;
  --red: #e11d48;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(112px + var(--safe-b));
  font-family: 'Pretendard', 'Noto Sans KR', 'Roboto', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.apptech-screen,
body.apptech-screen .app-shell,
body.apptech-screen .app-top {
  background: var(--line);
}
body.apptech-screen .app-top {
  border-bottom: 0;
}
body.hood-screen .app-content {
  padding-left: 20px;
  padding-right: 20px;
}
body.hood-screen .show-strip {
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

.app-shell,
.wrap {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
}
.app-top {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 57px;
  padding: 8px 8px 8px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.app-top h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ink);
}
.app-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-content { padding: 16px 16px calc(32px + var(--safe-b)); }
.app-content--flush { padding-left: 0; padding-right: 0; }

.app-section { margin-top: 22px; }
.app-section:first-child { margin-top: 0; }
.section-head,
.app-title-row,
.sec h2,
.section h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}
.section-head small,
.app-title-row a,
.sec h2 em,
.section h2 span {
  color: var(--dim);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.card,
.panel,
.rank-card,
.setting-card,
.hot-card,
.event-card,
.earn-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.activity-card,
.live-box {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.activity-card b,
.live-box b { flex: none; color: var(--ink); font-size: 14px; font-weight: 900; }
.activity-card span,
.live-box span { min-width: 0; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.earn-hero {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.earn-hero b { color: var(--ink); font-size: 18px; font-weight: 900; }
.earn-hero strong { color: var(--purple); font-size: 28px; line-height: 1; font-weight: 900; }
.earn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.earn-card {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
}
.earn-card i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(74,144,217,.12);
  color: var(--blue);
  font-style: normal;
  font-weight: 900;
}
.earn-card b { font-size: 14px; font-weight: 900; }
.earn-card small { color: var(--dim); font-size: 12px; font-weight: 700; }

.app-balance-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
}
.app-balance-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-balance-card span,
.app-balance-card a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 14px;
  font-weight: 700;
}
.app-balance-card strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
}
.app-balance-card small {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}
.mission-card {
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}
.mission-row {
  min-height: 76px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.mission-row + .mission-row { border-top: 1px solid var(--line); }
.mission-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
}
.mission-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mission-icon.blue { background: rgba(74,144,217,.12); color: var(--blue); }
.mission-icon.orange { background: rgba(255,138,0,.12); color: #ff8a00; }
.mission-icon.purple { background: rgba(123,97,255,.12); color: #7b61ff; }
.mission-icon.green { background: rgba(18,184,134,.12); color: var(--green); }
.mission-row b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}
.mission-row small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 400;
}
.action-chip,
.soon-chip {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}
.action-chip.orange { background: #ff8a00; }
.action-chip.purple { background: #7b61ff; }
.soon-chip {
  padding: 0 12px;
  background: #edf0f3;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}

.rank-card { padding: 15px 16px 10px; }
.rank-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rank-card__head b { font-size: 16px; font-weight: 900; }
.rank-card__head span { color: var(--dim); font-size: 12px; font-weight: 800; }
.rank-row {
  min-height: 32px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.rank-row span { color: var(--dim); font-weight: 900; }
.rank-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.rank-row strong { color: var(--blue); font-size: 15px; font-weight: 900; }

.event-strip,
.punlucky-strip,
.show-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 3px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  cursor: grab;
}
.event-strip.is-dragging,
.punlucky-strip.is-dragging,
.show-strip.is-dragging {
  scroll-behavior: auto;
  cursor: grabbing;
}
.event-strip::-webkit-scrollbar,
.punlucky-strip::-webkit-scrollbar,
.show-strip::-webkit-scrollbar { display: none; }
.event-card,
.lucky-wide {
  flex: 0 0 280px;
  scroll-snap-align: start;
  overflow: hidden;
  color: inherit;
}
.lucky-hit {
  display: block;
  color: inherit;
}
.event-card img,
.lucky-wide img {
  width: 100%;
  aspect-ratio: 1.6 / 1;
  object-fit: cover;
  background: var(--surface);
}
.event-card__body,
.lucky-wide { padding: 12px; }
.lucky-wide img { border-radius: 12px; }
.event-card h3,
.lucky-wide h3 {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 900;
}
.event-card p,
.lucky-wide time {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
}
.lucky-actions {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  margin-top: 10px;
}
.lucky-actions span,
.lucky-actions b,
.lucky-actions button,
.yellow-btn {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}
.lucky-actions b,
.lucky-actions button,
.yellow-btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.lucky-actions button:disabled {
  background: #fff;
  color: var(--dim);
  border-color: var(--line);
}

.show-strip { min-height: 176px; }
.show-card {
  flex: 0 0 124px;
  height: 176px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.show-card img,
.show-poster-empty {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: rgba(233,233,237,.5);
}
.show-poster-empty {
  display: grid;
  place-items: center;
  font-size: 24px;
}
.show-card span {
  display: block;
  padding: 6px 8px 8px;
}
.show-card b,
.show-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.show-card b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 900;
}
.show-card small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 400;
}
.empty {
  flex: 1 0 auto;
  margin: 0;
  padding: 18px 0;
  color: var(--dim);
  font-size: 13px;
  font-weight: 800;
}

.head {
  min-height: 0 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink) !important;
}
.head::after, .head h1, .head p { display: none !important; }
.point {
  width: 100% !important;
  min-height: 50px !important;
  justify-content: space-between !important;
  padding: 0 15px !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}
.point::before { content: '내 푼'; }
.tabs {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
  margin: 0 0 14px !important;
  padding: 5px !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: rgba(247,248,250,.92) !important;
  box-shadow: none !important;
}
.tabs button {
  height: 38px !important;
  border-radius: 12px !important;
  color: var(--dim) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}
.tabs button.on { background: var(--ink) !important; color: #fff !important; }
.login-nudge,
.login-cta {
  min-height: 48px !important;
  margin: 12px 0 0 !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--purple) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}
.sec { margin: 18px 0 0 !important; }
.cards {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
}
.product {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: none !important;
  text-align: left !important;
}
.photo {
  width: 100% !important;
  aspect-ratio: 1.3 / 1 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
}
.product__body { min-width: 0; padding: 9px 10px 10px !important; }
.name {
  margin: 0 !important;
  color: var(--ink) !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
}
.desc, .meta, .state {
  color: var(--dim) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}
.cost {
  display: block !important;
  margin-top: 4px !important;
  color: var(--ink) !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.hot-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px 13px;
  padding: 0 16px;
  scrollbar-width: none;
}
.hot-filters::-webkit-scrollbar { display: none; }
.hot-filters button {
  flex: none;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--dim);
  font-size: 14px;
  font-weight: 900;
}
.hot-filters button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.hot-sort {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 900;
}
.hot-sort b { color: var(--ink); }
.hot-sort span:last-child { margin-left: auto; }
.hot-list { display: grid; gap: 12px; }
.hot-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
}
.hot-card img {
  width: 104px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface);
}
.hot-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 900;
}
.hot-card strong {
  display: block;
  margin-top: 4px;
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
}
.hot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 800;
}
.hot-meta b { color: var(--green); }

.settings-section { margin-top: 16px; }
.settings-section h2 {
  margin: 0 0 8px;
  color: var(--dim);
  font-size: 14px;
  font-weight: 900;
}
.setting-card { overflow: hidden; }
.setting-row {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  /* .only-app 뱃지가 붙으면 4번째 칸이 생긴다. 기본값(row)이면 화살표가
     아랫줄로 떨어지므로 넘치는 칸은 열로 만든다. */
  grid-auto-flow: column;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  text-align: left;
}
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.setting-row b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.setting-row small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}
/* 웹에서는 안 되고 앱에서만 되는 줄에 붙이는 표시 */
.only-app {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--dim);
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.chev {
  width: 9px;
  height: 9px;
  border-top: 2px solid #a1a8b1;
  border-right: 2px solid #a1a8b1;
  transform: rotate(45deg);
}
.ios-switch {
  width: 51px;
  height: 31px;
  padding: 3px;
  border-radius: 999px;
  background: #e9edf2;
}
.ios-switch::after {
  content: "";
  display: block;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.ios-switch.on { background: #90bcf4; }
.ios-switch.on::after { margin-left: auto; background: var(--blue); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  z-index: 220;
  transform: translateX(-50%);
  width: min(100% - 32px, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-weight: 850;
}
.toast[hidden] { display: none; }

@media (min-width: 760px) {
  html, body { background: #edf0ed; }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(115deg, transparent 0 18%, rgba(126,148,121,.18) 18% 19.3%, transparent 19.3% 52%, rgba(182,151,94,.20) 52% 53.4%, transparent 53.4%),
      linear-gradient(24deg, transparent 0 28%, rgba(126,148,121,.16) 28% 29.4%, transparent 29.4% 72%, rgba(182,151,94,.18) 72% 73.2%, transparent 73.2%),
      repeating-linear-gradient(0deg, rgba(75,92,78,.07) 0 1px, transparent 1px 92px),
      repeating-linear-gradient(90deg, rgba(75,92,78,.06) 0 1px, transparent 1px 104px),
      #edf0ed;
  }
  .app-shell,
  .wrap {
    min-height: calc(100dvh - 44px);
    margin: 22px auto;
    overflow: clip;
    border: 1px solid rgba(17,17,20,.08);
    border-radius: 34px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.65), 0 22px 62px rgba(35,38,42,.18);
  }
  .app-top {
    top: 22px;
    border-radius: 34px 34px 0 0;
  }
}
