/* ==========================================================================
   shelf - detail pages (show, movie, game) + rate / confirm sheets
   ========================================================================== */
.overlay.dpage-ov { z-index: 100; display: block; padding: 0; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; overflow: hidden; }
.dpage { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; max-width: 430px; margin: 0 auto; background: var(--bg); color: var(--text); font-family: var(--font-body); padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); animation: dpage-in var(--dur-sheet) var(--ease-sheet); }
@keyframes dpage-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.detail-hero.noart { height: 160px !important; }
.detail-hero.noart::after { display: none; }
[data-look="marquee"] .detail-hero.noart + .detail-head { margin-top: 0; }
.detail-head .detail-title { font-size: min(var(--fs-hero), 13vw); }
.status-dot.warn { background: var(--muted); }
.detail-body .section-h { padding-left: 0; padding-right: 0; }
.detail-body .section-h .count { margin-right: auto; }
[data-look="marquee"] .detail-body .section-h .count { margin-left: 0; font-family: var(--font-body); font-size: 13px; font-weight: 600; }
.season-h { padding-top: 10px; }
.season-h .icon-btn { color: var(--text); }

/* stats */
.stat.rating { cursor: pointer; }
.ring-wrap { position: relative; display: none; flex: none; }
[data-look="soft"] .ring-wrap { display: inline-flex; }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
[data-look="soft"] .stat .stat-col .stat-num em { font-size: 15px; }

/* summary */
.summary.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.summary a { cursor: pointer; }

/* action row */
.action { cursor: pointer; }
[data-look="marquee"] .action.on .action-ic { background: var(--text); color: var(--bg); border-color: var(--text); }
[data-look="soft"] .action.on .action-ic { background: var(--accent-fill); color: var(--on-accent); }

