/* Collé — user app (ADR 0007: Y2K Holo, switchable themes). One fixed card size everywhere. */
@import url("https://fonts.googleapis.com/css2?family=Prompt:wght@500;600;700;800&family=Anuphan:wght@400;500;600&display=swap");

:root {
  --holo: linear-gradient(110deg, #7CF3FF 0%, #B99CFF 32%, #FF9AE6 62%, #FFE38A 100%);
  --prog: linear-gradient(90deg, #FF7AD9, #B99CFF 45%, #7CF3FF 75%, #B7FF8A);
  --display: "Prompt", system-ui, -apple-system, sans-serif;
  --body: "Anuphan", "Prompt", system-ui, -apple-system, sans-serif;
  --card-w: 92px; --card-h: 129px;            /* every card, everywhere */
  --radius: 16px;
  /* 1. Holo Night (Default — Gen Z / Y2K Collector Dark) */
  --bg: radial-gradient(520px 360px at 15% -5%, #3A2170 0%, transparent 70%), linear-gradient(180deg, #1B1036, #0E0820);
  --bg-solid: #0E0820;
  --ink: #F5F0FF; --muted: #B4A7D9; --surface: rgba(255,255,255,.08); --surface2: #231849; --select-bg: #231849; --line: rgba(255,255,255,.15);
  --accent: #B78CFF; --on-accent: #170D30; --track: rgba(255,255,255,.12); --nav: rgba(18,10,36,.94);
  --chip: #2C2058; --badge: #FF7AD9; --good: #7CF3C8; --good-ink: #0D3A2C; --warn: #FFE38A; --warn-ink: #4A3A00; --near-em: #FFE38A;
  --glow: 0 0 0 1px rgba(255,255,255,.12), 0 10px 24px -10px rgba(185,156,255,.7);
  --sheet: #1A1236;
  color-scheme: dark;
}
/* 2. Holo Day (Gen Z / Gen Y — Soft Pastel Light) */
body[data-skin="day"] {
  --bg: radial-gradient(520px 360px at 15% -5%, #FFE3F6 0%, transparent 70%), linear-gradient(180deg, #FBF6FF, #EEF0FF);
  --bg-solid: #F5F0FF;
  --ink: #221545; --muted: #65588A; --surface: #FFFFFF; --surface2: #F1EBFF; --select-bg: #FFFFFF; --line: #DCD0F5;
  --accent: #7C4DFF; --on-accent: #FFFFFF; --track: #E7E0F6; --nav: rgba(255,255,255,.96); --chip: #EFE7FF; --badge: #FF4DB8;
  --good: #10B981; --good-ink: #FFFFFF; --warn: #F59E0B; --warn-ink: #3B2500; --near-em: #6D28D9;
  --glow: 0 0 0 1px #DCD0F5, 0 10px 22px -12px rgba(124,77,255,.35); --sheet: #FFFFFF;
  color-scheme: light;
}
/* 3. Sticker Pop (Gen Alpha — Playful Bright Pop) */
body[data-skin="pop"] {
  --bg: linear-gradient(180deg, #EAF0FF, #F6F8FF); --bg-solid: #EEF2FF;
  --ink: #161B33; --muted: #586080; --surface: #FFFFFF; --surface2: #DCE5FF; --select-bg: #FFFFFF; --line: #C8D4F5;
  --accent: #2D5BFF; --on-accent: #FFFFFF; --holo: linear-gradient(110deg, #FFD23F, #FF6FB5 50%, #2D5BFF);
  --prog: linear-gradient(90deg, #2D5BFF, #FF6FB5, #FFD23F); --track: #DCE3F5; --nav: #FFFFFF; --chip: #E3EAFF; --badge: #FF55A3;
  --good: #16A34A; --good-ink: #FFFFFF; --warn: #FACC15; --warn-ink: #3B2800; --near-em: #1D4ED8;
  --glow: 0 0 0 2px #FFFFFF, 0 6px 14px -6px rgba(27,31,59,.3); --sheet: #FFFFFF;
  color-scheme: light;
}
/* 4. Minimal Café (Gen Y / Working Adults & Specialty Coffee Lovers — Warm Oat & Espresso) */
body[data-skin="cafe"] {
  --bg: radial-gradient(520px 360px at 15% -5%, #F5E6D3 0%, transparent 70%), linear-gradient(180deg, #FAF6F0, #F2EAE0);
  --bg-solid: #FAF6F0;
  --ink: #2C1E14; --muted: #6E5A49; --surface: #FFFFFF; --surface2: #EFE5D8; --select-bg: #FFFFFF; --line: #DFD1C0;
  --accent: #9C5123; --on-accent: #FFFFFF;
  --holo: linear-gradient(110deg, #E6B980 0%, #D48C58 45%, #8DB36A 100%);
  --prog: linear-gradient(90deg, #9C5123, #D48C58 55%, #5C8D4E);
  --track: #E6DACB; --nav: rgba(250,246,240,.96); --chip: #EFE5D8; --badge: #C84B31;
  --good: #2E6F40; --good-ink: #FFFFFF; --warn: #E09F3E; --warn-ink: #2C1E14; --near-em: #8C4218;
  --glow: 0 0 0 1px #DFD1C0, 0 8px 20px -10px rgba(92,58,33,.22); --sheet: #FAF6F0;
  color-scheme: light;
}
/* 5. Clear Comfort (Gen X / Seniors — High-Contrast AAA & Larger Readable Type) */
body[data-skin="clear"] {
  --bg: #F8FAFC; --bg-solid: #F8FAFC;
  --ink: #0F172A; --muted: #334155; --surface: #FFFFFF; --surface2: #E2E8F0; --select-bg: #FFFFFF; --line: #94A3B8;
  --accent: #1D4ED8; --on-accent: #FFFFFF;
  --holo: linear-gradient(110deg, #1D4ED8 0%, #2563EB 55%, #0D9488 100%);
  --prog: linear-gradient(90deg, #1D4ED8, #0D9488);
  --track: #CBD5E1; --nav: #FFFFFF; --chip: #E2E8F0; --badge: #DC2626;
  --good: #15803D; --good-ink: #FFFFFF; --warn: #F59E0B; --warn-ink: #0F172A; --near-em: #1D4ED8;
  --glow: 0 0 0 1.5px #94A3B8, 0 4px 12px rgba(15,23,42,.12); --sheet: #FFFFFF;
  color-scheme: light;
  font-size: 16px;
}
body[data-skin="clear"] .btn, body[data-skin="clear"] .bnr, body[data-skin="clear"] .way .ic, body[data-skin="clear"] .nav .scan {
  color: #FFFFFF;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); background-color: var(--bg-solid); background-attachment: fixed; color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.5; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; width: 100%; }
select { background-color: var(--select-bg, var(--surface2)); color: var(--ink); cursor: pointer; }
select option, select optgroup { background-color: var(--select-bg, var(--bg-solid)); color: var(--ink); font-family: var(--body); font-size: 14.5px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, .display { font-family: var(--display); margin: 0; line-height: 1.25; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
.page { padding: 0 16px; display: grid; gap: 14px; align-content: start; }

/* header */
.top { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 8px; }
.word { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; line-height: 1;
  background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lv { font-family: var(--display); font-weight: 700; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--chip); }
.ava { display: inline-block; width: 42px; height: 42px; border-radius: 50%; padding: 2.5px; background: var(--line); flex: none; position: relative; }
.ava i { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #FFD8F2; color: #5B2A7A;
  font-style: normal; font-family: var(--display); font-weight: 800; font-size: 16px; }
.ava.f-holo { background: conic-gradient(#7CF3FF, #B99CFF, #FF9AE6, #FFE38A, #7CF3FF); }
.ava.f-holo::before { content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px;
  background: #FFE38A; clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%); }
.ava.f-moon { background: linear-gradient(160deg, #FFE38A, #6C4CF5); }
.ava.f-sakura { background: conic-gradient(#FFC6E0, #FF7AB8, #FFF0F6, #FFC6E0); }
.ava.big { width: 84px; height: 84px; padding: 4px; } .ava.big i { font-size: 32px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11px; }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; }
.h { font-family: var(--display); font-weight: 700; font-size: 18px; }
.sec { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.sec .h { font-size: 16px; }
.link { color: var(--accent); font-weight: 600; font-size: 13px; }

/* tabs + segments */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 13.5px;
  color: var(--muted); overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 8px 0 9px; white-space: nowrap; }
.tabs .on { color: var(--ink); box-shadow: inset 0 -2.5px 0 var(--accent); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { font-family: var(--display); font-weight: 600; font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--muted); }
.seg .on { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 18px;
  font-family: var(--display); font-weight: 800; font-size: 14px; background: var(--holo); color: #1A0F33; box-shadow: var(--glow); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface2); color: var(--ink); box-shadow: 0 0 0 1px var(--line); font-weight: 700; }
.btn.small { padding: 7px 13px; font-size: 12.5px; }
.btn.danger { background: #FF6B8B; color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.icon-btn svg { width: 20px; height: 20px; }

/* banner carousel */
.banners { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.bnr { flex: 0 0 88%; scroll-snap-align: center; border-radius: 18px; padding: 14px 16px; min-height: 84px; display: flex; gap: 12px; align-items: center;
  font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1.3; color: #1A0F33; text-align: left; }
.bnr small { display: block; font-family: var(--body); font-weight: 500; font-size: 12px; opacity: .85; }
.bnr.holo { background: var(--holo); } .bnr.pink { background: linear-gradient(120deg, #FF9AE6, #FFC6F1); }
.bnr.violet { background: linear-gradient(120deg, #6C4CF5, #B99CFF); color: #fff; } .bnr.mint { background: linear-gradient(120deg, #7CF3C8, #BDF7FF); }
.bnr svg { width: 42px; height: 42px; flex: none; }

/* check-in + stats */
.checkin { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--glow); }
.checkin .gift { width: 44px; height: 44px; border-radius: 14px; background: var(--holo); display: grid; place-items: center; color: #1A0F33; flex: none; }
.checkin .gift svg { width: 24px; height: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { border-radius: 14px; padding: 10px 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); text-align: left; display: grid; gap: 0; }
.stat b { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 11.5px; color: var(--muted); }
.stat.hl { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); } .stat.hl span { color: inherit; opacity: .8; }

/* binder rows */
.binders { display: grid; gap: 12px; }
.binder { display: grid; grid-template-columns: 86px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 18px;
  background: var(--surface); box-shadow: var(--glow); position: relative; text-align: left; width: 100%; }
.cover { width: 84px; height: 100px; border-radius: 6px 11px 11px 6px; background: var(--holo); position: relative; transform: rotate(-6deg);
  box-shadow: -4px 4px 0 rgba(0,0,0,.18), inset 6px 0 0 rgba(255,255,255,.35); display: grid; place-items: center; text-align: center; overflow: hidden; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.55) 45%, transparent 60%); }
.cover b { font-family: var(--display); font-weight: 800; font-size: 11px; line-height: 1.15; color: #24164A; padding: 0 6px; position: relative; z-index: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cover.sm { width: 46px; height: 56px; transform: none; border-radius: 4px 7px 7px 4px; } .cover.sm b { font-size: 8px; }
.th-aurora { background: linear-gradient(140deg, #7CF3C8, #7CF3FF 45%, #B99CFF); }
.th-sunset { background: linear-gradient(140deg, #FFE38A, #FF9AE6 55%, #B99CFF); }
.th-mint { background: linear-gradient(140deg, #D6FFE9, #7CF3C8 60%, #BDF7FF); }
.th-galaxy { background: radial-gradient(circle at 30% 30%, #FF9AE6 0, transparent 35%), linear-gradient(140deg, #3A2170, #6C4CF5 55%, #7CF3FF); }
.th-galaxy b { color: #fff; }
.th-latte { background: linear-gradient(140deg, #F2DDC2, #C9A27A); } .th-matcha { background: linear-gradient(140deg, #DDEBC4, #8DB36A); }
.th-mocha { background: linear-gradient(140deg, #D9B7A0, #7A4E36); } .th-mocha b { color: #fff; }
.binder h4 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1.25; }
.binder .cnt { font-family: var(--display); font-weight: 600; font-size: 11.5px; color: var(--muted); margin: 3px 0 6px; font-variant-numeric: tabular-nums; }
.prog { height: 8px; border-radius: 9px; background: var(--track); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--prog); border-radius: 9px; }
.tags { position: absolute; top: -8px; right: 12px; display: flex; gap: 4px; }
.tag { font-family: var(--display); font-weight: 700; font-size: 9.5px; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px;
  background: var(--chip); color: var(--ink); box-shadow: 0 0 0 1px var(--line); white-space: nowrap; }
.tag.done { background: var(--good); color: var(--good-ink); box-shadow: none; }
.tag.lim { background: #FF9AE6; color: #4A0E3A; box-shadow: none; }
.tag.holo { background: var(--holo); color: #1A0F33; box-shadow: none; }
.tag.wait { background: var(--warn); color: var(--warn-ink); box-shadow: none; }

/* collectible card — fixed size */
.cc { width: var(--card-w); height: var(--card-h); border-radius: 12px; padding: 2.5px; position: relative; flex: none;
  background: linear-gradient(160deg, #D9DDE8, #9AA1B5); text-align: left; }
.cc.sr { background: linear-gradient(160deg, #FFE38A, #C99BFF); }
.cc.ssr { background: var(--holo); box-shadow: 0 0 16px -2px rgba(255,154,230,.75); }
.cc .in { width: 100%; height: 100%; border-radius: 9.5px; overflow: hidden; display: flex; flex-direction: column; background: var(--surface2); }
.cc .art { flex: 1; display: grid; place-items: center; position: relative; font-size: 40px; line-height: 1; }
.cc.ssr .art::after, .cc.foil .art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.5) 45%, transparent 60%); mix-blend-mode: overlay; }
.cc .lbl { font-family: var(--display); font-weight: 700; font-size: 9px; padding: 4px 5px; text-align: center; background: rgba(0,0,0,.32); color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc .lbl em { font-style: normal; color: #FFE38A; }
.cc .count { position: absolute; top: 6px; left: 6px; z-index: 2; font-family: var(--display); font-weight: 800; font-size: 10.5px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.badge-new { position: absolute; top: -7px; right: -7px; width: 32px; height: 32px; border-radius: 50%; background: var(--badge); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 8.5px; display: grid; place-items: center; transform: rotate(12deg);
  box-shadow: 0 0 0 2px rgba(255,255,255,.9); z-index: 3; }
.badge-foil { position: absolute; bottom: 24px; right: 5px; font-family: var(--display); font-weight: 800; font-size: 8px; padding: 1px 5px;
  border-radius: 999px; background: #0D3A2C; color: #7CF3C8; z-index: 2; }
.cc.lock { background: transparent; border: 1.5px dashed var(--line); padding: 0; }
.cc.lock .in { background: transparent; display: grid; place-items: center; align-content: center; color: var(--muted); font-family: var(--display);
  font-weight: 800; font-size: 26px; text-align: center; }
.cc.lock small { display: block; font-size: 9.5px; font-weight: 600; }
.cc.lock.can { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cc.lock.can .in { color: var(--accent); }
.cc.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.cc.dim { opacity: .35; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, var(--card-w)); justify-content: center; gap: 14px 12px; }
@media (prefers-reduced-motion: no-preference) {
  .cc.ssr { animation: shine 4s ease-in-out infinite; }
  @keyframes shine { 50% { box-shadow: 0 0 22px 0 rgba(124,243,255,.75); } }
  .pop-in { animation: pop .45s cubic-bezier(.2,1.6,.4,1) both; }
  @keyframes pop { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
}

/* list items */
.item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); text-align: left; width: 100%; }
.mini { display: inline-block; width: 32px; height: 45px; border-radius: 6px; padding: 1.5px; background: linear-gradient(160deg, #D9DDE8, #9AA1B5); flex: none; }
.mini.sr { background: linear-gradient(160deg, #FFE38A, #C99BFF); } .mini.ssr { background: var(--holo); }
.mini i { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 5px; font-style: normal; font-size: 18px; }
.who { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 13px;
  color: #2A1550; background: #BDF7FF; flex: none; }
.pill { font-family: var(--display); font-weight: 700; font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--good); color: var(--good-ink); white-space: nowrap; }
.pill.wait { background: var(--warn); color: var(--warn-ink); } .pill.off { background: var(--chip); color: var(--muted); }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); border-radius: var(--radius); border: 1.5px dashed var(--line); font-size: 14px; }

/* composer (trade) */
.composer { padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--glow); display: grid; gap: 12px; }
.swap { display: grid; grid-template-columns: var(--card-w) 1fr var(--card-w); align-items: center; justify-items: center; }
.swap .lab { font-family: var(--display); font-weight: 700; font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 5px; }
.swap .arr { width: 34px; height: 34px; color: var(--accent); }
.pick { width: var(--card-w); height: var(--card-h); border-radius: 12px; border: 1.5px dashed var(--accent); display: grid; place-items: center;
  color: var(--accent); font-family: var(--display); font-weight: 700; font-size: 12px; text-align: center; padding: 6px; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--nav); border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-right, 0px));
  backdrop-filter: blur(12px); }
.nav .in { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; text-align: center; font-size: 10.5px; color: var(--muted); }
.nav button { display: grid; justify-items: center; gap: 2px; padding: 4px 0; position: relative; }
.nav svg { width: 22px; height: 22px; }
.nav .on { color: var(--accent); font-weight: 600; }
.nav .scan { width: 54px; height: 54px; border-radius: 50%; background: var(--holo); color: #1A0F33; display: grid; place-items: center;
  margin: -24px auto 0; box-shadow: var(--glow); }
.nav .scan svg { width: 26px; height: 26px; }
.nav .dot::after { content: ""; position: absolute; top: 2px; right: 30%; width: 8px; height: 8px; border-radius: 50%; background: var(--badge); }

/* sheets / layers */
.layer { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(8,4,20,.55); }
.sheet { background: var(--sheet); color: var(--ink); border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh; overflow: auto;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; align-content: start;
  max-width: 520px; width: 100%; margin: 0 auto; box-shadow: 0 -10px 40px -10px rgba(0,0,0,.5); }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 2px auto 4px; }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-head .h { flex: 1; }
.full { position: fixed; inset: 0; z-index: 45; background: var(--bg); background-color: var(--bg-solid); overflow: auto; display: flex; flex-direction: column; }
.full .bar { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px; position: sticky; top: 0; z-index: 2;
  background: var(--bg-solid); }
.full .bar .h { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.full .body { padding: 4px 16px calc(110px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; align-content: start; max-width: 520px; width: 100%; margin: 0 auto; }
.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 46; width: 64px; height: 64px;
  border-radius: 50%; background: var(--surface2); box-shadow: var(--glow); display: grid; place-items: center; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 9.5px; line-height: 1.1; }
.fab b { display: block; font-size: 24px; line-height: 1; }

/* card view (appreciate the card) */
.cardview { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr auto; background: rgba(8,4,20,.92); color: #fff; }
.cardview .close { justify-self: end; margin: calc(12px + env(safe-area-inset-top, 0px)) 16px 0; }
.cardview .stage { display: grid; place-items: center; padding: 10px 24px; }
.bigcard { width: min(72vw, 300px); aspect-ratio: 5/7; border-radius: 22px; padding: 6px; background: linear-gradient(160deg, #D9DDE8, #9AA1B5); position: relative; }
.bigcard.sr { background: linear-gradient(160deg, #FFE38A, #C99BFF); } .bigcard.ssr { background: var(--holo); box-shadow: 0 0 40px -4px rgba(255,154,230,.8); }
.bigcard .in { height: 100%; border-radius: 17px; overflow: hidden; display: flex; flex-direction: column; background: #231849; }
.bigcard .art { flex: 1; display: grid; place-items: center; font-size: clamp(90px, 26vw, 140px); position: relative; }
.bigcard.ssr .art::after, .bigcard.foil .art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.5) 45%, transparent 60%); mix-blend-mode: overlay; }
.bigcard .lbl { padding: 12px 14px; background: rgba(0,0,0,.35); font-family: var(--display); }
.bigcard .lbl b { display: block; font-size: 20px; } .bigcard .lbl span { font-size: 13px; opacity: .8; }
.cardview .story { max-width: 420px; margin: 12px auto 0; padding: 0 20px; text-align: center; font-size: 14px; opacity: .85; }
.cardview .menu { display: flex; justify-content: center; gap: 10px; padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; }
.cardview .menu .btn.ghost { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; }

/* qr */
.qr { width: 220px; height: 220px; padding: 10px; border-radius: 18px; background: #fff; margin: 0 auto; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; display: block; }
.timer { font-family: var(--display); font-weight: 700; font-size: 12px; padding: 4px 12px; border-radius: 999px; background: var(--chip);
  font-variant-numeric: tabular-nums; justify-self: center; }
.code { font-family: var(--display); font-weight: 800; letter-spacing: .08em; font-size: 18px; }
video.cam { width: 100%; border-radius: 18px; background: #000; aspect-ratio: 1; object-fit: cover; }

/* achievements */
.ach { padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--glow); display: grid; gap: 10px; }
.ach h4 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 15px; }
.covers { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mc { width: 36px; height: 44px; border-radius: 3px 7px 7px 3px; background: var(--holo); position: relative; box-shadow: inset 3px 0 0 rgba(255,255,255,.35); }
.mc.no { background: var(--surface2); box-shadow: inset 0 0 0 1.5px var(--line); }
.mc .ok { position: absolute; bottom: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--good); color: var(--good-ink);
  font-size: 10px; display: grid; place-items: center; font-weight: 800; }
.reward { margin-left: auto; display: grid; justify-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); text-align: center; max-width: 110px; }

/* misc */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80;
  background: #170D30; color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  max-width: min(92vw, 440px); text-align: center; }
.toast.err { background: #5A1230; }
.reveal { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 6px 0 4px; }
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 8px; }
.themes button { border-radius: 14px; padding: 10px 8px; display: grid; gap: 4px; justify-items: center; background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-family: var(--display); font-weight: 700; font-size: 12.5px; text-align: center; }
.themes button small { font-family: var(--body); font-weight: 500; font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.themes button i { width: 100%; height: 34px; border-radius: 10px; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.themes .on { box-shadow: 0 0 0 2.5px var(--accent); }
.frames { display: flex; gap: 14px; flex-wrap: wrap; }
.frames button { display: grid; gap: 4px; justify-items: center; font-size: 11px; color: var(--muted); }
.frames button.on .ava { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.frames button[disabled] { opacity: .35; }
.onboard { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 20px; }
.onboard .box { max-width: 400px; width: 100%; display: grid; gap: 16px; text-align: center; }
.onboard .mark { width: 120px; height: 120px; margin: 0 auto; }
.consent { text-align: left; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.consent input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.note { font-size: 12px; color: var(--muted); text-align: center; }
.hr { height: 1px; background: var(--line); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, var(--card-w)); justify-content: center; gap: 14px 12px; }
.tray { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }

/* layout fixes (phone width) */
.top > button { flex: none; }
.nav button span { white-space: nowrap; font-size: 10px; }
.checkin b { font-size: 14px; line-height: 1.35; display: block; }
.checkin .btn { flex: none; }
.stat span { line-height: 1.3; }
.bnr { font-size: 14px; }

/* "รับการ์ดเพิ่ม" — ways to get cards (mockup v3.2) */
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.way { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); text-align: center; }
.way .ic { width: 42px; height: 42px; border-radius: 14px; background: var(--holo); color: #1A0F33; display: grid; place-items: center; }
.way .ic svg { width: 22px; height: 22px; }
.way b { font-family: var(--display); font-size: 12.5px; line-height: 1.2; }
.way .s { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.way.done .ic { background: var(--surface2); color: var(--muted); }

/* card frames (Market: stamp / holo / polaroid) */
.cc.f-stamp .in { outline: 3px dotted rgba(255,255,255,.85); outline-offset: -4px; }
.cc.f-polaroid { background: #fff; padding: 4px 4px 14px; }
.cc.f-holo { background: var(--holo); }
.cc .art img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- banner carousel (slow slide) ---------- */
.bn-wrap { position: relative; overflow: hidden; border-radius: 18px; touch-action: pan-y; }
.bn-track { display: flex; transition: transform 1.4s cubic-bezier(.45, 0, .15, 1); will-change: transform; }
.bn-slide { flex: 0 0 100%; min-width: 0; display: flex; }
.bn-slide .bnr { flex: 1 1 auto; width: 100%; text-align: left; }
.bn-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.bn-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: width .5s, background .5s; }
.bn-dots i.on { width: 18px; background: var(--accent); }

/* ---------- card view: flip front / back ---------- */
.flip { width: min(72vw, 300px); aspect-ratio: 5 / 7; perspective: 1200px; margin: 0 auto; cursor: pointer; outline: none; }
.flip:focus-visible { box-shadow: 0 0 0 3px var(--accent); border-radius: 22px; }
.flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.3, .7, .2, 1); }
.flip.on .flip-in { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .face .bigcard { width: 100%; height: 100%; aspect-ratio: auto; }
.flip .face.back { transform: rotateY(180deg); border-radius: 22px; padding: 22px 20px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
  background: linear-gradient(160deg, #2E1E5E, #140C2E); color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.16), 0 30px 60px rgba(0,0,0,.5); }
.flip .face.back.sr { box-shadow: inset 0 0 0 3px #FFE38A, 0 30px 60px rgba(0,0,0,.5); }
.flip .face.back.ssr { box-shadow: inset 0 0 0 3px #FF9AE6, 0 0 40px -4px rgba(255,154,230,.8); }
.bk-title { font-family: var(--display); font-size: 22px; }
.bk-story { font-size: 15px; line-height: 1.75; flex: 1; }
.bk-meta { font-size: 12.5px; opacity: .75; border-top: 1px solid rgba(255,255,255,.16); padding-top: 10px; }
.bigcard .art img, .cc .art img { width: 100%; height: 100%; object-fit: cover; }
.cardview .hint { text-align: center; font-size: 12px; opacity: .6; margin-top: 12px; }

/* ---------- sticking: drag from the hand onto a glowing slot ---------- */
.full .body.with-dock { padding-bottom: 16px; }
.dock { position: sticky; bottom: 0; z-index: 3; margin-top: auto; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg-solid) 72%, transparent); }
.dock .hand { display: flex; gap: 12px; overflow-x: auto; padding: 8px 2px 4px; scrollbar-width: none; max-width: 520px; margin: 0 auto; }
.dock .tiny { text-align: center; }
.hand-card { flex: none; touch-action: pan-x; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; transition: transform .2s, opacity .2s; }
.hand-card:active { cursor: grabbing; }
.hand-card.lifted { opacity: .35; transform: scale(.92); }
.drag-ghost { position: fixed; z-index: 999; pointer-events: none; margin: 0; transform: translate(-50%, -62%) rotate(-6deg) scale(1.12);
  box-shadow: 0 24px 48px rgba(0,0,0,.55); }
.drag-ghost.fly { transition: left .26s cubic-bezier(.5, 0, .75, 0), top .26s cubic-bezier(.5, 0, .75, 0), transform .26s; transform: translate(-50%, -50%) rotate(0) scale(1); }
.drag-ghost.home { transition: left .3s ease, top .3s ease, transform .3s, opacity .3s; transform: translate(-50%, -50%) scale(.9); opacity: 0; }
.drop { border-radius: 12px; transition: transform .15s, opacity .2s; }
.drop.hot .cc.lock { border-color: var(--accent); animation: glowpulse 1.4s ease-in-out infinite; }
body.is-dragging .drop:not(.hot) { opacity: .4; }
.drop.over { transform: scale(1.1); }
.drop.over .cc.lock { background: color-mix(in srgb, var(--accent) 24%, transparent); }
@keyframes glowpulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 28%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); } }
.slam { position: relative; }
.slam .cc { animation: slam .55s cubic-bezier(.2, 1.6, .4, 1); }
.slam::after { content: ""; position: absolute; inset: -6px; border-radius: 16px; border: 2px solid var(--accent); pointer-events: none; animation: ring .7s ease-out forwards; }
@keyframes slam { from { transform: scale(1.5) rotate(-10deg); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } to { transform: none; } }
@keyframes ring { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 998; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  .bn-track, .flip-in, .drag-ghost.fly, .drag-ghost.home { transition: none; }
  .slam .cc, .slam::after, .drop.hot .cc.lock { animation: none !important; }
  .confetti { display: none; }
}
.dock .hand > :first-child { margin-left: auto; }
.dock .hand > :last-child { margin-right: auto; }

/* round 01 — daily loop (streak + 7-day map + missions), PDPA error, near-complete */
.streak, .missions { margin: 12px 0; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); display: grid; gap: 10px; }
.streak .fire { font-size: 30px; line-height: 1; filter: drop-shadow(0 0 8px rgba(255,140,60,.6)); }
.sdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sd { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line); }
.sd b { font-size: 14px; }
.sd small { font-size: 10px; opacity: .75; }
.sd.on { background: linear-gradient(135deg, #FF9A5A, #FF5E8A); color: #fff; box-shadow: none; }
.sd.today { box-shadow: inset 0 0 0 2px #FFE38A; }
.sd.seven { background: var(--holo); color: #1A0F33; box-shadow: none; }
.sd.seven.on { outline: 2px solid #FFE38A; }
.mrow { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.mrow .mk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line); font-size: 13px; flex: none; }
.mrow.done .mk { background: var(--good, #4ADE80); color: #0E0820; box-shadow: none; }
.mrow.done .grow { opacity: .7; text-decoration: line-through; }
.ferr { color: #FF9AB3; font-size: 13px; margin-top: -4px; text-align: left; }
.btile .s b { color: var(--near-em, #FFE38A); }

/* round 02: pull-back nudges + welcome gift on the shop-QR path */
.atrisk { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 12px 14px; border: 0; border-radius: 18px; text-align: left; color: inherit;
  background: linear-gradient(110deg, rgba(255, 122, 69, .28), rgba(255, 154, 230, .22)); box-shadow: 0 0 0 1.5px rgba(255, 140, 90, .8); animation: atrisk-pulse 2.4s ease-in-out infinite; }
.atrisk b { display: block; font-size: 14px; line-height: 1.3; }
.atrisk small { display: block; font-size: 12px; opacity: .8; }
.atrisk .fire { font-size: 26px; }
.atrisk .btn { pointer-events: none; flex: none; }
@keyframes atrisk-pulse { 50% { box-shadow: 0 0 0 3px rgba(255, 140, 90, .45); } }
@media (prefers-reduced-motion: reduce) { .atrisk { animation: none; } }
.linebar { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 12px; border-radius: 16px; background: rgba(6, 199, 85, .12); box-shadow: 0 0 0 1px rgba(6, 199, 85, .45); }
.linebar .btn, .item .btn[data-a="line-on"] { background: #06C755; color: #fff; flex: none; }
.welcome-gift { margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; font-size: 14px; background: linear-gradient(110deg, rgba(124, 243, 255, .2), rgba(255, 227, 138, .2)); box-shadow: 0 0 0 1px rgba(255, 227, 138, .55); }
.next-step { margin: 6px 0; font-size: 14px; line-height: 1.4; }
.steps { margin: 4px 0 6px; padding-left: 20px; display: grid; gap: 2px; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.steps li.now { font-weight: 600; }
.spin { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -1px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
