/* =========================================================
   推しコレ スタイル
   色・文字・角丸は Cute Design System（ミヤマグラフィックス）に合わせています
   ========================================================= */
:root {
  --ink: #111111; --cream: #F7F3EF; --paper: #F1EDE8; --white: #FFFFFF;
  --yellow: #FFE59A; --yellow-strong: #FFD95A; --pink: #FFB5C1; --mint: #B7E1D1; --mint-strong: #5DBB8F; --sky: #A9D3FF;
  --gray-100: #EDEAE6; --gray-200: #DEDAD5; --gray-400: #A8A39D; --gray-600: #6B6762; --gray-800: #3A3835;
  --font-sans: 'M PLUS Rounded 1c', 'Noto Sans JP', 'Hiragino Maru Gothic ProN', sans-serif;
  --nav-h: 84px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-sans); letter-spacing: .04em; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
input, select { font-family: var(--font-sans); }
input::placeholder { color: var(--gray-400); }
a { color: var(--ink); }
.ic { display: inline-block; flex: none; vertical-align: middle; }

/* ---------- 画面の枠（PCでは真ん中にスマホ幅で出す） ---------- */
#app { position: relative; max-width: 480px; height: 100%; margin: 0 auto; background: var(--cream); overflow: hidden; }
@media (min-width: 520px) { #app { border-left: 1px solid var(--gray-200); border-right: 1px solid var(--gray-200); } }
/* 画面は position を付けないので、中のポップアップや横から出る画面は #app いっぱいに広がります */
.screen { height: calc(100% - var(--nav-h) - var(--safe-b)); display: flex; flex-direction: column; padding-top: var(--safe-t); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.pad > * { flex: none; }
.with-bar { padding-bottom: 100px; }

/* ---------- 見出し ---------- */
.head { display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 4px 16px 0; flex: none; }
.head .back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-left: -8px; }
.head .title { font-size: 20px; font-weight: 700; letter-spacing: .06em; }
.head .title.sm { font-size: 17px; }
.head .sub { font-size: 12px; color: var(--gray-600); margin-left: 6px; }
.head .right { margin-left: auto; }
.icon-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.muted { color: var(--gray-600); }
.small { font-size: 12px; }
.tiny { font-size: 11px; line-height: 1.6; color: var(--gray-600); }
.label { font-size: 12px; font-weight: 700; color: var(--gray-600); letter-spacing: .06em; padding: 0 4px; }
.press { transition: transform 160ms; }
.press:active { transform: scale(.97); }

/* ---------- 下のメニュー ---------- */
.nav { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding: 6px 4px var(--safe-b); background: var(--white); border-top: 1px solid var(--gray-200); display: flex; justify-content: space-around; align-items: flex-start; z-index: 20; }
.nav a { width: 62px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--gray-600); text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.nav a.on { color: var(--ink); }
.nav .pill { width: 52px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.nav a.on .pill { background: var(--yellow); }
.nav .center { width: 48px; height: 34px; border-radius: 999px; background: var(--ink); color: var(--white); display: flex; align-items: center; justify-content: center; }

/* ---------- カード（トレカ・グッズの写真タイル） ---------- */
.tile { position: relative; width: 100%; aspect-ratio: 55/85; border-radius: 10px; overflow: hidden; border: 1px solid rgba(17,17,17,.08); container-type: inline-size; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: rgba(17,17,17,.42); }
.tile .ph b { font-size: 11px; letter-spacing: .04em; }
.tile .ph span { font-size: 9px; letter-spacing: .08em; }
.tile .fade { position: absolute; inset: 0; background: rgba(247,243,239,.74); }
.tile .trading { position: absolute; top: 0; left: 0; width: 54%; aspect-ratio: 1; background: rgba(17,17,17,.72); clip-path: polygon(0 0,100% 0,0 100%); }
.tile .trading div { position: absolute; top: 0; left: 0; width: 64%; height: 64%; display: flex; align-items: center; justify-content: center; }
.tile .trading span { transform: rotate(-45deg); font-size: 10cqw; font-weight: 700; color: var(--white); white-space: nowrap; letter-spacing: .04em; line-height: 1; }
.tile .multi { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; background: var(--white); color: var(--gray-800); font-size: 11px; font-weight: 700; line-height: 1.3; white-space: nowrap; border-radius: 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 > * { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform 160ms; }
.grid3 > *:active { transform: scale(.96); }
.cap { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 白い角丸のかたまり ---------- */
.panel { background: var(--white); border-radius: 20px; }
.row-card { min-height: 64px; display: flex; align-items: center; gap: 14px; background: var(--white); border-radius: 20px; padding: 0 16px 0 10px; text-decoration: none; color: inherit; }
.row-card:active { transform: scale(.98); }
.cat-ic { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.blob { width: 48px; height: 48px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; gap: 7px; }
.blob i { width: 5px; height: 8px; border-radius: 50%; background: var(--ink); }
.bar { width: 100%; max-width: 160px; height: 6px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--mint-strong); border-radius: 999px; }
.oshi { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--ink); color: var(--white); letter-spacing: .04em; }

/* ---------- ボタン ---------- */
.btn { height: 52px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; letter-spacing: .06em; user-select: none; transition: transform 160ms, background 160ms; }
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-line { border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); }
.btn-big { height: 56px; }
.chip { flex: none; height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--white); color: var(--ink); border: 1px solid var(--gray-200); }
.chip.on { background: var(--ink); color: var(--white); }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.pill-btn { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 999px; font-size: 13px; font-weight: 700; user-select: none; }
.pill-btn:active { transform: scale(.97); }
.badge { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--yellow-strong); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.link { font-size: 13px; font-weight: 700; padding: 10px 4px; border-bottom: 1px solid var(--ink); align-self: flex-start; }
.add-plus { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; min-height: 44px; padding: 0 4px; }
.add-plus .y { width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); display: flex; align-items: center; justify-content: center; flex: none; }
.yellow-plus { flex: none; width: 56px; height: 48px; border-radius: 999px; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.yellow-plus:active { transform: scale(.95); }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gray-200); background: var(--white); display: flex; align-items: center; justify-content: center; flex: none; }
.round.sm { width: 40px; height: 40px; }
.round:active { transform: scale(.92); }
.seg { display: flex; background: var(--white); border: 1px solid var(--gray-200); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { width: 48px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: var(--gray-600); }
.seg button.on { background: var(--ink); color: var(--white); }

/* ---------- 入力 ---------- */
.field { height: 52px; width: 100%; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--white); padding: 0 14px; font: 500 15px var(--font-sans); color: var(--ink); outline: none; }
.field:focus { border-color: var(--ink); }
.sel { position: relative; }
.sel select { width: 100%; height: 48px; appearance: none; -webkit-appearance: none; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--white); padding: 0 40px 0 14px; font: 700 14px var(--font-sans); color: var(--ink); outline: none; cursor: pointer; }
.sel .ic { position: absolute; right: 12px; top: 15px; pointer-events: none; }
.counter { display: flex; align-items: center; justify-content: space-between; background: var(--white); border-radius: 20px; padding: 10px 12px 10px 18px; }
.counter .n { min-width: 36px; text-align: center; font-size: 17px; font-weight: 700; }