/* notify toggle row */
.notify-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 12px 8px 8px; text-align: left; color: var(--text); }
.notify-ic { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.notify-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notify-text b { font-size: 15px; }
.notify-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notify-row .toggle[aria-checked="true"] { background: var(--text); }
[data-look="soft"] .notify-row { border-radius: var(--radius-card); background: var(--surface); }
[data-look="soft"] .notify-ic { background: var(--tone); }
[data-look="soft"] .notify-row .toggle[aria-checked="true"] { background: var(--accent-fill); }
[data-look="marquee"] .notify-row { border-radius: var(--radius-control); box-shadow: inset 0 0 0 1.5px var(--line); padding-left: 6px; }
[data-look="marquee"] .notify-row.on { background: var(--text); color: var(--bg); box-shadow: none; }
[data-look="marquee"] .notify-row.on .notify-text small { color: color-mix(in oklab, var(--bg) 70%, transparent); }
[data-look="marquee"] .notify-row.on .notify-ic { background: var(--accent-fill); color: var(--on-accent); }
[data-look="marquee"] .notify-row.on .toggle { background: var(--bg); }
[data-look="marquee"] .notify-row.on .toggle::after { background: var(--text); }

/* seasons + episodes */
.season-tabs { overflow-x: auto; scrollbar-width: none; }
.season-tabs a { cursor: pointer; flex: none; }
[data-look="soft"] .season-tabs > * { min-width: 52px; flex: 1 0 auto; padding: 0 10px; }
.ep-row { cursor: default; }
.ep-body { cursor: pointer; }
.ep-row.show-up .ep-uptohere { display: inline-flex; }
.ep-check { cursor: pointer; }
.ep-when { display: none; flex: none; font-size: 12px; font-weight: 700; padding: 0 10px; height: 28px; border-radius: 999px; align-items: center; }
[data-look="soft"] .ep-when { display: inline-flex; background: var(--surface-2); }
[data-look="soft"] .ep-row[data-state="unaired"] .ep-check .clock { display: block; }
[data-look="soft"] .ep-row[data-state="unaired"] .ep-check::after { content: none; }
[data-look="soft"] .ep-row[data-state="unaired"] .ep-check { background: none; color: var(--muted); }
.ep-meta .i { display: inline-flex; }

/* notes */
.notes-card { display: flex; flex-direction: column; }
.notes-field { width: 100%; min-height: 84px; resize: vertical; border: 0; outline: 0; font: inherit; font-size: 15px; line-height: 1.5; color: var(--text); background: transparent; }
[data-look="soft"] .notes-card { padding: 4px 16px 16px; border-radius: var(--radius-card); background: var(--surface); }
[data-look="marquee"] .notes-card .notes-field { padding: 14px 16px; background: var(--surface); border-left: 3px solid var(--accent); }

/* similar */
.similar .strip { padding-bottom: 4px; }
.tile { cursor: pointer; color: var(--text); }
.tile .ell { display: block; }

/* ---------- rate sheet ----------------------------------------------------- */
.rate-sheet { text-align: center; }
.rate-head { display: flex; align-items: center; gap: 12px; text-align: left; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rate-head img { width: 40px; height: 56px; object-fit: cover; flex: none; border-radius: var(--radius-art); }
[data-look="soft"] .rate-head img { width: 44px; height: 44px; border-radius: 50%; }
.rate-head > div { flex: 1; min-width: 0; }
.rate-big { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 18px 0 10px; }
.rate-num { font-family: var(--font-display); font-weight: 800; font-size: 110px; line-height: .85; letter-spacing: -.02em; }
[data-look="soft"] .rate-num { font-size: 80px; }
.rate-big > span { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--muted); }
.rate-stars { display: flex; justify-content: space-between; padding: 6px 0; cursor: pointer; touch-action: none; }
.rate-star { position: relative; display: inline-flex; color: var(--line); }
.rate-star.on, .rate-star.half { color: var(--accent); }
.rate-star.half > .i:first-child { color: var(--line); }
.rate-half { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); color: var(--accent); }
[data-look="marquee"] .rate-star.on svg, [data-look="marquee"] .rate-half svg { stroke: var(--text); }
.rate-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.rate-quick { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.rate-pick { min-width: 56px; height: 44px; padding: 0 12px; border-radius: 999px; font-weight: 700; background: var(--surface-2); color: var(--text); }
.rate-pick[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.rate-foot { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.rate-foot .btn { height: 54px; }
[data-look="marquee"] .rate-foot .btn-quiet { background: none; box-shadow: inset 0 0 0 1.5px var(--line); }

/* ---------- confirm sheet --------------------------------------------------- */
.confirm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.confirm-art { position: relative; flex: none; }
.confirm-art img { width: 52px; height: 74px; object-fit: cover; border-radius: var(--radius-art); }
.confirm-badge { position: absolute; left: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--danger); color: var(--on-danger); }
.confirm-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; letter-spacing: var(--display-tracking); text-transform: var(--display-transform); }
.confirm-details { display: flex; flex-direction: column; margin-bottom: 10px; }
.confirm-row { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 14px; font-weight: 600; }
.confirm-row b { margin-left: auto; font-family: var(--font-display); font-size: 22px; }
.confirm-row > span:nth-child(2) { flex: 1; }
[data-look="marquee"] .confirm-row { border-top: 1px solid var(--line); }
[data-look="soft"] .confirm-details { padding: 6px 14px; border-radius: 22px; background: var(--surface-2); }
.confirm-body { margin: 6px 0 16px; font-size: 13px; color: var(--muted); }
.confirm-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-foot .btn { height: 52px; }
.btn-danger { background: var(--danger); color: var(--on-danger); }
[data-look="marquee"] .confirm-foot .btn-quiet { background: none; box-shadow: inset 0 0 0 1.5px var(--line); }

/* Soft: the ring already shows watched/total, so the big text is the time left */
[data-look="soft"] .stat:not(.rating) .ring-wrap ~ .stat-col .stat-num { display: none; }
[data-look="soft"] .stat:not(.rating) .ring-wrap ~ .stat-col .stat-sub { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.05; color: var(--text); }
/* desktop prev / next */
.dpage-ov .modal-nav { position: fixed; top: 50%; z-index: 3; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--text); box-shadow: var(--shadow-float), 0 0 0 1px var(--line); font-size: 0; transform: none; opacity: 1; }
.dpage-ov .modal-nav.prev { left: max(12px, calc(50% - 215px - 64px)); }
.dpage-ov .modal-nav.next { right: max(12px, calc(50% - 215px - 64px)); }
.dpage-ov .modal-nav:hover { transform: none; color: var(--accent); }
@media (max-width: 560px) { .dpage-ov .modal-nav { display: none; } }

/* countdown (unreleased) */
.countdown { display: flex; flex-direction: column; gap: 10px; }
.cd-top { display: flex; align-items: center; gap: 12px; }
.cd-num { font-family: var(--font-display); font-weight: 800; font-size: 120px; line-height: .8; letter-spacing: -.02em; }
.cd-side { display: flex; flex-direction: column; gap: 2px; }
.cd-unit { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; text-transform: var(--display-transform); }
.cd-side strong { font-size: 15px; }
.cd-side small { font-size: 12px; color: var(--muted); }
.cd-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.cd-dots i { flex: 1; min-width: 8px; height: 8px; border-radius: 999px; background: var(--surface-2); }
.cd-dots i.now { background: var(--text); }
.cd-dots i.end { background: var(--accent-fill); }
.cd-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
[data-look="soft"] .countdown { padding: 18px; border-radius: var(--radius-card); background: var(--tone); }
[data-look="soft"] .cd-num { font-size: 96px; }
[data-look="soft"] .cd-unit { font-size: 28px; }
[data-look="soft"] .cd-dots i { background: var(--surface); }
[data-look="soft"] .cd-dots i.now { background: var(--accent-fill); }
[data-look="marquee"] .countdown { border-top: 1px solid var(--line); padding-top: 14px; }
.rate-later { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 6px 0; }
.rate-later-stars { display: inline-flex; gap: 2px; }

