/* CardPet — 配色取自阿龍本貓:奶油白毛、海豹棕、藍眼睛、粉紅鼻子 */
:root {
  --bg: #FBF7F0;
  --card: #FDF6EA;
  --ink: #3E2E25;
  --ink-soft: #8A7A6E;
  --point: #5E4636;
  --blue: #C97B5B;
  --blue-deep: #A85D40;
  --pink: #E8A5AC;
  --gold: #DCA53E;
  --line: #EDE3D4;
  --r-n: #A79B8E;
  --r-r: #4E7FBF;
  --r-sr: #9C6BD1;
  --r-ssr: #DCA53E;
  --radius: 18px;
  /* 雙層陰影:近距離銳利(髮絲級)+ 遠距離柔和(景深) */
  --shadow: 0 1px 2px rgba(94, 70, 54, 0.07), 0 12px 26px -10px rgba(94, 70, 54, 0.22);
  --hairline: 1px solid rgba(94, 70, 54, 0.06);
  --font-display: ui-serif, "New York", "Songti TC", serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: ui-rounded, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  /* 環境光:頂部一層極淡暖光暈,頁面不再死平 */
  background-color: var(--bg);
  background-image: radial-gradient(130% 420px at 50% -60px, #F6EBD9 0%, rgba(246, 235, 217, 0) 100%);
  background-repeat: no-repeat;
  color: var(--ink);
  min-height: 100dvh;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
#view { flex: 1; padding: 20px 18px calc(86px + env(safe-area-inset-bottom)); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: var(--ink); }
a { color: var(--blue-deep); }

/* 雜誌感標題:襯線展示字體 */
h1.page-title { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: 0.01em; margin-bottom: 14px; }
.eyebrow { font-size: 11px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.1em; text-transform: uppercase; }

/* 質感髮絲框 + 雙層陰影,套用在所有卡片型容器 */
.stat, .exp-panel, .card-item, .detail-head, .detail-rows, .notes-box,
.quick-acts a, .quick-acts .qa-btn, .dex-cell, .ach-item, .album-pic,
.preview-img, .photo-slot, .reveal-card {
  border: var(--hairline);
}

/* 可點擊卡片/格子的按壓微互動 */
.card-item, .album-pic, .quick-acts a, .quick-acts .qa-btn, .ach-item {
  transition: transform 0.12s ease;
}
.card-item:active, .quick-acts a:active, .quick-acts .qa-btn:active { transform: scale(0.98); }
.album-pic:active { transform: scale(0.96); }

/* 頁面切換淡入 */
@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}
#view.fade-in { animation: view-fade-in 0.22s cubic-bezier(0.22, 0.61, 0.36, 1); }

/* ── 首頁:阿龍的窩 ── */
.cat-scene {
  position: relative;
  border-radius: 28px;
  padding: 0 0 6px;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
/* 阿龍身後的柔光,精品陳列感 */
.cat-scene::before {
  content: ''; position: absolute; top: 4%; left: 50%; transform: translateX(-50%);
  width: 320px; height: 320px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(220, 165, 62, 0.20), rgba(220, 165, 62, 0) 68%);
}
.alon-img {
  width: 100%; max-width: 340px; aspect-ratio: 3 / 4; object-fit: cover;
  display: block; margin: 0 auto; border-radius: 24px;
  /* 雙層框:髮絲畫框圈 + 近距離銳利陰影 + 遠距離柔和陰影 */
  box-shadow: 0 0 0 1px rgba(94, 70, 54, 0.09), 0 4px 10px rgba(94, 70, 54, 0.16), 0 20px 40px -14px rgba(94, 70, 54, 0.34);
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.alon-img.poke-bounce { animation: poke-bounce 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes poke-bounce { 0% { transform: scale(1); } 35% { transform: scale(0.96) rotate(-1deg); } 65% { transform: scale(1.03) rotate(1deg); } 100% { transform: scale(1); } }
.stage-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-top: 10px; }
.stage-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; padding-bottom: 12px; }

.poke-heart {
  position: absolute; top: 34%; font-size: 26px; pointer-events: none;
  animation: heart-up 1.2s ease-out forwards;
}
@keyframes heart-up { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-56px) scale(1.15); } }
.treat-drop {
  position: absolute; top: 6%; left: 50%; font-size: 32px; pointer-events: none;
  animation: treat-fall 1.3s cubic-bezier(.5,0,.6,1) forwards;
}
@keyframes treat-fall { 0% { opacity: 0; transform: translate(-50%, 0); } 20% { opacity: 1; } 75% { opacity: 1; transform: translate(-50%, 130px) scale(0.9); } 100% { opacity: 0; transform: translate(-50%, 140px) scale(0.4); } }

