:root {
  color-scheme: light;
  --ink: #221829;
  --muted: #746978;
  --pink: #ae266c;
  --bright: #ff8dca;
  --line: #ebdfe8;
  --paper: #fff;
  --wash: #faf7f9;
  --soft: #f9eaf3;
  --shadow: 0 8px 28px #4c22430b;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wash); color: var(--ink); }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #b62777; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(1280px, calc(100% - 80px)); margin-inline: auto; }
.site-header { background: #fffdff; border-bottom: 1px solid var(--line); }
.site-bar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; color: white; background: #a72a71; border-radius: 12px; font-size: 1.45rem; box-shadow: 0 4px 12px #a72a7130; }
.brand b, .brand small { display: block; }
.brand b { letter-spacing: .06em; line-height: 1.25; font-size: 1rem; }
.brand small { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .11em; margin-top: 2px; }
.my-link { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 30px; padding: 7px 14px; font-weight: 700; font-size: .875rem; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.my-link span { color: var(--pink); font-size: 1.35rem; line-height: 1; }
.my-link:hover, .outline-button:hover { background: var(--soft); }
.hero { min-height: 268px; margin-top: 24px; padding: 14px 14px 14px clamp(22px,3vw,42px); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: 21px; background: radial-gradient(ellipse at 23% 0%, #422447, #291932 62%, #21152d); color: white; border-radius: 24px; overflow: hidden; }
.hero-content { align-self: center; padding-block: 17px; }
.hero-pictures { min-width: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; align-self: stretch; }
.hero-panel { position: relative; min-height: 220px; overflow: hidden; border: 1px solid #e7bdd848; border-radius: 8px; background: #442a4e; }
.hero-panel:first-child { border-radius: 14px 8px 8px 14px; }
.hero-panel:last-child { border-radius: 8px 14px 14px 8px; }
.hero-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg,#29132b38,transparent 40%); }
.hero-panel img { position: absolute; inset: 0; display: block; height: 100%; width: 100%; object-fit: cover; }
.hero-panel-kasumi img { object-position: 100% 32%; }
.hero-panel-yukina img { object-position: 43% 32%; }
.hero-panel-tomori img { object-position: 18% 30%; }
.eyebrow { margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: .14em; }
.hero .eyebrow { color: #ffb3dc; }
.hero .eyebrow span { margin-right: 5px; }
.hero h1 { font-size: clamp(2.4rem, 4.35vw, 3.8rem); line-height: 1.05; letter-spacing: -.07em; margin: 10px 0 14px; font-weight: 900; }
.hero h1 em { color: var(--bright); font-family: Georgia, serif; font-weight: 800; white-space: nowrap; }
.hero p:last-child { margin: 0; color: #f2dcee; font-size: 1rem; line-height: 1.6; }
.pickers { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-block: 20px 16px; }
.picker, .ranking { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.picker { padding: 16px 19px; }
.picker h2 { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; font-size: .97rem; }
.picker-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--soft); color: var(--pink); font-size: 1rem; }
.options { display: grid; grid-auto-rows: minmax(60px,1fr); gap: 8px; }
.bands { grid-template-columns: repeat(4,minmax(0,1fr)); }
.characters { grid-template-columns: repeat(3,minmax(0,1fr)); }
.option { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); background: #fdfafd; color: #514453; border-radius: 9px; font-weight: 650; font-size: .875rem; line-height: 1.18; text-align: left; }
.option:hover { border-color: #d6a4c0; }
.option[aria-pressed="true"] { background: var(--soft); color: #95225e; border-color: #e6a4c9; }
.option-label { min-width: 0; overflow-wrap: anywhere; }
.option-icon { display: block; object-fit: contain; flex: 0 0 auto; }
.band-icon { width: 48px; height: 34px; }
.character-icon { width: 34px; height: 34px; border-radius: 50%; }
.workspace { margin-top: 26px; }
.gallery-heading { display: flex; gap: 12px; justify-content: space-between; align-items: end; margin-bottom: 13px; }
.gallery-heading .eyebrow { color: var(--pink); }
.gallery-heading h2 { margin: 5px 0 0; font-size: 1.87rem; line-height: 1.2; letter-spacing: -.03em; }
.result-count { white-space: nowrap; color: var(--muted); font-size: .875rem; padding-bottom: 2px; }
.filter-box { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; }
.segmented, .dropdowns { display: flex; gap: 5px; align-items: center; }
.segmented { border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #f2ebf2; }
.segmented button, .select select { min-height: 34px; white-space: nowrap; font-size: .875rem; border-radius: 7px; }
.segmented button { padding: 5px 11px; background: none; border: 1px solid transparent; color: #574d5c; }
.segmented button[aria-pressed="true"] { background: white; color: var(--pink); border-color: var(--line); font-weight: 750; box-shadow: 0 1px 3px #4c224311; }
.select { position: relative; }
.select::after { position: absolute; content: ""; border: solid #725e76; border-width: 0 1.5px 1.5px 0; width: 6px; height: 6px; transform: rotate(45deg); right: 11px; top: 41%; pointer-events: none; }
.select select { cursor: pointer; appearance: none; padding: 5px 25px 5px 9px; border: 1px solid var(--line); color: var(--ink); background: white; max-width: 100%; }
.cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: white; box-shadow: var(--shadow); min-width: 0; }
.card[data-picked="true"] { border-color: #c74690; box-shadow: 0 0 0 1px #c74690; }
.card-image { width: 100%; display: block; aspect-ratio: 1.76; padding: 0; position: relative; overflow: hidden; border: 0; background: #322139; }
.artwork { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-image .artwork { transition: transform .25s ease; }
.card-image:hover .artwork { transform: scale(1.04); }
.card-image:focus-visible { outline-offset: -4px; }
.card-stage { position: absolute; top: 8px; left: 8px; padding: 3px 7px; color: white; background: #23192de6; border-radius: 6px; font-size: .75rem; line-height: 1.35; font-weight: 700; }
.card-stage.trained { background: #852054ee; }
.image-missing { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #fff; font-size: .875rem; width: max-content; max-width: 90%; }
.card-info { display: flex; gap: 5px; align-items: center; justify-content: space-between; padding: 9px 9px 9px 11px; }
.card-copy { min-width: 0; }
.card-title { font-size: .875rem; font-weight: 800; margin: 0 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: .75rem; color: #605468; }
.stars { color: #9b5800; letter-spacing: .01em; }
.attribute-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--attribute); margin-right: 3px; }
.pick-button { flex: 0 0 32px; width: 32px; height: 32px; border: 1px solid #ebdce8; background: #fcf2f8; border-radius: 8px; color: var(--pink); font-size: 1.28rem; font-weight: 700; line-height: 1; }
.pick-button:hover, .pick-button[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: white; }
.ranking { padding: 16px; scroll-margin-top: 16px; }
.ranking-header { display: flex; align-items: center; gap: 9px; }
.ranking-heading { flex: 1; }
.ranking-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 10px; background: var(--soft); color: var(--pink); font-size: 1.65rem; line-height: 1; }
.ranking h2 { margin: 0; font-size: 1.13rem; line-height: 1.2; }
.ranking-header p { margin: 4px 0 0; font-size: .875rem; color: var(--muted); }
.progress { white-space: nowrap; border-radius: 20px; background: var(--soft); color: var(--pink); padding: 5px 9px; font-size: .875rem; font-weight: 750; }
.ranking ol { margin: 14px 0 12px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.rank-row { position: relative; min-width: 0; display: flex; flex-direction: column; overflow: clip; border: 1px solid var(--line); border-radius: 12px; background: white; }
.rank-row.empty { border-style: dashed; background: #fcf9fc; }
.rank-slot { display: grid; place-items: center; position: relative; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: #38273d; color: var(--ink); }
.rank-slot-button { user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.rank-slot-button:hover .artwork { filter: brightness(1.08); }
.rank-slot-button:focus-visible { outline-offset: -4px; }
.rank-row[data-key] .rank-slot-button { touch-action: none; }
.rank-slot .artwork { position: absolute; inset: 0; pointer-events: none; }
.rank-row.empty .rank-slot { flex: 1; background: transparent; }
.rank-row.empty .rank-slot-button:hover { background: var(--soft); }
.rank-placeholder { color: var(--pink); font-size: .875rem; font-weight: 750; }
.rank-num { position: absolute; top: 7px; left: 7px; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #ffffffaf; border-radius: 7px; color: #503955; background: #faeff8f2; box-shadow: 0 2px 6px #2f173134; font-size: .875rem; font-weight: 800; }
.rank-row.empty .rank-num { box-shadow: none; }
.rank-row:not(.empty):first-child .rank-num { color: #755010; background: #ffe7ae; }
.rank-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; padding: 3px; border-top: 1px solid var(--line); }
.rank-actions .icon-button { width: 100%; height: 33px; font-size: .875rem; white-space: nowrap; }
.rank-actions [data-action="remove"] { color: #945166; }
.rank-row[data-dragging="true"] { opacity: .45; }
.rank-row[data-drop-target="true"] { border-color: var(--pink); background: var(--soft); outline: 2px solid var(--pink); outline-offset: 1px; }
html.rank-dragging { scroll-behavior: auto; }
html.rank-dragging, html.rank-dragging * { cursor: grabbing; }
.rank-ghost { position: fixed; z-index: 10; inset: 0 auto auto 0; pointer-events: none; border: 1px solid var(--pink); border-radius: 11px; box-shadow: 0 8px 24px #34152943; }
.icon-button { width: 25px; height: 29px; padding: 0; border: 0; background: transparent; color: var(--pink); border-radius: 5px; line-height: 1; }
.icon-button:hover { background: var(--soft); }
.icon-button:disabled { color: #937f8f; opacity: .5; }
.ranking-tip, .saved { color: var(--muted); margin: 0; font-size: .875rem; line-height: 1.45; }
.ranking-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 15px; }
.ranking-footer .ranking-tip { margin-right: auto; }
.saved { font-size: .75rem; }
.text-button { border: 0; padding: 3px 0; background: none; color: var(--pink); font-size: .875rem; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button:disabled { color: var(--muted); }
.share-button, .outline-button { min-height: 39px; padding: 7px 12px; border-radius: 9px; font-size: .875rem; font-weight: 750; }
.share-button { background: var(--pink); color: white; border: 1px solid var(--pink); }
.share-button:hover:not(:disabled) { background: #8e1d57; }
.share-button:disabled { background: #f1e6ef; color: #745d71; border-color: #f1e6ef; }
.outline-button { background: #fff; border: 1px solid var(--line); color: var(--pink); }
.more { display: block; margin: 17px auto 0; }
.empty-gallery { text-align: center; border-radius: 14px; border: 1px dashed #d7b9cc; padding: 38px 12px; background: #fffafd; }
.empty-gallery span { font-size: 2rem; color: var(--pink); }
.empty-gallery p { margin: 6px 0 12px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-block: 22px; margin-top: 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.footer a:hover, .dialog-footer a:hover { text-decoration: underline; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; box-shadow: 0 4px 18px #220c2160; background: #322139; color: white; pointer-events: none; }
.toast:empty { display: none; }
dialog { width: min(900px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: 0 15px 60px #170b2577; }
dialog::backdrop { background: #1d1227bb; }
.dialog-header, .dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 15px; }
.dialog-header h2 { margin: 0; font-size: 1.05rem; }
.dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.close-dialog { font-size: 1.45rem; }
.full-image { position: relative; min-height: min(48vw, 320px); background: #2b1934; }
.full-image img { max-height: 68dvh; min-height: min(48vw, 320px); object-fit: contain; }
.dialog-footer a { font-size: .875rem; color: var(--pink); }
#rank-picker { width: min(980px,calc(100% - 24px)); height: min(780px,calc(100dvh - 32px)); overflow: hidden; }
#rank-picker[open] { display: flex; flex-direction: column; }
#rank-picker .dialog-header { flex-shrink: 0; }
#rank-picker-filters { padding: 0 15px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
#rank-picker-filters .filter-box { margin: 0 0 10px; }
.rank-picker-scroll { overflow-y: auto; min-height: 0; padding: 0 15px 18px; overscroll-behavior: contain; }
.rank-picker-scroll .result-count { margin: 10px 0 7px; }
.rank-picker-cards { grid-template-columns: repeat(3,minmax(0,1fr)); }
.rank-picker-option { padding: 0; color: var(--ink); text-align: left; }
.rank-picker-option:hover, .rank-picker-option[aria-current="true"] { border-color: var(--pink); }
.rank-picker-option[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--pink); }
.rank-picker-option:focus-visible { outline-offset: -3px; }
.rank-picker-option .card-info { min-height: 49px; }
.rank-picker-option .card-title { display: block; }
.picker-card-status { flex: 0 0 auto; padding: 3px 6px; border-radius: 6px; background: var(--soft); color: var(--pink); font-size: .75rem; }
#poster-dialog { width: min(1050px,calc(100% - 24px)); }
.poster-header h2 { font-size: 1.22rem; }
.poster-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 11px; padding: 1px 15px 13px; }
.poster-controls label { font-weight: 750; font-size: .875rem; }
.poster-controls input { min-width: 0; flex: 1; min-height: 39px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--ink); }
.poster-roles { min-inline-size: 0; margin: 0 15px 13px; padding: 7px 9px 9px; border: 1px solid var(--line); border-radius: 10px; }
.poster-roles legend { padding: 0 5px; color: var(--ink); font-size: .875rem; font-weight: 750; }
.poster-role-options { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,132px),1fr)); gap: 5px; max-height: 151px; padding: 3px; overflow-y: auto; }
.poster-role { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fdfafd; font-size: .875rem; line-height: 1.2; cursor: pointer; }
.poster-role:has(input:checked) { background: var(--soft); border-color: #e6a4c9; }
.poster-role input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--pink); }
.poster-role img { flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%; }
.poster-preview { background: #f2e9f0; padding: 14px 15px; text-align: center; }
.poster-preview p { margin: 0 auto 9px; color: var(--muted); font-size: .875rem; }
.poster-preview p:empty { display: none; }
.poster-preview canvas { display: block; width: 100%; height: auto; margin: auto; border-radius: 11px; }
.poster-preview button { margin-top: 10px; }
@media (max-width: 1120px) {
  .wrap { width: calc(100% - 48px); }
  .ranking { padding: 12px; }
  .cards { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .pickers { grid-template-columns: 1fr; gap: 9px; }
  .characters { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (max-width: 850px) {
  .site-header { position: sticky; top: 0; z-index: 1; }
  .wrap { width: calc(100% - 32px); }
  .hero { padding-left: 22px; }
  .characters { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ranking { scroll-margin-top: 84px; }
  .ranking ol { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .hero { grid-template-columns: minmax(0,1fr); gap: 12px; min-height: 0; padding: 18px 12px 12px; }
  .hero-content { padding: 3px 8px; }
  .hero-panel { min-height: clamp(92px,22vw,142px); }
  .bands { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ranking ol { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #rank-picker { inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  #rank-picker .dialog-header { padding-top: max(10px,env(safe-area-inset-top)); }
  #rank-picker .close-dialog { width: 44px; height: 44px; }
  .rank-picker-scroll { padding-bottom: max(18px,env(safe-area-inset-bottom)); }
  .rank-picker-cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  #rank-picker .filter-box { flex-wrap: wrap; }
  .rank-picker-option .card-info { flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .segmented button, .select select, .share-button, .outline-button { min-height: 44px; }
  .pick-button { flex-basis: 44px; width: 44px; height: 44px; }
  .rank-actions .icon-button { height: 44px; }
}
@media (max-width: 500px) {
  .site-bar { min-height: 61px; }
  .header-actions { gap: 5px; }
  .header-actions .my-link { padding-inline: 7px; }
  .header-actions .share-button { padding-inline: 7px; }
  .header-actions .share-button span, .brand small { display: none; }
  .hero { margin-top: 14px; border-radius: 16px; }
  .hero h1 { font-size: clamp(2rem,9vw,2.8rem); }
  .pickers { margin-block: 12px 16px; }
  .picker { padding: 11px; }
  .ranking-header { flex-wrap: wrap; }
  .ranking-heading { min-width: 80px; }
  #open-poster { margin-left: auto; }
  .filter-box { flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .card-info { padding: 6px; }
  .card-stage { top: 5px; left: 5px; }
}
@media (max-width: 430px) {
  .characters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-image .artwork { transition: none; }
}
