/* Media shelf page */
.ms-foot { display: flex; gap: 10px; justify-content: flex-end; margin: 0; }

.ms-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--outline); padding: 0 5px; margin-right: 4px; vertical-align: 1px; background: var(--field); color: var(--ink); }
.ms-film { background: var(--peach); } .ms-show { background: var(--purple); } .ms-book { background: var(--green); }
.ms-manga { background: var(--blue); } .ms-game { background: var(--yellow); } .ms-other { background: var(--field); }

.ms-title { border: none; background: none; padding: 0; text-align: left; font-family: var(--display); font-size: 22px; line-height: 1.1; cursor: pointer; }
.ms-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.ms-title.sm { font-family: inherit; font-size: 14px; font-weight: 700; }
.ms-by { font-size: 12px; }

/* now playing */
.ms-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 14px; }
/* wide card: object on the left, info on the right */
.ms-card { border: var(--b); background: var(--surface); box-shadow: var(--sh); padding: 12px 14px 12px 8px; display: flex; gap: 12px; align-items: stretch; }
.ms-card-art { flex: none; border: none; background: none; padding: 0; cursor: pointer; display: flex; align-items: center; }
.ms-card-art .mf-stage { --pw: 84px; width: calc(84px * 1.8); }
/* in a wide card each object has its own column: center it instead of lining posters up with other cards */
.ms-card-art .mf-stage { height: auto; justify-content: center; }
.ms-card-art .mfi { margin-top: 0 !important; }
.ms-card-art:hover .mfi { transform: translate(-2px, -2px); filter: drop-shadow(5px 5px 0 var(--outline)); }
.ms-card-art:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }
.ms-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.ms-card-name { display: flex; flex-direction: column; gap: 2px; }
.ms-card-name .ms-title { font-size: 24px; }
@media (max-width: 520px) {
  .ms-card { gap: 8px; padding: 10px 10px 10px 4px; }
  .ms-card-art .mf-stage { --pw: 52px; width: calc(52px * 1.8); }
  .ms-card-name .ms-title { font-size: 20px; }
  .ms-prog-row { gap: 4px; }
  .ms-prog-row input { width: 46px; }
  .ms-prog-row .mut { min-width: 0; font-size: 11px; }
}
.ms-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.ms-prog { display: flex; flex-direction: column; gap: 4px; }
.ms-prog-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ms-prog-row input { width: 64px; height: 30px; border: var(--b); background: var(--field); text-align: center; font-size: 14px; }
.ms-prog-row .mut { flex: 1; }
.ms-step, .ms-icon { width: 30px; height: 30px; border: var(--line) solid var(--outline); background: var(--field); font-weight: 700; font-size: 15px; display: grid; place-items: center; padding: 0; flex: none; }
.ms-step:hover, .ms-icon:hover:not(:disabled) { background: var(--hover); }
.ms-icon:disabled { opacity: .35; }
.ms-rule { margin: 0; font-size: 12px; font-style: italic; }
.ms-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ms-actions .tt-ghost { white-space: nowrap; flex: none; }
.ms-actions .btn { flex: 1; min-width: 90px; height: 36px; white-space: nowrap; padding: 0 12px; }

/* queue + watchlist */
.ms-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