/* watched stat */
.watched-ic { display: none; width: 52px; height: 52px; border-radius: 50%; align-items: center; justify-content: center; flex: none; background: var(--accent-fill); color: var(--on-accent); }
[data-look="soft"] .watched-ic { display: inline-flex; }
[data-look="soft"] .watched-stat .stat-num { font-size: 20px; }
.detail-body .dd-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.detail-body .dd-actions.three { grid-template-columns: 1fr 1fr; }
.detail-body .dd-actions .btn { height: 50px; min-height: 50px; }
[data-look="soft"] .detail-body .dd-actions { grid-template-columns: 1fr 1fr; }
[data-look="marquee"] .detail-body .dd-actions .btn-quiet { background: none; box-shadow: inset 0 0 0 1.5px var(--line); }
[data-look="marquee"] .detail-body .dd-actions .btn[aria-label="Remove"] { width: 112px; }

/* game status */
.status-seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.status-seg button { flex: 1 0 auto; height: 42px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.status-seg button[aria-checked="true"] { background: var(--text); color: var(--bg); font-weight: 700; }
[data-look="marquee"] .status-seg { box-shadow: inset 0 0 0 1.5px var(--line); }
[data-look="soft"] .status-seg { background: var(--surface-2); }
[data-look="soft"] .status-seg button[aria-checked="true"] { background: var(--accent-fill); color: var(--on-accent); }
/* sliding selection: one "orb" moves behind the options (segThumb in index.html) */
.status-seg { position: relative; }
.status-seg .seg-thumb { position: absolute; left: 0; top: 0; border-radius: 999px; background: var(--text); opacity: 0; pointer-events: none;
  transition: transform var(--dur-pill) var(--ease-pill), width var(--dur-pill) var(--ease-pill); }
[data-look="soft"] .status-seg .seg-thumb { background: var(--accent-fill); }
.status-seg.has-thumb button { position: relative; z-index: 1; transition: color var(--dur-pill) ease; }
.status-seg.has-thumb button[aria-checked="true"] { background: transparent; }
.mini-stars { display: inline-flex; gap: 2px; color: var(--muted); }
.mini-stars .on { color: var(--accent); }

/* facts table */
.factlist { display: flex; flex-direction: column; }
.factrow { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0; }
.factrow-l { font-size: 13px; color: var(--muted); }
.factrow-v { font-weight: 600; }
[data-look="marquee"] .factrow { border-top: 1px solid var(--line); }
[data-look="soft"] .factlist { padding: 4px 14px; border-radius: var(--radius-card); background: var(--surface); }
[data-look="soft"] .factrow + .factrow { border-top: 1px solid var(--line); }

/* shelf list card */
.shelf-list-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; color: var(--text); }
.shelf-list-card > .fan { width: 64px; height: 64px; }
.slc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.slc-body small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.slc-body b { font-size: 15px; }
.slc-body span { font-size: 12px; color: var(--muted); }
[data-look="soft"] .shelf-list-card { border-radius: var(--radius-card); background: var(--surface); }
[data-look="marquee"] .shelf-list-card { background: var(--surface); }

/* empty rating: a calm prompt instead of a placeholder dash */
.rate-big.empty { flex-direction: column; align-items: center; gap: 8px; min-height: 120px; justify-content: center; }
.rate-empty-star { color: var(--line); }
.rate-empty-star .ic, .rate-empty-star svg { width: 56px; height: 56px; }
.rate-empty-text { font-family: var(--font-body) !important; font-size: 15px !important; font-weight: 600 !important; color: var(--muted) !important; }
.stat-none { font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.3; }

/* Marquee: the head overlaps the art by 132px; a short head (no genre chips, e.g. games)
   must still fill that overlap so nothing below it starts under the image. */
.detail-body { position: relative; z-index: 1; }
[data-look="marquee"] .detail-head { min-height: 132px; justify-content: flex-end; z-index: 1; }
/* all four game statuses fit on a phone without scrolling */
.status-seg button { flex: 1 1 auto; padding: 0 10px; }
[data-look="soft"] .status-seg button { padding: 0 8px; font-size: 13.5px; }

/* No release date yet: "TBD" card in place of the countdown */
.tbd-block { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-card, 16px); background: var(--surface-2); color: var(--text); }
.tbd-block b { font-family: var(--font-display); font-size: 28px; line-height: 1; letter-spacing: var(--display-tracking, 0); }
.tbd-block span { color: var(--muted); font-size: 14px; }