/* プルダウン風の複数選び */
.multi-sel { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 14px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--white); font-size: 14px; user-select: none; width: 100%; text-align: left; }
.multi-sel.open { border-color: var(--ink); }
.multi-sel .v { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--gray-600); }
.multi-sel .v.set { color: var(--ink); }
.multi-sel .ic { transition: transform 160ms; }
.multi-sel.open .ic { transform: rotate(180deg); }
.opt-list { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px; padding: 4px 0; }
.opt-list button { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: 14px; text-align: left; }
.opt-list button + button { border-top: 1px solid var(--gray-100); }
.opt-list .none { color: var(--gray-600); }
.box { width: 18px; height: 18px; flex: none; border-radius: 4px; border: 1.5px solid var(--ink); background: var(--white); display: flex; align-items: center; justify-content: center; color: var(--white); }
.box.on { background: var(--ink); }

/* ---------- 下に固定のボタン帯 ---------- */
.bar-bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); padding: 12px 16px; background: var(--cream); border-top: 1px solid var(--gray-200); z-index: 5; }
.bar-bottom.two { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }

/* ---------- 横から出る画面（絞り込み） ---------- */
.dim { position: absolute; inset: 0; background: rgba(17,17,17,.32); z-index: 30; }
.dim.fadein { animation: fadein 200ms ease-out; }
.drawer { position: absolute; top: 0; bottom: 0; right: 0; width: min(300px, 86%); background: var(--cream); display: flex; flex-direction: column; z-index: 31; padding-top: var(--safe-t); }
.drawer.slide { animation: slidein 200ms cubic-bezier(.2,.7,.3,1); }
.drawer .dh { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; }
.drawer .dh span { font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.drawer .db { flex: 1; overflow-y: auto; padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 18px; }
.drawer .df { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(28px + var(--safe-b)) 20px; background: var(--white); border-top: 1px solid var(--gray-200); }
.drawer .df .btn { flex: 1; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group > .gname { font-size: 12px; font-weight: 700; color: var(--gray-600); letter-spacing: .06em; }
@keyframes slidein { from { transform: translateX(105%); } to { transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetin { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- 下から出るシート ---------- */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78%; background: var(--cream); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; z-index: 31; padding-bottom: var(--safe-b); }
.sheet.up { animation: sheetin 220ms cubic-bezier(.2,.7,.3,1); }
.sheet .sh { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 20px; }
.sheet .sh span { font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.sheet .sb { flex: 1; overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.sheet .sf { display: flex; gap: 8px; padding: 12px 16px 28px; background: var(--white); border-top: 1px solid var(--gray-200); }
.opt-row { min-height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 14px; background: var(--white); font-size: 15px; font-weight: 700; border: 1.5px solid transparent; text-align: left; width: 100%; }
.opt-row.on { border-color: var(--ink); }
.opt-row span { flex: 1; }

/* ---------- まんなかのポップアップ ---------- */
.dialog { position: absolute; left: 16px; right: 16px; background: var(--white); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 18px; z-index: 31; animation: fadein 160ms ease-out; }
.dialog.center { top: 50%; transform: translateY(-50%); max-height: 86%; background: var(--cream); padding: 20px 16px 16px; gap: 14px; overflow-y: auto; }
.dialog.low { bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }
.choice { min-height: 56px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 16px; border-radius: 14px; background: var(--white); text-align: left; width: 100%; }
.choice b { font-size: 14px; }
.choice span { font-size: 11px; color: var(--gray-600); }

/* ---------- お知らせ ---------- */
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 92px); background: var(--ink); color: var(--white); border-radius: 14px; padding: 12px 16px; font-size: 13px; line-height: 1.6; pointer-events: none; z-index: 29; animation: fadein 160ms ease-out; }

/* ---------- 一覧の文字つき行 ---------- */
.line-item { display: flex; gap: 12px; align-items: center; background: var(--white); border-radius: 14px; padding: 8px 12px 8px 8px; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform 160ms; }
.line-item:active { transform: scale(.98); }
.line-item .t { font-size: 14px; font-weight: 700; letter-spacing: .03em; line-height: 1.45; }
.trade-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--pink); border: 1px solid var(--ink); }
.status { flex: none; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }

/* ---------- 表（詳しい情報） ---------- */
.kv { background: var(--white); border-radius: 20px; padding: 4px 16px; }
.kv div { min-height: 46px; display: flex; align-items: center; gap: 12px; }
.kv div + div { border-top: 1px solid var(--gray-100); }
.kv span:first-child { width: 92px; flex: none; font-size: 12px; color: var(--gray-600); }
.kv span:last-child { flex: 1; font-size: 14px; font-weight: 500; line-height: 1.5; padding: 8px 0; }

/* ---------- 写真（横にスワイプ） ---------- */
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 20px; }
.slides::-webkit-scrollbar { display: none; }
.slides > div { flex: 0 0 100%; scroll-snap-align: start; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dots { display: flex; align-items: center; justify-content: center; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-200); }
.dots i.on { background: var(--ink); }
.photo-black { height: 300px; border-radius: 20px; background: var(--ink); }
.photo-black img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- はじめての画面 ---------- */
.welcome { display: flex; flex-direction: column; gap: 14px; background: var(--white); border-radius: 20px; padding: 20px; }
.empty { padding: 36px 8px; text-align: center; font-size: 13px; line-height: 1.8; color: var(--gray-600); }
