:root {
    color-scheme: dark;
    --bg: #101217;
    --surface: #191c24;
    --surface-2: #222633;
    --line: rgba(255, 255, 255, 0.1);
    --text: #f7f8fb;
    --muted: #abb3c4;
    --pink: #ff5ea8;
    --cyan: #40d9ff;
    --yellow: #ffd166;
    --green: #72e8a4;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
}

.bmsdec-ranking-page {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    padding-bottom: 72px;
    margin-bottom: 72px;
}

.bmsdec-ranking-page > :last-child {
    margin-bottom: 0;
}

.bmsdec-ranking-page a,
.site-header a,
.site-footer a {
    color: inherit;
    text-decoration: none;
}

.bmsdec-ranking-page button,
.bmsdec-ranking-page input,
.bmsdec-ranking-page select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 56px;
    padding: 0 24px;
    background: rgba(16, 18, 23, 0.82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand,
.top-nav {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
    font-weight: 800;
}

.brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, var(--bg) 0 30%, transparent 31%),
        conic-gradient(from 210deg, var(--pink), var(--yellow), var(--cyan), var(--pink));
    box-shadow: 0 0 22px rgba(255, 94, 168, 0.45);
}

.top-nav {
    gap: 8px;
}

.top-nav a {
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
}

.top-nav a:hover,
.top-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.hero {
    position: relative;
    min-height: clamp(280px, 34vh, 380px);
    display: grid;
    align-items: end;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-bg,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-bg {
    background:
        linear-gradient(90deg, rgba(16, 18, 23, 0.96), rgba(16, 18, 23, 0.72) 42%, rgba(16, 18, 23, 0.28)),
        url("select-background-default.png") center / cover no-repeat;
    transform: scale(1.03);
}

.hero-overlay {
    background:
        linear-gradient(0deg, var(--bg) 0%, rgba(16, 18, 23, 0) 32%),
        radial-gradient(circle at 72% 24%, rgba(64, 217, 255, 0.18), transparent 28%),
        radial-gradient(circle at 48% 62%, rgba(255, 209, 102, 0.12), transparent 32%);
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 46px 0 40px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.bmsdec-ranking-page h1,
.bmsdec-ranking-page h2,
.bmsdec-ranking-page p {
    margin-top: 0;
}

.bmsdec-ranking-page h1 {
    margin-bottom: 8px;
    max-width: 760px;
    font-size: clamp(40px, 6vw, 80px);
    line-height: 0.94;
    letter-spacing: 0;
}

.home-title-link {
    color: inherit;
    text-decoration: none;
}

.home-title-link:hover,
.home-title-link:focus-visible {
    color: var(--text);
    text-shadow: 0 0 28px rgba(92, 224, 255, 0.34);
}

.bmsdec-ranking-page h2 {
    margin-bottom: 4px;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.08;
    letter-spacing: 0;
}

.search {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 90px auto;
    gap: 10px;
    width: min(760px, 100%);
    margin-top: 16px;
}

.search input,
.search select,
.search button {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.search input,
.search select {
    min-width: 0;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 0 14px;
    outline: none;
}

.search input:focus,
.search select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(64, 217, 255, 0.18);
}

.search button {
    border-color: transparent;
    background: var(--pink);
    color: white;
    padding: 0 22px;
    font-weight: 800;
    cursor: pointer;
}

.search button:hover {
    filter: brightness(1.08);
}

.section-head p,
.feed-item small,
.chart-list small,
.player-cell small,
.player-card span,
.chart-card span {
    color: var(--muted);
}

.section,
.notice {
    width: min(1280px, calc(100% - 40px));
    margin: 70px auto 0;
}

.notice {
    display: grid;
    gap: 4px;
    padding: 18px;
    background: rgba(255, 94, 168, 0.12);
    border: 1px solid rgba(255, 94, 168, 0.34);
    border-radius: 8px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-head.compact {
    margin-bottom: 14px;
}

.section-head code {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--yellow);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}

.section-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ranking-layout {
    width: min(1280px, calc(100% - 40px));
}

.ranking-table,
.feed,
.chart-list,
.players-grid,
.chart-grid {
    min-width: 0;
}

.ranking-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
}

.ranking-board {
    margin-top: 18px;
}

.ranking-board:first-of-type {
    margin-top: 0;
}

.ranking-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ranking-board-head strong {
    font-size: 16px;
}

.ranking-board-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.chart-stats div {
    min-width: 0;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.chart-stats span {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(20px, 2.4vw, 30px);
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-stats small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.home-activity {
    margin-top: 48px;
}

.home-pulse-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.home-pulse-grid div {
    min-width: 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.home-pulse-grid span {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-pulse-grid small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.chart-recent {
    width: min(1280px, calc(100% - 40px));
    margin: 70px auto 16px;
}

.chart-recent-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.chart-recent-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.chart-recent-item img,
.chart-recent-item .avatar-fallback {
    width: 36px;
    height: 36px;
}

.chart-recent-item img {
    object-fit: cover;
    border-radius: 50%;
    background: var(--surface-2);
}

.chart-recent-item strong,
.chart-recent-item span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-recent-item span {
    color: var(--muted);
    font-size: 12px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 42px 142px 118px 148px 84px 50px 50px 50px 50px 46px 50px 46px 120px 128px;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.ranking-row:last-child {
    border-bottom: 0;
}

.ranking-row-head {
    min-height: 38px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.ranking-row > span {
    min-width: 0;
}

.ranking-row > span:not(.player-cell) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-no {
    color: var(--yellow);
    font-size: 18px;
    font-weight: 900;
}

.player-cell,
.feed-item,
.player-card {
    display: flex;
    align-items: center;
}

.player-cell {
    gap: 8px;
    min-width: 0;
}

.player-cell small {
    font-size: 11px;
}

.player-cell strong,
.player-cell small,
.feed-item strong,
.feed-item span,
.feed-item small,
.chart-list span,
.chart-list small,
.player-card strong,
.player-card span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-cell img,
.feed-avatar img,
.player-card img,
.avatar-fallback {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.player-cell img,
.feed-avatar img,
.player-card img {
    object-fit: cover;
    background: var(--surface-2);
}

.player-cell img,
.player-cell .avatar-fallback {
    width: 34px;
    height: 34px;
}

.activity-badge {
    justify-self: start;
    width: fit-content;
    max-width: 100%;
    padding: 3px 7px;
    background: rgba(114, 232, 164, 0.12);
    border: 1px solid rgba(114, 232, 164, 0.34);
    border-radius: 6px;
    color: #b9ffd2;
    font-size: 11px;
    font-weight: 800;
}

.avatar-fallback {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--pink), var(--cyan));
    color: white;
    font-weight: 900;
}

.avatar-fallback.large,
.player-card img {
    width: 58px;
    height: 58px;
}

.empty-state {
    padding: 26px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.player-page-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.player-page-head img,
.player-page-avatar {
    flex: 0 0 auto;
    width: 82px;
    height: 82px;
    border-radius: 50%;
}

.player-page-head img {
    object-fit: cover;
    background: var(--surface-2);
}

.player-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 28px;
}

.player-stat-grid div {
    min-width: 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.player-stat-grid span {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-stat-grid small {
    color: var(--muted);
}

.player-play-count {
    margin-bottom: 20px;
}

.player-play-count-shell {
    min-width: 0;
    width: 100%;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.player-play-count-canvas {
    display: block;
    width: 100%;
    height: 220px;
    background: #11141c;
    border-radius: 6px;
}

.player-insights {
    margin-bottom: 20px;
}

.player-lamp-groups {
    display: grid;
    gap: 10px;
}

.player-lamp-group {
    min-width: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.player-lamp-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.player-lamp-group-head strong {
    font-size: 14px;
}

.player-lamp-group-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.player-lamp-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
}

.player-lamp-cell {
    min-width: 0;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.player-lamp-cell span,
.player-lamp-cell small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-lamp-cell span {
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.player-lamp-cell small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.player-mini-list {
    display: grid;
    gap: 10px;
}

.player-mini-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.player-mini-row.has-art {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
}

.player-mini-row:hover {
    border-color: rgba(64, 217, 255, 0.44);
}

.player-mini-row strong,
.player-mini-row span,
.player-score-body {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-mini-body,
.player-score-body {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.player-mini-row strong {
    font-size: 14px;
}

.player-mini-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.player-score-list {
    display: grid;
    gap: 10px;
}

.player-score-row {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.player-score-row.has-art {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.player-score-row:hover {
    border-color: rgba(64, 217, 255, 0.44);
    transform: translateY(-1px);
}

.player-score-row strong,
.player-score-row span,
.player-score-row small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-score-row span,
.player-score-row small {
    color: var(--muted);
}

.player-list-art {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
    background: var(--surface-2);
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
    gap: 28px;
    align-items: start;
}

.player-page-split.secondary {
    margin-top: 22px;
}

.feed,
.chart-list {
    display: grid;
    gap: 10px;
}

.feed-item {
    gap: 12px;
    min-width: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.feed-chart-art {
    position: relative;
    flex: 0 0 auto;
    width: 74px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: var(--surface-2);
}

.feed-chart-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chart-art-fallback {
    display: grid;
    place-items: center;
    padding: 8px;
    background:
        linear-gradient(135deg, rgba(64, 217, 255, 0.2), rgba(255, 94, 168, 0.16)),
        var(--surface-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-card-art.chart-art-fallback,
.chart-list-art.chart-art-fallback,
.player-list-art.chart-art-fallback,
.chart-page-art.chart-art-fallback {
    display: grid;
    place-items: center;
}

.chart-art-fallback span {
    color: rgba(247, 248, 251, 0.9);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
}

.feed-avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    margin-left: -24px;
    align-self: flex-end;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    z-index: 1;
}

.feed-avatar .avatar-fallback {
    width: 100%;
    height: 100%;
}

.chart-list a,
.chart-card {
    display: grid;
    gap: 2px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.chart-card.has-art {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.chart-list a.has-art {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.popular-chart-list a {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.popular-chart-list a.has-art {
    grid-template-columns: minmax(0, 1fr) auto;
}

.popular-chart-list .chart-list-main {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.popular-chart-list a:not(.has-art) .chart-list-main {
    grid-template-columns: minmax(0, 1fr);
}

.chart-card-body,
.chart-list .chart-list-body {
    display: grid;
    min-width: 0;
    gap: 2px;
    overflow: visible;
    white-space: normal;
}

.chart-card-body strong {
    color: var(--text);
}

.chart-card-body > span {
    color: var(--muted);
}

.chart-list-count {
    display: grid;
    justify-items: end;
    min-width: 86px;
    color: var(--text);
    text-align: right;
}

.chart-list-count strong {
    display: block;
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 900;
    line-height: 0.95;
}

.chart-list-count small {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.chart-card-art,
.chart-list-art {
    width: 86px;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
    background: var(--surface-2);
}

.chart-page-head {
    align-items: center;
}

.chart-title-row {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 16px;
}

.chart-title-row > div {
    min-width: 0;
}

.chart-artist-line {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.chart-difficulty-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chart-difficulty-line span {
    min-width: 0;
    padding: 4px 8px;
    background: rgba(169, 179, 203, 0.1);
    border: 1px solid rgba(169, 179, 203, 0.22);
    border-radius: 6px;
    color: rgba(247, 248, 251, 0.84);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
}

.chart-difficulty-line .diff-beginner,
.chart-difficulty-line .rank-easy {
    background: rgba(114, 232, 164, 0.22);
    border-color: rgba(114, 232, 164, 0.52);
    color: #e5ffed;
}

.chart-difficulty-line .diff-normal,
.chart-difficulty-line .rank-normal {
    background: rgba(64, 217, 255, 0.22);
    border-color: rgba(64, 217, 255, 0.52);
    color: #ecfbff;
}

.chart-difficulty-line .diff-hyper {
    background: rgba(255, 177, 86, 0.24);
    border-color: rgba(255, 177, 86, 0.56);
    color: #fff0d8;
}

.chart-difficulty-line .diff-another,
.chart-difficulty-line .rank-hard {
    background: rgba(255, 102, 112, 0.24);
    border-color: rgba(255, 102, 112, 0.56);
    color: #ffe4e6;
}

.chart-difficulty-line .diff-insane,
.chart-difficulty-line .rank-very-hard {
    background: rgba(181, 145, 255, 0.26);
    border-color: rgba(181, 145, 255, 0.58);
    color: #f0eaff;
}

.chart-difficulty-line .rank-very-easy {
    background: rgba(103, 151, 255, 0.24);
    border-color: rgba(103, 151, 255, 0.54);
    color: #edf3ff;
}

.chart-difficulty-line .badge-ln {
    background: rgba(255, 209, 102, 0.22);
    border-color: rgba(255, 209, 102, 0.5);
    color: #fff3cc;
}

.chart-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.chart-meta-line span {
    min-width: 0;
}

.chart-meta-line span:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: rgba(169, 179, 203, 0.58);
}

.bmsdec-ranking-page .chart-bpm-line {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.chart-page-art {
    flex: 0 0 auto;
    width: 200px;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-2);
}

.chart-list a:hover,
.chart-card:hover,
.player-card:hover {
    border-color: rgba(64, 217, 255, 0.44);
    transform: translateY(-1px);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.analysis-summary div {
    min-width: 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.analysis-summary span {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-summary small {
    color: var(--muted);
}

.analysis-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.analysis-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.analysis-legend i {
    display: inline-block;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.analysis-legend .legend-note { background: #40d9ff; }
.analysis-legend .legend-scratch { background: #ff4d4d; }
.analysis-legend .legend-ln { background: #72e8a4; }
.analysis-legend .legend-density-mid { background: #ffd166; }
.analysis-legend .legend-density-peak { background: #ff5ea8; }
.analysis-legend .legend-bpm { background: #ffd166; border-radius: 2px; }
.analysis-legend .legend-stop { background: #ff5ee8; border-radius: 2px; }

.analysis-canvas-shell {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.analysis-canvas {
    display: block;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    height: 360px;
    background: #11141c;
    border-radius: 6px;
}

.analysis-hotspots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.analysis-hotspots[hidden] {
    display: none;
}

.analysis-hotspots span {
    min-width: 0;
    padding: 6px 9px;
    background: rgba(255, 94, 168, 0.12);
    border: 1px solid rgba(255, 94, 168, 0.32);
    border-radius: 6px;
    color: #ffd7e8;
    font-size: 12px;
    font-weight: 700;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.player-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.player-card dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin: 0;
}

.player-card dl div {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.player-card dt {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.player-card dd {
    margin: 0;
    font-weight: 800;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    width: min(1280px, calc(100% - 40px));
    margin: 70px auto 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 980px) {
    .split-layout,
    .chart-stats,
    .home-pulse-grid,
    .analysis-summary,
    .player-lamp-grid,
    .player-stat-grid,
    .player-insights,
    .chart-recent-list,
    .players-grid,
    .chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ranking-table {
        overflow-x: auto;
    }

    .ranking-row {
        min-width: 1240px;
    }

    .split-layout > aside {
        grid-column: 1 / -1;
    }

    .chart-list-count {
        min-width: 72px;
    }
}

@media (min-width: 981px) {
    .ranking-table {
        overflow-x: hidden;
    }
}

@media (max-width: 700px) {
    .site-header {
        padding: 0 16px;
        min-height: 52px;
    }

    .top-nav {
        display: none;
    }

    .hero {
        min-height: 340px;
    }

    .hero-content,
    .section,
    .notice,
    .site-footer {
        width: min(100% - 28px, 1280px);
    }

    .hero-content {
        padding-top: 40px;
        padding-bottom: 36px;
    }

    .search,
    .split-layout,
    .chart-stats,
    .home-pulse-grid,
    .analysis-summary,
    .player-stat-grid,
    .player-insights,
    .chart-recent-list,
    .players-grid,
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .popular-chart-list a,
    .popular-chart-list a.has-art {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .popular-chart-list .chart-list-main {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
    }

    .chart-list-art {
        width: 72px;
    }

    .chart-list-count {
        min-width: 58px;
    }

    .player-lamp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analysis-canvas {
        height: 300px;
    }

    .section-head,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-title-row {
        align-items: flex-start;
        gap: 12px;
    }

    .chart-page-art {
        width: 112px;
    }

    .chart-list a.has-art,
    .chart-card.has-art {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
    }

    .chart-card-art,
    .chart-list-art {
        width: 72px;
    }

    .bmsdec-ranking-page {
        padding-bottom: 48px;
        margin-bottom: 48px;
    }
}
