/* 콜렉트로그 플레이 — blister-pack toy packaging: cobalt card backing, clear plastic bubbles, yellow price stickers */
:root {
  --bg: #e9edf8;        /* card backing */
  --surface: #ffffff;   /* plastic bubble */
  --ink: #161b33;
  --muted: #59617f;
  --line: #d3d9ea;
  --accent: #2b4bff;    /* cobalt */
  --accent-ink: #ffffff;
  --sticker: #ffd23f;   /* price sticker */
  --sticker-ink: #2a2100;
  --r-common: #8a93b2;
  --r-rare: #2b8cff;
  --r-epic: #a64bff;
  --r-secret: #f0a400;
  --shadow: 0 1px 0 rgba(22, 27, 51, .06), 0 8px 24px -12px rgba(22, 27, 51, .25);
  --f-display: "Black Han Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1222; --surface: #1a1f36; --ink: #eef0fa; --muted: #9aa2c4; --line: #2c3354;
    --accent: #7c93ff; --accent-ink: #0f1222; --sticker: #ffd23f; --sticker-ink: #2a2100;
    --r-common: #8f97b8; --r-rare: #5aa6ff; --r-epic: #c084ff; --r-secret: #ffc233;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1222; --surface: #1a1f36; --ink: #eef0fa; --muted: #9aa2c4; --line: #2c3354;
  --accent: #7c93ff; --accent-ink: #0f1222; --sticker: #ffd23f; --sticker-ink: #2a2100;
  --r-common: #8f97b8; --r-rare: #5aa6ff; --r-epic: #c084ff; --r-secret: #ffc233;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 0);
  background-size: 18px 18px;
  color: var(--ink);
  font: 15px/1.6 var(--f-body);
  -webkit-tap-highlight-color: transparent;
}
.wrap {
  max-width: 560px; margin: 0 auto;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.2; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--f-display); font-size: 15px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand::before { content: ""; width: 18px; height: 18px; border-radius: 5px; background: var(--accent); box-shadow: inset 0 0 0 4px var(--sticker); }
.top .back { font-size: 13px; color: var(--muted); text-decoration: none; }

/* blister bubble */
.bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.sticker {
  display: inline-block;
  background: var(--sticker); color: var(--sticker-ink);
  font: 600 12px/1 var(--f-mono); letter-spacing: .04em;
  padding: 6px 9px; border-radius: 999px;
  transform: rotate(-3deg);
}
.eyebrow { font: 600 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* buttons */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font: 600 16px/1 var(--f-body);
  padding: 15px 18px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; min-height: 50px;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.yellow { background: var(--sticker); color: var(--sticker-ink); }
.btn.block { width: 100%; }
.btn:focus-visible, .opt:focus-visible, a:focus-visible { outline: 3px solid var(--sticker); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

/* ad slot: AdSense unit goes here after approval */
.ad-slot {
  border: 1.5px dashed var(--line); border-radius: 14px;
  min-height: 72px; display: grid; place-items: center;
  font: 12px var(--f-mono); color: var(--muted); letter-spacing: .04em;
}

/* product picks */
.picks { display: flex; flex-direction: column; gap: 10px; }
.pick {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border-radius: 14px; background: var(--bg); text-decoration: none; color: var(--ink);
}
.pick .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; font-size: 22px; }
.pick .t { font-weight: 600; font-size: 15px; line-height: 1.35; }
.pick .d { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pick .go { font: 600 12px var(--f-mono); color: var(--accent); white-space: nowrap; }
.pick > div { min-width: 0; }
.disclosure { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  z-index: 50; pointer-events: none; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }

.foot { text-align: center; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 캐릭터 그림 */
.pet-svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* 공유 시트 */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10, 12, 30, .45); opacity: 0; transition: opacity .2s; }
.sheet-card {
  position: relative; width: 100%; max-width: 560px; background: var(--surface); color: var(--ink);
  border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 12px; transform: translateY(100%); transition: transform .22s ease;
}
.sheet.open .sheet-bg { opacity: 1; }
.sheet.open .sheet-card { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 4px; }
.sheet-preview { font-size: 13px; color: var(--muted); white-space: pre-line; background: var(--bg); border-radius: 12px; padding: 10px 12px; max-height: 96px; overflow: auto; word-break: break-all; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sh { appearance: none; border: 0; background: none; cursor: pointer; color: var(--ink); font: 600 12.5px var(--f-body); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; }
.sh .ic { width: 54px; height: 54px; border-radius: 18px; background: var(--bg); display: grid; place-items: center; font: 600 22px var(--f-body); }
.sh.kakao .ic { background: #fee500; color: #191919; }

/* 하단 시트 공용 (펫 상세 등) */
.modal { position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: center; }
.modal > .sheet-bg { opacity: 1; }
.modal > .sheet-card { transform: none; max-height: 88vh; overflow: auto; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.tabs3 { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs3 .btn { flex: 1 0 28%; min-height: 40px; padding: 8px 12px; font-size: 14px; }
.rank { display: flex; flex-direction: column; gap: 6px; }
.rank li { list-style: none; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; background: var(--bg); border-radius: 12px; padding: 9px 12px; font-size: 14px; }
.rank li.me { box-shadow: inset 0 0 0 2px var(--accent); }
.rank .no { font: 600 13px var(--f-mono); color: var(--muted); text-align: center; }
.rank .v { font: 600 13px var(--f-mono); font-variant-numeric: tabular-nums; }
.rank ol, ol.rank { margin: 0; padding: 0; }
.offline-note { font-size: 12.5px; color: var(--muted); background: var(--bg); border-radius: 12px; padding: 10px 12px; }
