:root {
  --black: #000;
  --bg: #0d0d0f;
  --elev: #18181c;
  --hover: #24242a;
  --line: #2a2a31;
  --text: #fff;
  --muted: #a3a3ad;
  --accent: #ff6a1f;
  --accent-2: #e8213a;
  --accent-ink: #fff;
  --s-track: #34343c;
  --s-text: #fff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--black); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  display: grid; grid-template-columns: 228px 1fr; gap: 8px; padding: 8px; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- サイドバー ---------- */
.sidebar { background: var(--bg); border-radius: 12px; padding: 20px 12px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.logo { width: 38px; height: 38px; border-radius: 10px; display: block; }
.brand-name { font-weight: 900; font-size: 1.25rem; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px;
  background: none; border: none; color: var(--muted); font-weight: 700; cursor: pointer; text-align: left;
}
.nav-item .ico { width: 22px; text-align: center; font-size: 1.15rem; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); background: var(--hover); }
.nav-item[data-view="pick"] .ico { color: var(--accent); }
.credit { font-size: .7rem; color: #6a6a74; padding: 0 10px; margin: auto 0 0; line-height: 1.8; }
.tmdb-logo { display: block; height: 14px; width: auto; }
.tmdb-logo.sm { height: 10px; display: inline-block; }
.tabbar { display: none; }

/* ---------- メイン ---------- */
.main { background: var(--bg); border-radius: 12px; overflow-y: auto; padding: 0 28px 48px; position: relative; }
.view { display: none; padding-top: 28px; }
.view.active { display: block; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; } }
.page-title { font-size: 2rem; font-weight: 900; margin: 0 0 4px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: .88rem; line-height: 1.6; }
.eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .12em; color: var(--accent); margin: 0 0 6px; }
.eyebrow.center { text-align: center; }
.note { color: var(--muted); font-size: .78rem; line-height: 1.6; margin: 8px 0 0; }
.note.warn { color: #ffb36b; }
.note a { color: var(--text); }
.section-title { font-size: 1.2rem; margin: 32px 0 12px; font-weight: 800; }

/* ---------- ボタン ---------- */
.btn {
  border: none; border-radius: 999px; padding: 11px 22px; font-weight: 800; cursor: pointer;
  background: var(--hover); transition: transform .12s, filter .12s, background .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, #ff8a2a, var(--accent) 40%, var(--accent-2)); color: var(--accent-ink); box-shadow: 0 8px 28px rgba(255, 90, 30, .28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: 16px 30px; font-size: 1.05rem; }
.btn.wide { width: 100%; margin-top: 26px; }
.btn.ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.btn.ghost:hover { background: rgba(255,255,255,.14); }
.btn.text { background: none; color: var(--muted); padding: 8px 12px; font-weight: 700; }
.btn.text:hover { color: var(--text); }
.btn.small { padding: 8px 16px; font-size: .85rem; }
.btn.danger { color: #ff6b6b; }

/* ---------- ホーム ---------- */
.hero {
  margin: -28px -28px 8px; padding: 56px 28px 30px; position: relative; overflow: hidden;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(232, 33, 58, .35), transparent 60%),
    radial-gradient(70% 100% at 0% 0%, rgba(255, 140, 40, .28), transparent 60%),
    var(--bg);
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0; font-weight: 900; letter-spacing: -.02em; }
.hero-sub { color: #d8d8de; margin: 10px 0 22px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.hero-actions .ghost { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-radius: 16px; padding: 8px 18px; text-align: left; }
.hero-actions .ghost small { color: var(--muted); font-weight: 600; font-size: .74rem; margin-top: 2px; }
.hero-stats { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-stats div { background: rgba(255,255,255,.07); border-radius: 10px; padding: 10px 16px; min-width: 96px; }
.hero-stats b { font-size: 1.3rem; display: block; }
.hero-stats span { color: var(--muted); font-size: .76rem; }
.banner {
  background: #241a10; border: 1px solid #4d3216; color: #ffd7ad; border-radius: 12px;
  padding: 12px 16px; font-size: .84rem; line-height: 1.7; margin-top: 16px;
}
.ask {
  display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,106,31,.14), rgba(255,255,255,.04)); border: 1px solid rgba(255,106,31,.3);
}
.ask-body { flex: 1; min-width: 0; }
.ask-body b { display: block; font-size: .95rem; }
.ask-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 棚 ---------- */
.shelf { margin-top: 30px; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.shelf h2 { font-size: 1.3rem; margin: 0 0 12px; font-weight: 800; }
.shelf .sub { margin-top: -6px; }
.shelf-head button { background: none; border: none; color: var(--muted); font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; margin: 0 -10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 0 -10px; }
.card { background: none; border: none; text-align: left; padding: 10px; border-radius: 10px; cursor: pointer; transition: background .2s; min-width: 0; }
.card:hover { background: var(--hover); }
.card-art { position: relative; margin-bottom: 8px; }
.card-title { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pill { position: absolute; right: 6px; bottom: 6px; border-radius: 999px; padding: 3px 9px; font-size: .74rem; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pill.todo { background: rgba(0,0,0,.72); border: 1px solid rgba(255,255,255,.3); text-shadow: none; }

/* ---------- ポスター ---------- */
.poster {
  width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; position: relative;
  display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0,0,0,.45); flex-shrink: 0;
}
.poster span { font-size: 2.6rem; font-weight: 900; color: rgba(255,255,255,.85); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade-in .35s ease; }
.poster.sm { width: 48px; border-radius: 5px; }
.poster.sm span { font-size: 1.1rem; }
.poster.md { width: 92px; border-radius: 8px; }
.poster.md span { font-size: 2rem; }
.poster.xl { width: 100%; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.poster.xl span { font-size: 5rem; }

/* ---------- 質問 ---------- */
.q { margin-top: 26px; }
.q h3 { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; margin: 0 0 12px; flex-wrap: wrap; }
.q h3 span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.q h3 small { color: var(--muted); font-size: .76rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--elev); border-radius: 999px; padding: 10px 18px;
  font-weight: 700; cursor: pointer; transition: all .15s; font-size: .92rem;
}
.chip:hover { border-color: #55555f; }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.chip i { font-style: normal; margin-right: 6px; }
.chips.mood { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.chips.mood .chip { border-radius: 14px; padding: 14px 14px; text-align: left; }

/* ---------- シャッフル演出 ---------- */
.shuffle { display: grid; place-items: center; min-height: 70vh; text-align: center; }
.reel { width: min(220px, 56vw); }
.reel .poster { animation: none; }
.reel .poster img { animation: none; }
.shuffle-text { color: var(--muted); font-weight: 700; margin-top: 22px; line-height: 1.7; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- 結果 ---------- */
.result { position: relative; padding-top: 8px; animation: reveal .5s cubic-bezier(.2,.8,.2,1); }
@keyframes reveal { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.result-bg {
  position: absolute; inset: -36px -28px auto; height: 460px; background-size: cover; background-position: center;
  filter: blur(40px) saturate(1.3); opacity: .38; z-index: 0; pointer-events: none;
  mask-image: linear-gradient(180deg, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.result > *:not(.result-bg) { position: relative; z-index: 1; }
.result-main { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; margin-top: 10px; }
.result-info h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0; font-weight: 900; line-height: 1.2; }
.orig { color: var(--muted); margin: 4px 0 0; font-size: .9rem; }
.meta { color: #d0d0d8; margin: 10px 0 0; font-size: .88rem; }
.predict { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.07); }
.predict span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.predict b { font-size: 1.3rem; }
.reasons { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.reasons li { padding-left: 26px; position: relative; font-size: .92rem; line-height: 1.5; }
.reasons li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,106,31,.2); color: var(--accent); font-size: .7rem; display: grid; place-items: center; font-weight: 900; margin-top: 2px; }
.overview { margin-top: 18px; background: var(--elev); border-radius: 12px; padding: 12px 16px; }
.overview summary { cursor: pointer; font-weight: 800; }
.overview p { color: #d4d4dc; line-height: 1.8; font-size: .9rem; margin: 10px 0 2px; }
.result-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 22px; }
.result-sub { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin-top: 10px; }

/* ---------- どこで見れる ---------- */
.where { margin-top: 24px; }
.where h3 { margin: 0 0 10px; font-size: 1rem; }
.where.compact { margin-top: 14px; }
.where.compact h3 { font-size: .86rem; color: var(--muted); }
.svc-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.svc {
  text-decoration: none; border-radius: 12px; padding: 12px 10px; background: var(--elev); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px; opacity: .5; transition: transform .12s, opacity .12s;
}
.svc:hover { opacity: .8; }
.svc b { font-size: .86rem; white-space: nowrap; }
.svc small { font-size: .74rem; color: var(--muted); font-weight: 700; }
.svc.on, .svc.unknown { opacity: 1; }
.svc.on small { color: #fff; }
.svc.unknown small::after { content: " ↗"; }
.svc-theater.on { background: linear-gradient(135deg, #ff8a2a, #e8213a); border-color: transparent; }
.svc-netflix.on { background: #e50914; border-color: transparent; }
.svc-prime.on { background: #1a98ff; border-color: transparent; }
.svc-unext.on { background: #fff; border-color: transparent; }
.svc-unext.on b, .svc-unext.on small { color: #000; }
.svc-theater b { color: #ffb37a; } .svc-netflix b { color: #ff5a5f; } .svc-prime b { color: #69c0ff; } .svc-unext b { color: #fff; }
.svc.on b { color: #fff; }
.svc-unext.on b, .svc-unext.on small { color: #000; }

/* ---------- 検索・一覧 ---------- */
.search-box { display: flex; align-items: center; gap: 10px; background: var(--elev); border: 1px solid var(--line); border-radius: 999px; padding: 4px 18px; margin-bottom: 18px; }
.search-box span { color: var(--muted); font-size: 1.2rem; }
.search-box input { flex: 1; background: none; border: none; color: var(--text); font: inherit; padding: 10px 0; outline: none; font-size: 1rem; }
.rows { display: grid; gap: 2px; margin: 0 -10px; }
.row { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px; background: none; border: none; cursor: pointer; text-align: left; width: 100%; }
.row:hover { background: var(--hover); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-body b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-body small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-body .cmt { color: #cfcfd6; font-style: italic; }
.score { font-weight: 900; white-space: nowrap; }
.tag-sm { font-size: .74rem; font-weight: 800; border-radius: 999px; padding: 4px 10px; background: rgba(255,106,31,.18); color: #ffb37a; white-space: nowrap; }
.tag-sm.ghost { background: none; border: 1px solid var(--line); color: var(--muted); }
.seg { display: inline-flex; background: var(--elev); border-radius: 999px; padding: 4px; margin: 10px 0 14px; }
.seg button { border: none; background: none; padding: 8px 18px; border-radius: 999px; font-weight: 800; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: #000; }
.toolbar { margin-bottom: 10px; }
.toolbar[hidden] { display: none; }
select { background: var(--elev); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; }
.empty { text-align: center; padding: 60px 10px; color: var(--muted); }
.empty p { margin: 0 0 18px; line-height: 1.7; }
.spinner { width: 28px; height: 28px; margin: 30px auto; border-radius: 50%; border: 3px solid #333; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- あなた ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 14px; }
.stat-grid div { background: var(--elev); border-radius: 12px; padding: 14px 16px; }
.stat-grid b { font-size: 1.6rem; display: block; }
.stat-grid span { color: var(--muted); font-size: .78rem; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 140px 1fr 36px; gap: 12px; align-items: center; font-size: .88rem; }
.bar span small { color: var(--muted); margin-left: 6px; font-size: .74rem; }
.bar-track { height: 10px; background: var(--s-track); border-radius: 99px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; }
.bar b { text-align: right; }
.settings { background: var(--elev); border-radius: 12px; padding: 8px 16px 12px; }
.settings p { color: var(--muted); font-size: .84rem; margin: 10px 0; }
.settings .btn { padding-left: 0; }

/* ---------- 評価シート ---------- */
dialog {
  width: min(520px, 100vw); max-height: 92vh; border: none; border-radius: 22px; padding: 0;
  background: #16161a; color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
dialog[open] { animation: sheet .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet { from { transform: translateY(30px); opacity: 0; } }
#movieForm { padding: 16px 20px 24px; overflow-y: auto; max-height: 92vh; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; }
.close-btn { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--hover); cursor: pointer; }
.done-btn { border: none; background: none; color: var(--accent); font-weight: 900; font-size: 1rem; cursor: pointer; padding: 6px 4px; }
.done-btn:disabled { color: #55555f; cursor: default; }
.sheet-head { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.sheet-meta { min-width: 0; }
.sheet-meta h2 { margin: 0; font-size: 1.3rem; line-height: 1.3; }
.sheet-meta .sub { margin: 6px 0 0; font-size: .8rem; }
#sheetWhere .btn { margin-top: 12px; }
.dial-wrap { position: relative; width: min(320px, 100%); margin: 18px auto 0; }
#dial { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; outline: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#dial:active { cursor: grabbing; }
#dial .seg { fill: none; stroke: var(--s-track); stroke-width: 7; }
#dial .tick { stroke: #4a4a54; stroke-width: 1.4; stroke-linecap: round; }
#dial .tick.mid { stroke-width: 1.8; }
#dial .tick.major { stroke-width: 2.2; }
#dial .knob { fill: #2a2a30; stroke: #4a4a54; stroke-width: 1.5; }
#dial .dial-score { fill: var(--s-text); font-size: 34px; font-weight: 900; text-anchor: middle; dominant-baseline: central; }
#dial .dial-score .star { font-size: 28px; }
#dial .thumb-bg { stroke-width: 2.5; filter: drop-shadow(0 3px 8px rgba(0,0,0,.4)); transition: r .15s; }
#dial .thumb-star { font-size: 16px; text-anchor: middle; dominant-baseline: central; pointer-events: none; fill: #f26b1d; }
#dial:focus-visible .thumb-bg { stroke-width: 4; }
.dial-center {
  position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); margin: 0; text-align: center;
  white-space: pre-line; color: var(--muted); font-weight: 800; font-size: .95rem; pointer-events: none; width: 60%;
}
.tag-hint { color: var(--muted); font-size: .8rem; text-align: center; margin: 4px 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tag { border: 1px solid var(--line); background: var(--elev); border-radius: 999px; padding: 7px 13px; font-size: .82rem; font-weight: 700; cursor: pointer; }
.tag.on { background: rgba(255,106,31,.2); border-color: var(--accent); color: #ffc49b; }
textarea {
  width: 100%; margin-top: 14px; background: var(--elev); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font: inherit; padding: 12px; resize: vertical; font-size: .9rem;
}
#removeBtn { display: block; margin: 10px auto 0; }
#removeBtn[hidden] { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #fff; color: #000; font-weight: 800; padding: 12px 20px; border-radius: 999px; font-size: .88rem;
  transition: all .25s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- スマホ ---------- */
/* ---------- ランキング ---------- */
.toolbar select + select { margin-left: 6px; }
.rank-cards { display: grid; gap: 8px; margin-bottom: 4px; }
.rank-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--elev); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; color: var(--text); }
.rank-card:hover { background: var(--hover); }
.rank-thumbs { display: flex; gap: 4px; min-width: 64px; }
.rank-thumbs .poster.sm { width: 36px; }
.rank-empty { font-size: 1.8rem; width: 48px; text-align: center; }
.rank-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rank-card-body small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); font-size: 1.4rem; }
.btn.back { padding-left: 0; margin-bottom: 4px; }
.rank-name { display: block; width: 100%; background: none; border: none; border-bottom: 1px dashed var(--line); color: var(--text); font: inherit; font-size: 1.5rem; font-weight: 900; padding: 4px 0 6px; margin-bottom: 8px; outline: none; }
.rank-name:focus { border-bottom-color: var(--accent); }
.rank-list { list-style: none; margin: 0 -6px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.rank-item { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 12px; background: var(--elev); border: 1px solid transparent; }
.rank-item.dragging { border-color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.5); position: relative; z-index: 2; transform: scale(1.02); }
.rank-no { width: 30px; flex: none; text-align: center; font-weight: 900; font-size: 1.15rem; color: var(--muted); }
.rank-no.n1 { color: #ffd34d; font-size: 1.4rem; }
.rank-no.n2 { color: #d9dde3; font-size: 1.3rem; }
.rank-no.n3 { color: #e09a5f; font-size: 1.25rem; }
.rank-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 0; cursor: pointer; text-align: left; color: var(--text); }
.rank-info .poster.sm { width: 40px; flex: none; }
.rank-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.rank-text small { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-text .score { font-size: .76rem; }
.rank-btns { display: flex; gap: 2px; }
.mini { width: 28px; height: 30px; border-radius: 8px; border: none; background: var(--hover); color: var(--text); font-weight: 900; cursor: pointer; }
.mini:disabled { opacity: .25; cursor: default; }
.handle { width: 30px; height: 40px; flex: none; display: grid; place-items: center; color: var(--muted); font-size: 1.3rem; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.rank-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.rank-picker { max-height: 82vh; display: flex; flex-direction: column; }
.picker-title { display: block; margin-bottom: 12px; }
.search-box.small { margin-bottom: 8px; }
.search-box.small input { padding: 6px 0; font-size: .92rem; }
.seg.small { margin: 0 0 8px; }
.seg.small button { padding: 6px 14px; font-size: .82rem; }
.pick-list { overflow-y: auto; flex: 1; min-height: 120px; margin: 0 -10px; }
.pick-row.on { background: rgba(255,106,31,.14); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 900; flex: none; }
.pick-row.on .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.rank-picker .btn.wide { margin-top: 12px; }
.sheet-rank { margin-top: 10px; background: var(--elev); border-radius: 12px; padding: 10px 12px; }
.sheet-rank[hidden] { display: none; }
.sheet-rank small { color: var(--muted); font-size: .76rem; }

@media (max-width: 760px) {
  body { display: block; padding: 0; overflow: auto; }
  .sidebar { display: none; }
  .main { border-radius: 0; overflow: visible; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); min-height: 100vh; }
  .view { padding-top: calc(20px + env(safe-area-inset-top)); }
  .hero { margin: calc(-20px - env(safe-area-inset-top)) -16px 8px; padding: calc(48px + env(safe-area-inset-top)) 16px 24px; }
  .hero-actions .btn { width: 100%; }
  .shelf-row { grid-auto-columns: 124px; margin: 0 -16px; padding: 0 10px 8px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-bg { inset: -24px -16px auto; }
  .result-main { grid-template-columns: 1fr; gap: 18px; }
  .result-poster { width: min(210px, 50vw); margin: 0 auto; display: block; }
  .result-info { text-align: center; }
  .reasons { text-align: left; }
  .svc-row { grid-template-columns: repeat(2, 1fr); }
  .result-actions { grid-template-columns: 1fr; }
  .ask { flex-wrap: wrap; }
  .ask-btns { width: 100%; justify-content: stretch; }
  .ask-btns .btn { flex: 1; }
  .bar { grid-template-columns: 110px 1fr 32px; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 94vh; }
  #movieForm { padding-bottom: calc(24px + env(safe-area-inset-bottom)); max-height: 94vh; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(13,13,15,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab { background: none; border: none; color: var(--muted); font-size: .66rem; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; cursor: pointer; }
  .tab .ico { font-size: 1.25rem; line-height: 1; }
  .tab.active { color: var(--text); }
  .tab-main .ico {
    width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #ff8a2a, var(--accent) 45%, var(--accent-2)); box-shadow: 0 6px 20px rgba(255,90,30,.45);
  }
}

/* ---------- 起動アニメーション ---------- */
#intro { position: fixed; inset: 0; z-index: 200; background: #000; display: grid; place-content: center; justify-items: center; gap: 18px; pointer-events: none; }
#intro .intro-mark { width: 150px; height: 150px; opacity: 0; transform: scale(.7) rotate(-40deg); }
#intro .intro-name { font-weight: 900; font-size: 1.6rem; letter-spacing: .12em; color: #fff; opacity: 0; transform: translateY(8px); }
#intro.play .intro-mark { animation: intro-mark .9s cubic-bezier(.2,.9,.2,1.2) forwards; }
#intro.play .intro-name { animation: intro-name .5s .6s ease forwards; }
#intro.done { opacity: 0; transition: opacity .45s ease; }
@keyframes intro-mark { to { opacity: 1; transform: none; } }
@keyframes intro-name { to { opacity: 1; transform: none; } }

/* ---------- はじめて開いたとき ---------- */
body.onboarding .tabbar { display: none; }
#onboard { position: fixed; inset: 0; z-index: 120; background: radial-gradient(120% 70% at 50% 0%, #2a160c, #000 70%); overflow-y: auto; }
#onboard[hidden] { display: none; }
.ob { max-width: 560px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); min-height: 100%; display: flex; flex-direction: column; }
.ob h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); line-height: 1.3; margin: 18px 0 22px; font-weight: 900; }
.ob h2 { font-size: 1.6rem; margin: 4px 0 6px; font-weight: 900; }
.ob-welcome { justify-content: center; text-align: center; align-items: center; }
.ob-mark { width: 120px; height: 120px; }
.ob-points { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 12px; text-align: left; width: 100%; }
.ob-points li { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 14px 16px; line-height: 1.6; font-size: .92rem; color: #d8d8de; }
.ob-points b { color: #fff; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.ob-dots i { width: 6px; height: 6px; border-radius: 50%; background: #444; }
.ob-dots i.on { background: var(--accent); width: 18px; border-radius: 3px; }
.ob-services { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 26px; }
.ob-svc { border: 1.5px solid var(--line); background: var(--elev); border-radius: 16px; padding: 22px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; transition: all .15s; }
.ob-svc b { font-size: 1.05rem; }
.ob-svc small { color: var(--muted); font-size: .76rem; }
.ob-svc.on { border-color: var(--accent); background: rgba(255,106,31,.14); }
.ob-svc.on small::before { content: "✓ "; color: var(--accent); }
.ob-rate { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.ob-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ob-card { position: relative; min-width: 0; background: none; border: none; padding: 0; cursor: pointer; text-align: left; }
.ob-card .poster { box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.ob-card.rated .poster { outline: 3px solid var(--accent); outline-offset: -3px; }
.ob-card .pill { top: 6px; bottom: auto; }
.ob-title { display: block; font-size: .72rem; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, #000 40%); }
.ob-bar .btn { max-width: 520px; margin: 0 auto; display: block; }
.ob-quick { position: fixed; inset: 0; z-index: 130; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.ob-quick[hidden] { display: none; }
.ob-quick-in { width: min(520px, 100%); background: #16161a; border-radius: 22px 22px 0 0; padding: 20px 20px calc(18px + env(safe-area-inset-bottom)); animation: sheet .25s ease; }
.ob-quick-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.ob-quick-head b { display: block; }
.ob-quick-head small { color: var(--muted); font-size: .78rem; }
.ob-quick-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ob-quick-btns .btn { padding: 16px 0; border-color: color-mix(in srgb, var(--c) 60%, transparent); color: var(--c); font-size: 1rem; }

/* ---------- 詳細シート ---------- */
.sheet-meta h2 { font-size: 1.35rem; }
.tagline { color: #ffc49b; font-size: .82rem; margin: 6px 0 0; font-style: italic; }
.tagline:empty { display: none; }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.act { flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: var(--elev); border: 1px solid var(--line); text-decoration: none; font-size: .78rem; font-weight: 800; cursor: pointer; color: var(--text); }
.act i { font-style: normal; font-size: 1.05rem; color: var(--accent); }
.act.on { background: rgba(255,106,31,.16); border-color: rgba(255,106,31,.5); }
.sheet-overview { color: #d0d0d8; font-size: .86rem; line-height: 1.8; margin: 16px 0 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.sheet-overview.open { -webkit-line-clamp: unset; }
.sheet-cast { color: var(--muted); font-size: .8rem; line-height: 1.7; margin: 10px 0 0; }
.sheet-cast b { color: var(--text); margin-right: 8px; }
.rate-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 0; color: var(--muted); font-weight: 800; font-size: .86rem; }
.rate-head::before, .rate-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.done-btn { background: linear-gradient(135deg, #ff8a2a, var(--accent-2)); color: #fff; border-radius: 999px; padding: 8px 16px; font-size: .88rem; }
.done-btn:disabled { background: var(--hover); color: #66666f; }
.result-poster { background: none; border: none; padding: 0; cursor: pointer; }
.empty-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- 設定 ---------- */
.settings { background: var(--elev); border-radius: 14px; padding: 4px 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; text-decoration: none; font: inherit; }
.set-row:last-child { border-bottom: none; }
.set-row.col { flex-direction: column; align-items: flex-start; gap: 6px; }
.set-row b { display: block; font-size: .92rem; }
.set-row small { display: block; color: var(--muted); font-size: .76rem; margin-top: 3px; line-height: 1.6; }
.set-row.link { cursor: pointer; }
.set-row.link span { color: var(--muted); font-size: 1.3rem; }
.set-btns { display: flex; gap: 6px; flex-shrink: 0; }
.chips.small { margin-top: 6px; }
.chips.small .chip { padding: 7px 14px; font-size: .84rem; }
.switch { width: 52px; height: 32px; border-radius: 99px; border: none; background: #3a3a42; position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: #34c759; }
.switch.on i { transform: translateX(20px); }
.about-mark { width: 44px; height: 44px; border-radius: 11px; }
.credits small { margin-top: 0; }
.credits .tmdb-logo { height: 16px; margin-bottom: 4px; }
.btn:disabled { opacity: .4; cursor: default; }

/* アプリの中ではホバーの色を付けない（指で触ったあと色が残るため） */
.native .card:hover, .native .row:hover { background: none; }
.native .btn:active, .native .card:active, .native .row:active { opacity: .75; }
.set-row .btn { white-space: nowrap; flex-shrink: 0; }