/* history */
.ms-h { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ms-h li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.ms-h li:first-child { border-top: none; }
.ms-h li.dropped { opacity: .75; }
.ms-h-date { font-size: 11px; padding-top: 2px; }
.ms-h-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ms-h-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ms-stars { color: var(--yellow-deep); -webkit-text-stroke: .6px var(--ink); letter-spacing: 1px; font-size: 15px; }
.ms-heart { color: var(--orange-deep); font-size: 15px; }
.ms-dropped { font-size: 11px; border: 1px dashed var(--outline); padding: 0 5px; }
.ms-rev { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* dialogs */
.ms-dlg { width: min(560px, 94vw); }
.ms-form textarea { border: var(--b); background: var(--field); padding: 8px 10px; font-size: 15px; font-family: inherit; resize: vertical; }
.ms-form h4, .ms-review h4 { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; align-items: center; }
.ms-heartl { flex-direction: row !important; align-items: center; gap: 8px !important; }
.ms-heartl input { width: auto; height: auto; }
.ms-item { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 4px; max-height: 78vh; overflow-y: auto; }
.ms-item .ms-form { padding: 0 0 12px; }
.ms-item-head { display: flex; align-items: center; gap: 8px; }
.ms-dates { margin: 0; font-size: 12px; }
.ms-review { border: var(--b); background: var(--field); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.ms-review p { margin: 0; font-size: 14px; line-height: 1.5; }
.ms-review > .tt-ghost { align-self: flex-start; }
.ms-ci { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 4px solid var(--purple); display: flex; flex-direction: column; gap: 8px; }
.ms-ci li { display: flex; flex-direction: column; font-size: 13px; position: relative; padding-right: 22px; }
.ms-ci li .mut { font-size: 11px; }
.ms-ci .fx-x { position: absolute; right: 0; top: 0; }
.ms-purge { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.ms-purge label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400 !important; }
.ms-purge label > span { display: flex; flex-direction: column; }
.ms-purge .mut { font-size: 11px; }

/* half-star rating: 10 hidden radios laid over 5 stars */
.ms-rate { border: none; margin: 0; padding: 0; }
.ms-rate legend { font-weight: 700; font-size: 13px; padding: 0; margin-bottom: 4px; }
.ms-rate-row { display: flex; align-items: center; gap: 12px; }
.ms-starrow { position: relative; width: 170px; height: 34px; }
.ms-starrow:focus-within { outline: 2px dashed var(--ink); outline-offset: 3px; }
.ms-star { position: absolute; top: 0; left: calc(var(--i) * 34px); width: 34px; height: 34px; pointer-events: none; --fill: 0%; }
.ms-star::before { content: "★"; font-size: 32px; line-height: 34px; display: block; text-align: center;
  background: linear-gradient(90deg, var(--yellow-deep) var(--fill), var(--field) var(--fill)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.ms-half { position: absolute; top: 0; width: 17px; height: 34px; z-index: 1; cursor: pointer; left: calc(var(--i) * 34px); }
.ms-half.r { left: calc(var(--i) * 34px + 17px); }
.ms-half input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.ms-rate-v { font-size: 12px; }

@media (max-width: 860px) {
  .ms-h li { grid-template-columns: 1fr; gap: 2px; }
}

/* covers + search (step 2) */
.ms-cover { border: var(--line) solid var(--outline); object-fit: cover; background: var(--field); flex: none; display: block; }
.ms-cover.sm { width: 34px; height: 50px; }
.ms-cover.md { width: 52px; height: 76px; }
.ms-cover.lg { width: 84px; height: 124px; box-shadow: var(--sh); }
.ms-card-id { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ms-card-id > div { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.ms-card-id .ms-title { text-align: center; }
.ms-h li.has-cover { grid-template-columns: 34px 96px 1fr; }
.ms-item-id { display: flex; gap: 12px; align-items: flex-start; }
.ms-item-id > div { display: flex; flex-direction: column; gap: 3px; }
.ms-item-t { font-family: var(--display); font-size: 22px; line-height: 1.1; }
.ms-src { font-size: 11px; }
.ms-results { border: var(--b); background: var(--surface); max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; }
.ms-r { display: flex; gap: 10px; align-items: center; text-align: left; border: none; border-bottom: 1px solid var(--rule); background: transparent; padding: 6px 8px; font-size: 13px; }
.ms-r:last-child { border-bottom: none; }
.ms-r:hover, .ms-r:focus-visible { background: var(--hover); outline: none; }
.ms-r img, .ms-r-nocover { width: 30px; height: 44px; object-fit: cover; border: 1px solid var(--outline); flex: none; background: var(--field); }
.ms-r > span { display: flex; flex-direction: column; min-width: 0; }
.ms-r-sub { font-size: 11px; }
.ms-r-msg { margin: 0; padding: 8px; font-size: 12px; }
.ms-picked { display: flex; align-items: center; gap: 10px; font-size: 12px; border: var(--line) dashed var(--outline); padding: 6px 8px; }
.ms-picked img { width: 34px; height: 50px; object-fit: cover; border: 1px solid var(--outline); }
.ms-picked span { flex: 1; }
@media (max-width: 860px) { .ms-h li.has-cover { grid-template-columns: 34px 1fr; } .ms-h li.has-cover .ms-h-date { grid-column: 2; } }

/* cover picker */
.ms-cov-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; flex: none; }
.ms-cov-wrap .tt-ghost { font-size: 11px; padding: 2px 6px; }
.ms-nocover { background: repeating-linear-gradient(45deg, var(--field) 0 6px, var(--rule) 6px 8px); }
.ms-covgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.ms-cov { border: var(--line) solid var(--outline); padding: 0; background: var(--field); aspect-ratio: 2 / 3; overflow: hidden; cursor: pointer; }
.ms-cov img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-cov:hover, .ms-cov:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.ms-cov.on { outline: 3px solid var(--heat); outline-offset: 1px; }

.ms-r-hint { border: none; border-bottom: var(--line) dashed var(--outline); background: var(--accent-2); text-align: left; padding: 8px 10px; font-size: 12px; cursor: pointer; }
.ms-r-hint:hover, .ms-r-hint:focus-visible { background: var(--accent); color: var(--on-accent); outline: none; }

/* videos + links */
.ms-cover.wide.sm { width: 60px; height: 34px; }
.ms-cover.wide.md { width: 96px; height: 54px; }
.ms-cover.wide.lg { width: 160px; height: 90px; }
.ms-h li.has-cover:has(.wide) { grid-template-columns: 60px 96px 1fr; }
.ms-picked img.wide { width: 80px; height: 45px; }
.ms-video { background: var(--peach-deep); }
.ms-open { font-size: 12px; font-weight: 700; color: var(--ink); border: 1px solid var(--outline); padding: 0 6px; text-decoration: none; background: var(--field); white-space: nowrap; }
.ms-open:hover { background: var(--hover); }
.ms-card-top .ms-open { margin-left: 6px; }
.ms-item-id .ms-open { align-self: flex-start; margin-top: 4px; }

.ms-form-err { margin: 0; padding: 8px 10px; border: var(--line) solid var(--outline); background: var(--soil); font-size: 13px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ms-form-err[hidden] { display: none; }

/* cover row in the Add dialog */
.ms-coverrow { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.ms-coverprev { width: 40px; height: 58px; border: var(--line) solid var(--outline); background: repeating-linear-gradient(45deg, var(--field) 0 5px, var(--rule) 5px 7px); flex: none; overflow: hidden; display: grid; place-items: center; }
.ms-coverprev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-coverprev:has(img.wide) { width: 80px; height: 45px; }
.ms-coverrow .mut { flex: 1; }
.ms-covpanel { border: var(--line) dashed var(--outline); padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.ms-covpanel .ms-covgrid { max-height: 280px; }
.ms-covpaste { display: flex; gap: 6px; align-items: center; }
.ms-covpaste input { flex: 1; height: 34px; border: var(--b); background: var(--field); padding: 0 8px; font-size: 13px; min-width: 0; }

/* placeholder poster for items without art (src/widgets/mediaart.js) */
.ph-art {
  display: flex; flex-direction: column; justify-content: space-between; gap: 4%; box-sizing: border-box;
  aspect-ratio: 2 / 3; padding: 9% 8%; border: var(--b); background: var(--field); color: var(--ink);
  text-align: left; overflow: hidden; container-type: inline-size; position: relative;
  background-image: linear-gradient(180deg, transparent 62%, rgba(26, 23, 20, .07) 62% 64%, transparent 64%);
}
.ph-art.wide { aspect-ratio: 16 / 9; padding: 5% 6%; }
.ph-kind { align-self: flex-start; font-size: max(8px, 9cqw); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--surface); border: 1px solid var(--outline); padding: 0 .4em; }
.ph-title { font-family: var(--display); font-size: max(10px, 15cqw); line-height: 1.02; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; word-break: break-word; }
.ph-by { font-size: max(7px, 8cqw); opacity: .8; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ph-art.wide .ph-title { -webkit-line-clamp: 2; font-size: max(10px, 9cqw); }
.ph-art.wide .ph-kind, .ph-art.wide .ph-by { font-size: max(7px, 5cqw); }
.ph-film { background-color: var(--peach); } .ph-show { background-color: var(--purple); } .ph-book { background-color: var(--green); }
.ph-manga { background-color: var(--blue); } .ph-game { background-color: var(--yellow); } .ph-video { background-color: var(--peach-deep); }
.ph-other { background-color: var(--field); }
/* the tiny ones (history thumbnails, picker previews) only need the color + first letter */
.ms-cover.sm.ph-art .ph-kind, .ms-cover.sm.ph-art .ph-by { display: none; }
/* sizes when used inside the media page */


/* ---- framed media objects (src/widgets/mediaart.js framed()) ----
   .mf          sizing box (width from the parent; height from aspect-ratio)
   .mf-body     the object itself, colored by --tint (cover's vivid color, else the medium color)
   .mf-cover    where the cover / placeholder poster sits */
.mf { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3.25; --tint: var(--blue-deep); --edge: var(--outline); }
.mf-book { --tint: var(--blue-deep); } .mf-manga { --tint: var(--peach-deep); aspect-ratio: 2 / 3.4; }
.mf-film { --tint: var(--purple-deep); } .mf-show { --tint: var(--green-deep); aspect-ratio: 3 / 3.7; }
.mf-game { --tint: var(--orange); aspect-ratio: 2 / 2.75; } .mf-video { --tint: var(--peach-deep); aspect-ratio: 16 / 11; }
.mf-other { --tint: var(--yellow-deep); }
.mf-body { position: absolute; inset: 0 0 7% 0; background: var(--tint); border: var(--line) solid var(--edge); box-shadow: var(--sh); }
.mf-cover { position: absolute; overflow: hidden; background: var(--field); border: var(--line) solid var(--edge); }
.mf-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf-ph { width: 100%; height: 100%; aspect-ratio: auto; border: none; box-sizing: border-box; }

/* book: spine down the left, page block along the bottom, ribbon hanging out */
.mf-book .mf-cover, .mf-manga .mf-cover { left: 12%; top: -2px; right: -2px; bottom: 16%; }
.mf-book .mf-body::before, .mf-manga .mf-body::before { content: ""; position: absolute; left: 4.5%; top: 0; bottom: 0; width: 3%; background: rgba(255, 255, 255, .22); }
.mf-pages { position: absolute; left: 12%; right: 0; bottom: 5%; height: 10%; background: var(--surface); border-top: var(--line) solid var(--edge); border-bottom: var(--line) solid var(--edge); border-left: var(--line) solid var(--edge);
  background-image: repeating-linear-gradient(180deg, transparent 0 3px, var(--rule) 3px 4px); }
.mf-ribbon { position: absolute; right: 16%; bottom: -9%; width: 11%; height: auto; overflow: visible; }
.mf-ribbon path { fill: var(--yellow); stroke: var(--edge); stroke-width: 1.4; stroke-linejoin: round; }
.mf-manga .mf-cover { left: 9%; bottom: 11%; }
.mf-manga .mf-pages { left: 9%; height: 6%; bottom: 3.5%; background-image: repeating-linear-gradient(180deg, transparent 0 2px, var(--rule) 2px 3px); }
.mf-manga .mf-body::before { left: 3%; width: 2.5%; }
.mf-manga .mf-ribbon { width: 9%; right: 14%; }

/* film: a dark case with a ticket-stub strip */
.mf-film .mf-body { background: color-mix(in srgb, var(--tint) 30%, #1A1714); }
.mf-film .mf-cover { left: 6%; right: 6%; top: 4%; bottom: 14%; }
.mf-stub { position: absolute; left: 6%; right: 6%; bottom: 3%; height: 8%; background: var(--tint); border: var(--line) solid var(--edge); display: flex; align-items: center; justify-content: space-around; border-top-style: dashed; }
.mf-stub i { width: 8%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); border: 1px solid var(--edge); }

/* show: a little TV with antennae and knobs */
.mf-show .mf-body { top: 9%; }
.mf-show .mf-cover { left: 7%; right: 24%; top: 7%; bottom: 9%; border-radius: 6px; }
.mf-antenna { position: absolute; left: 30%; width: 40%; bottom: 100%; margin-bottom: -2px; overflow: visible; }
.mf-antenna path { stroke: var(--edge); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.mf-antenna circle { fill: var(--edge); }
.mf-knobs { position: absolute; right: 6%; width: 12%; top: 18%; display: flex; flex-direction: column; gap: 16%; }
.mf-knobs i { display: block; aspect-ratio: 1; border-radius: 50%; background: var(--surface); border: var(--line) solid var(--edge); }

/* game: a cartridge with grip ridges at the top */
.mf-game .mf-cover { left: 10%; right: 10%; top: 22%; bottom: 8%; }
.mf-grip { position: absolute; left: 10%; right: 10%; top: 5%; height: 11%; background-image: repeating-linear-gradient(90deg, rgba(26, 23, 20, .45) 0 2px, transparent 2px 7px); }

/* video: a player with a play badge and progress bar */
.mf-video .mf-body { inset: 0; }
.mf-video .mf-cover { left: 4%; right: 4%; top: 5%; bottom: 17%; }
.mf-play { position: absolute; left: 4%; bottom: 3%; width: 10%; aspect-ratio: 1; background: var(--surface); border: var(--line) solid var(--edge); display: grid; place-items: center; }
.mf-play svg { width: 60%; } .mf-play path { fill: var(--edge); }
.mf-progress { position: absolute; left: 17%; right: 4%; bottom: 7%; height: 5%; background: var(--surface); border: 1px solid var(--edge); }
.mf-progress i { display: block; height: 100%; width: 38%; background: var(--accent); }

/* other: a plain card */
.mf-other .mf-cover { inset: 6%; }

/* sizes on the media page */
/* poster widths on the media page */
.ms-card-id .mf-stage { --pw: 74px; }
.ms-item-id .mf-stage { --pw: 54px; width: auto; min-width: calc(54px * 1.8); }

/* Mo's drawn frames (framed() with FRAMES in mediaart.js): tint layer (masked body) → shade → cover → line art */
/* a stage holds one drawn frame: same height for every medium, frame centered, poster tops line up */
.mf-stage { display: flex; flex-direction: column; align-items: center; width: 100%; height: calc(var(--pw) * var(--sh)); }
:where(.mf-stage) { --pw: 80px; } /* default poster width; any sizing class wins */
.mf.mfi { position: relative; display: block; flex: none; filter: drop-shadow(3px 3px 0 var(--outline)); }
.mfi > * { position: absolute; }
.mfi-tint { inset: 0; background: var(--tint); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.mfi-layer { inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.mfi-cover { overflow: hidden; background: var(--field); }
.mfi-cover .mf-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mfi-cover .mf-ph { border: none; }

.mf.mfi { container-type: inline-size; }
.mfi-badge { font-weight: 700; font-size: max(10px, 9cqw); line-height: 1; padding: .25em .4em; color: var(--ink); background: var(--surface); border: var(--line) solid var(--outline); box-shadow: 2px 2px 0 var(--outline); white-space: nowrap; }

/* a placeholder poster inside a frame's cover window fills it */
.mfi-cover .ph-art.mf-ph, .mf-cover .ph-art.mf-ph { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; padding: 9% 8%; box-shadow: none; }

/* roll.exe: full-screen roll for one type (src/widgets/roll.js) */
body.rl-on { overflow: hidden; }
.rl { position: fixed; inset: 0; z-index: 300; background: var(--shade, rgba(26, 23, 20, .45)); backdrop-filter: blur(3px); display: grid; padding: 2vh 2vw; }
.rl-win { width: 100%; height: 100%; display: flex; flex-direction: column; box-shadow: var(--sh-lg, 6px 6px 0 var(--outline)); position: relative; overflow: hidden; }
.rl-win .body { overflow-y: auto; padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.rl-kicker { margin: 0 0 22px; font-family: var(--display); font-size: clamp(24px, 4vw, 40px); text-align: center; }
.rl-kicker .mut { font-family: var(--mono, inherit); font-size: 13px; }
.rl-reel { margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 18px 28px; --pw: 100px; --fw: 1.3; }
.rl .rl-frame { --pw: inherit; height: auto; width: auto; }
.rl .rl-frame .mfi { margin-top: 0 !important; }
.rl-cell { width: calc(var(--pw) * var(--fw)); display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .06s; }
.rl-cell .mfi { filter: saturate(.5) brightness(.9); }
.rl-cell.on { transform: translate(-3px, -3px); }
.rl-cell.on .mfi { filter: drop-shadow(3px 0 0 var(--accent)) drop-shadow(-3px 0 0 var(--accent)) drop-shadow(0 3px 0 var(--accent)) drop-shadow(0 -3px 0 var(--accent)) drop-shadow(6px 6px 0 var(--outline)); }
.rl-cell.won .mfi { filter: drop-shadow(4px 0 0 var(--heat)) drop-shadow(-4px 0 0 var(--heat)) drop-shadow(0 4px 0 var(--heat)) drop-shadow(0 -4px 0 var(--heat)) drop-shadow(6px 6px 0 var(--outline)); animation: rl-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rl-pop { 0% { transform: scale(1); } 45% { transform: scale(1.14) rotate(-2deg); } 100% { transform: scale(1); } }
.rl-name { font-size: clamp(13px, calc(var(--pw) * .07), 18px); font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-cell.on .rl-name { color: var(--accent); }
.rl-win-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 8px 0; animation: rl-in .35s ease-out; }
@keyframes rl-in { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.rl-win-card .mfi { filter: drop-shadow(6px 6px 0 var(--outline)); }
.rl-win-t { font-family: var(--display); font-size: 40px; line-height: 1.05; margin-top: 4px; }
.rl-why { font-style: italic; font-size: 14px; }
.rl-act { display: flex; gap: 10px; width: min(420px, 100%); margin-top: 6px; }
.rl-act .btn { flex: 1; height: 46px; font-size: 16px; }
.rl-act .btn:disabled { opacity: .5; }
.rl-tip { margin: 0; font-size: 12px; }
.rl-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.rl-confetti i { position: absolute; border: 1px solid var(--outline); }
@media (max-width: 600px) {
  .rl { padding: 0; }
  .rl-win { height: 100%; }
  .rl-win-t { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .rl-win-card, .rl-cell.won .mfi { animation: none; } }

/* watchlists: one ranked list per type, in tabs (src/widgets/watchtabs.js) */
.wt-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.wt-n { font-size: 11px; opacity: .7; margin-left: 2px; }
.wt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.wt-roll { height: 40px; padding: 0 16px; }
.wt-roll:disabled { opacity: .45; }
.wt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.wt-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.wt-list li:first-child { border-top: none; }
.wt-rank { width: 28px; height: 28px; border: var(--line) solid var(--outline); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px; flex: none; background: var(--field); }
.wt-list li.top .wt-rank { background: var(--accent); color: var(--on-accent); }
.wt-art { flex: none; display: flex; }
.wt-frame { --pw: 30px; }
.wt-list.sm .wt-frame { --pw: 24px; }
.wt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wt-main .mut { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-next { color: var(--accent); }
.wt-act { display: flex; gap: 4px; align-items: center; flex: none; }
.wt-empty { margin: 6px 0; }
@media (max-width: 600px) {
  .wt-art { display: none; }
  .wt-act [data-wact="top"] { display: none; }
}
.rl-win-card { --pw: 150px; }

/* history (left) and watchlists (right) side by side; stacked on narrow screens */
.ms-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ms-cols > .win { margin: 0; }
@media (max-width: 980px) { .ms-cols { grid-template-columns: 1fr; } }

/* the drawn die (DICE in mediaart.js) */
.dice { height: 1.25em; width: auto; vertical-align: -0.28em; margin-right: .15em; }
.wt-roll { display: inline-flex; align-items: center; gap: 6px; }
.wt-roll .dice { height: 22px; vertical-align: 0; margin: 0; }
.rl-kicker .dice { height: 1.1em; vertical-align: -0.15em; }
.rl-kicker.spin .dice { animation: dice-tumble .5s steps(4) infinite; }
@keyframes dice-tumble { 0% { transform: rotate(0); } 25% { transform: rotate(-14deg) translateY(-3px); } 50% { transform: rotate(0) translateY(0); } 75% { transform: rotate(14deg) translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .rl-kicker.spin .dice { animation: none; } }

/* timer link: pace on cards, Time on the item page */
.ms-pace { margin: 0; font-size: 12px; }
.ms-time { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