/* 統計列 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 8px; text-align: center;
}
.stat b { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; display: block; }
.stat span { font-size: 11.5px; color: var(--ink-soft); }

.exp-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-top: 12px; }
.exp-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.exp-row .lv { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; }
.exp-row .nums { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.exp-bar { height: 12px; background: #F1E8DA; border-radius: 999px; margin-top: 8px; overflow: hidden; }
.exp-fill {
  position: relative; height: 100%; border-radius: 999px; transition: width 0.6s ease;
  background: linear-gradient(90deg, #C97B5B, #DCA53E);
}
.exp-fill::before {
  content: ''; position: absolute; top: 1px; left: 2px; right: 2px; height: 3px;
  background: rgba(255, 255, 255, 0.55); border-radius: 999px;
}
/* 流光:每 3 秒一道柔光掃過進度條 */
.exp-fill::after {
  content: ''; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
  background-size: 220% 100%;
  animation: sheen 3s ease-in-out infinite;
}
@keyframes sheen { 0% { background-position: 180% 0; } 55%, 100% { background-position: -80% 0; } }

.scan-cta {
  display: block; width: 100%; margin-top: 16px;
  background: linear-gradient(180deg, #D68A67, var(--blue-deep)); color: #fff;
  font-size: 17px; font-weight: 800; letter-spacing: 0.04em;
  padding: 16px; border-radius: 999px;
  box-shadow: 0 8px 20px -4px rgba(168, 93, 64, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.scan-cta:active { transform: scale(0.97); box-shadow: 0 4px 10px -2px rgba(168, 93, 64, 0.4); }
.fed-note { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; }

/* ── 名片列表 ── */
.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-row input {
  flex: 1; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 10px 16px; outline: none;
}
.search-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(201, 123, 91, 0.14); }
.chip-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 13px; padding: 6px 13px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line); color: var(--ink-soft);
}
.chip.on { background: var(--point); border-color: var(--point); color: #fff; font-weight: 700; }

.card-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 15px; margin-bottom: 10px; text-decoration: none; color: inherit;
  position: relative;
}
.card-item .avatar {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  background: #F1E8DA; color: var(--point);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
}
/* 頭像暖色漸層,依姓名輪換 5 組 */
.avatar.av-0 { background: linear-gradient(135deg, #F4E3CE, #E8CBA8); color: #8A5A33; }
.avatar.av-1 { background: linear-gradient(135deg, #F6DDD4, #EBB9A8); color: #9C4F33; }
.avatar.av-2 { background: linear-gradient(135deg, #EDE7D2, #D3C9A4); color: #6E663D; }
.avatar.av-3 { background: linear-gradient(135deg, #F0DEE0, #DFB9BF); color: #94555E; }
.avatar.av-4 { background: linear-gradient(135deg, #E6E3D6, #C5C4B2); color: #5F604F; }

/* 骨架屏:載入時的微光佔位 */
.skel-item {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: var(--hairline); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px;
}
.skel-av { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; }
.skel-lines { flex: 1; }
.skel-line { height: 12px; border-radius: 6px; }
.skel-line + .skel-line { margin-top: 8px; }
.skel-line.w60 { width: 60%; } .skel-line.w35 { width: 35%; }
.skel-av, .skel-line {
  background: linear-gradient(90deg, #F1E8DA 25%, #FAF3E7 45%, #F1E8DA 65%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.card-item .info { flex: 1; min-width: 0; }
.card-item .nm { font-weight: 800; font-size: 15.5px; }
.card-item .co { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rarity-tag {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; color: #fff;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.06em;
}
.rarity-N { background: var(--r-n); } .rarity-R { background: var(--r-r); }
/* SR/SSR 燙金質感:漸層底色,subtle 不俗豔 */
.rarity-SR { background: linear-gradient(135deg, #9C6BD1, #C9A24E); }
.rarity-SSR { background: linear-gradient(135deg, #F0C368, #B8860B); color: #4A2F0D; }

.empty-note { text-align: center; color: var(--ink-soft); padding: 48px 20px; font-size: 14px; line-height: 1.9; }

/* ── 掃描/表單 ── */
.photo-drop {
  border: 2px dashed #D8C9B4; border-radius: var(--radius); background: var(--card);
  padding: 40px 20px; text-align: center; color: var(--ink-soft); font-size: 14px; line-height: 1.9;
}
.photo-drop b { color: var(--ink); font-size: 16px; }
.preview-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.photo-fold { margin-bottom: 12px; }
.photo-fold > summary {
  list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; gap: 6px;
  background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius);
  padding: 13px 16px; font-size: 14px; font-weight: 700; color: var(--ink-soft);
}
.photo-fold > summary::-webkit-details-marker { display: none; }
.photo-fold > summary::after { content: '›'; margin-left: auto; font-size: 20px; transition: transform 0.2s ease; }
.photo-fold[open] > summary { border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 8px; }
.photo-fold[open] > summary::after { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .photo-fold > summary::after { transition: none; } }
.photo-slot {
  width: 100%; height: 120px; border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); margin-bottom: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 13px;
}
.crop-toggle {
  display: block; width: 100%; margin: -4px 0 14px;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 9px 12px;
}
.ocr-status { text-align: center; padding: 18px; color: var(--ink-soft); font-size: 14px; }
.ocr-status .spin { display: inline-block; animation: spin 1.1s linear infinite; font-size: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-grid { display: grid; gap: 10px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); background: var(--card);
  border-radius: 12px; padding: 10px 12px; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(201, 123, 91, 0.14); }
.field textarea { min-height: 70px; resize: vertical; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-primary {
  background: linear-gradient(180deg, #D68A67, var(--blue-deep));
  color: #fff; font-weight: 800; font-size: 16px;
  padding: 14px; border-radius: 999px; width: 100%; margin-top: 14px;
  box-shadow: 0 6px 16px -4px rgba(168, 93, 64, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary:active { transform: scale(0.98); box-shadow: 0 3px 8px -2px rgba(168, 93, 64, 0.35); }
.btn-primary:disabled { opacity: 0.5; }
.btn-ghost {
  width: 100%; padding: 12px; margin-top: 8px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-soft); font-weight: 700;
}
.btn-danger { color: #C0554F; border-color: #EAD2D0; }

/* ── 詳情 ── */
.back-btn {
  font-size: 14px; font-weight: 700; color: var(--ink-soft);
  padding: 6px 4px; margin-bottom: 10px; display: inline-block;
}
.detail-head { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; margin-bottom: 12px; }
.detail-head .nm { font-size: 22px; font-weight: 800; }
.detail-head .ti { color: var(--ink-soft); margin-top: 3px; font-size: 14px; }
.detail-rows { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.d-row { display: flex; padding: 13px 16px; border-bottom: 1px solid #F5EEE2; font-size: 14px; gap: 12px; }
.d-row:last-child { border-bottom: none; }
.d-row .k { flex: 0 0 62px; color: var(--ink-soft); font-size: 12.5px; padding-top: 1px; }
.d-row .v { flex: 1; word-break: break-all; }
.quick-acts { display: flex; gap: 10px; margin-bottom: 12px; }
.quick-acts a, .quick-acts .qa-btn {
  flex: 1; text-align: center; background: var(--card); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 12px 6px; text-decoration: none;
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.quick-acts .qa-btn { border: none; }

/* 列表工具列:排序 + 清除篩選 */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sort-select { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sort-select select {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: 13px; outline: none;
}
.sort-select select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(201, 123, 91, 0.14); }
.clear-filter {
  font-size: 12.5px; font-weight: 700; color: #C0554F;
  border: 1.5px solid #EAD2D0; background: var(--card); border-radius: 999px; padding: 7px 12px;
}
.filter-banner {
  background: #EEF3FA; border: 1.5px solid #D7E3F2; color: var(--blue-deep);
  border-radius: 12px; padding: 9px 14px; font-size: 13.5px; margin-bottom: 10px;
}
.list-count { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; padding-left: 2px; }

/* 詳情:看同公司 */
.btn-company { color: var(--blue-deep); border-color: #D7E3F2; }

/* 詳情:快速備註 */
.notes-box {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 15px; margin-bottom: 12px;
}
.notes-label { font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.notes-label span { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.notes-box textarea {
  width: 100%; min-height: 84px; resize: vertical;
  border: 1.5px solid var(--line); background: #FCFAF6; border-radius: 12px;
  padding: 10px 12px; outline: none; font: inherit; color: var(--ink);
}
.notes-box textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(201, 123, 91, 0.14); }
.notes-save { margin-top: 10px; }

/* 圖鑑格子可點 */
.dex-cell.lit { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dex-cell.lit:active { transform: scale(0.96); }

/* ── 圖鑑與成就 ── */
.dex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 22px; }
.dex-cell {
  aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; position: relative; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); font-size: 12px; font-weight: 700;
}
.dex-cell .cnt { font-size: 10.5px; color: var(--ink-soft); font-weight: 400; }
.dex-cell.off { background: #F2ECE1; box-shadow: none; color: #C4B8A6; }
.dex-cell.lit { border: 2px solid var(--gold); }
.dex-icon { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dex-cell.lit .cnt {
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9); border-radius: 999px; padding: 1px 8px;
  color: var(--ink); white-space: nowrap;
}
.ach-item {
  display: flex; align-items: center; gap: 13px; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 15px; margin-bottom: 9px;
}
.ach-item.locked { opacity: 0.45; filter: grayscale(1); box-shadow: none; }
.ach-item .ic { font-size: 26px; }
.ach-item .t { font-weight: 800; font-size: 14.5px; }
.ach-item .d { font-size: 12px; color: var(--ink-soft); }

/* ── 阿龍畫冊 ── */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 22px; }
.album-pic {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px;
  box-shadow: var(--shadow); background: var(--card);
}
.album-locked {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: #F2ECE1; box-shadow: none; color: #C4B8A6;
}
.album-pic { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.album-seasonal { display: flex; flex-direction: column; gap: 4px; }
.seasonal-tag { font-size: 11px; color: var(--ink-soft, #8A7B68); text-align: center; }

/* ── 畫冊大圖 lightbox ── */
.lightbox { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(90vw, 380px); }
.lightbox-img { width: 100%; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.lightbox-close { width: auto; padding: 10px 28px; }
.lightbox-nav { display: flex; align-items: center; gap: 14px; }
.lb-arrow {
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.9); color: var(--blue-deep);
  font-size: 26px; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lb-arrow:disabled { opacity: 0.3; cursor: default; }
.lb-arrow:active:not(:disabled) { transform: scale(0.92); }

/* ── Tab bar:毛玻璃 ── */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(253, 247, 238, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-top: 1px solid rgba(94, 70, 54, 0.08);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tab-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; }
.tab {
  flex: 1; text-align: center; font-size: 10.5px; color: var(--ink-soft);
  text-decoration: none; padding: 4px 0; font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.tab .ic { display: flex; justify-content: center; margin-bottom: 2px; }
.tab .ic svg {
  width: 23px; height: 23px; stroke-width: 1.8; box-sizing: content-box;
  padding: 2px 10px; border-radius: 999px;
  transition: stroke-width 0.15s ease, background-color 0.2s ease;
}
.tab.on { color: var(--blue-deep); }
/* 選中的 tab:icon 後面亮起暖色膠囊 */
.tab.on .ic svg { stroke-width: 2.3; background-color: rgba(201, 123, 91, 0.14); }
.tab-scan {
  flex: 0 0 74px; height: 58px; margin-top: -26px;
  background: linear-gradient(160deg, var(--blue), var(--blue-deep));
  border-radius: 50% / 46%;
  box-shadow: 0 8px 18px -4px rgba(168, 93, 64, 0.5), 0 0 0 4px var(--bg);
  color: #fff;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tab-scan:active { transform: scale(0.94); box-shadow: 0 4px 10px -2px rgba(168, 93, 64, 0.45), 0 0 0 4px var(--bg); }
.tab-scan svg { width: 26px; height: 26px; }

/* ── 開卡動畫 ── */
#overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(46, 34, 26, 0.86); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px;
}
#overlay.show { display: flex; }
.reveal-card {
  width: min(88vw, 340px); background: var(--card); border-radius: 22px;
  padding: 26px 22px; text-align: center;
  animation: card-in 0.55s cubic-bezier(0.2, 1.4, 0.5, 1);
  position: relative; overflow: hidden;
}
/* 開卡瞬間一道斜掃光,精品開箱感 */
.reveal-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%);
  transform: translateX(-130%);
  animation: shine-sweep 1s ease 0.5s forwards;
}
@keyframes shine-sweep { to { transform: translateX(130%); } }
@keyframes card-in { 0% { transform: rotateY(90deg) scale(0.7); opacity: 0; } 100% { transform: rotateY(0) scale(1); opacity: 1; } }
.reveal-card.glow-SSR { box-shadow: 0 0 60px 12px rgba(220, 165, 62, 0.75); }
.reveal-card.glow-SR { box-shadow: 0 0 50px 10px rgba(156, 107, 209, 0.65); }
.reveal-card.glow-R { box-shadow: 0 0 40px 8px rgba(78, 127, 191, 0.5); }
.reveal-rarity { font-size: 34px; font-weight: 900; letter-spacing: 0.12em; }
.reveal-rarity.c-N { color: var(--r-n); } .reveal-rarity.c-R { color: var(--r-r); }
.reveal-rarity.c-SR { color: var(--r-sr); } .reveal-rarity.c-SSR { color: var(--r-ssr); }
.reveal-name { font-size: 19px; font-weight: 800; margin-top: 8px; }
.reveal-co { font-size: 13px; color: var(--ink-soft); }
.reward-lines { margin-top: 14px; display: grid; gap: 6px; }
.reward-lines div {
  font-size: 13.5px; background: #FBF6EC; border-radius: 10px; padding: 8px;
  animation: pop-in 0.4s ease backwards;
}
.reward-lines div:nth-child(2) { animation-delay: 0.15s; }
.reward-lines div:nth-child(3) { animation-delay: 0.3s; }
.reward-lines div:nth-child(4) { animation-delay: 0.45s; }
.reward-lines div:nth-child(5) { animation-delay: 0.6s; }
@keyframes pop-in { 0% { transform: scale(0.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.churu-banner {
  margin-top: 14px; background: linear-gradient(120deg, #FDEFF1, #FCE3E7);
  border-radius: 14px; padding: 12px; font-weight: 800; color: #B3565E; font-size: 15px;
}
.churu-banner .tube { display: inline-block; animation: lick 0.8s ease-in-out infinite; }
@keyframes lick { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg) translateY(-2px); } }

.confetti { position: fixed; top: -10px; font-size: 18px; z-index: 101; pointer-events: none; animation: conf-fall linear forwards; }
@keyframes conf-fall { to { transform: translateY(105vh) rotate(540deg); } }

/* ── 登入 / Face ID 解鎖:精品開場頁 ── */
#login-view {
  min-height: 100dvh; width: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px; text-align: center;
}
.login-glow { position: relative; display: inline-block; }
.login-glow::before {
  content: ''; position: absolute; inset: -34px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 123, 91, 0.32), rgba(201, 123, 91, 0) 68%);
  filter: blur(2px);
}
#login-view .alon-img { width: 220px; max-width: 220px; aspect-ratio: 3 / 4; }
#login-view h1 {
  font-family: var(--font-display); letter-spacing: -0.01em;
  font-size: 28px; font-weight: 700; margin: 16px 0 4px;
}
#login-view p { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 22px; }
#login-view input {
  width: 100%; max-width: 300px; text-align: center;
  border: var(--hairline); background: var(--card);
  border-radius: 20px; padding: 14px 16px; outline: none; margin-bottom: 12px;
  box-shadow: var(--shadow); transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
#login-view input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(201, 123, 91, 0.16); }
#login-view button { width: 100%; max-width: 300px; }
.login-err { color: #C0554F; font-size: 13px; margin-top: 10px; min-height: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
