.page-template-page-ratings { background: #fff; color: var(--flat-ink); }
.page-template-page-ratings .site-header { background: #fff; border-bottom: 1px solid var(--color-border); }
.page-template-page-ratings .site-logo,
.page-template-page-ratings .site-nav a { color: #3e3e3e; }

.ratings-page .page-hero { min-height: 0; padding: 7rem 0 1.75rem; background: #fff; }
.ratings-page .page-hero > .container,
.ratings-page > .section > .container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: 2rem; }
.ratings-page > .section { padding: 1.75rem 0 5rem; }
.ratings-page .section-label { color: var(--flat-blue-dark); }
.ratings-page .page-title { color: var(--flat-ink); }
.ratings-page .page-title::after { content: ""; display: block; width: 72px; height: 6px; margin-top: .75rem; background: var(--flat-blue); }
.ratings-page .page-lead { margin-bottom: 0; }

.rating-game-picker { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; margin: 0 0 2.25rem; padding: 1rem 1.25rem; border: 1px solid var(--color-border); border-radius: 8px; background: #f8faf9; }
.rating-game-picker label { color: var(--flat-ink); }
.rating-game-picker select { min-width: min(100%, 280px); padding: .7rem 2.6rem .7rem .85rem; appearance: none; border: 1px solid #9aa6af; border-radius: 7px; color: var(--flat-ink); background-color: #fff; background-image: linear-gradient(45deg, transparent 50%, var(--flat-blue-dark) 50%), linear-gradient(135deg, var(--flat-blue-dark) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 11px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; font: inherit; cursor: pointer; }
.rating-game-picker select:hover { border-color: var(--flat-blue); }
.rating-game-picker select:focus-visible { outline: 3px solid rgba(34, 111, 168, .3); outline-offset: 2px; border-color: var(--flat-blue-dark); }

.aomel-rating-block { margin: 0; }
.rating-season-header { margin-bottom: 1.25rem; }
.rating-season-header h2 { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 0 0 .35rem; }
.rating-season-header p { margin: 0 0 .65rem; color: var(--flat-muted); }
.rating-past-notice { color: var(--flat-muted); }
.rating-status-badge { display: inline-block; padding: .25rem .65rem; border-radius: 999px; background: #e5e7eb; color: #4b5563; font-size: .8rem; font-weight: 700; }
.rating-status-badge.is-current { background: var(--flat-green-pale); color: var(--flat-green-dark); }
.rating-status-badge.is-fixed { background: #eef0f2; color: #59636d; }

.rating-track-tabs { display: flex; gap: .5rem; margin: 1rem 0 1.25rem; }
.rating-track-tabs a { padding: .55rem 1rem; border: 1px solid var(--flat-blue-dark); border-radius: 999px; color: var(--flat-blue-dark); background: #fff; text-decoration: none; font-weight: 700; }
.rating-track-tabs a:hover { background: var(--flat-blue-pale); }
.rating-track-tabs a.is-active { background: var(--flat-blue-dark); color: #fff; }

.rating-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 8px; overscroll-behavior-inline: contain; }
.rating-table-wrap:focus-visible { outline: 3px solid rgba(34, 111, 168, .3); outline-offset: 3px; }
.rating-table { width: 100%; min-width: 560px; table-layout: auto; border-collapse: collapse; background: #fff; font-variant-numeric: tabular-nums; }
.rating-table th,
.rating-table td { padding: .9rem 1rem; border-bottom: 1px solid var(--color-border); text-align: center; white-space: nowrap; }
.rating-table thead th { background: var(--flat-blue-dark); color: #fff; }
.rating-table .rating-col-rank,
.rating-table .rating-rank { width: 5.5rem; text-align: center; }
.rating-table .rating-col-name,
.rating-table tbody th { width: 32%; text-align: center; }
.rating-table tbody tr:last-child > * { border-bottom: 0; }
.rating-table tbody tr:nth-child(even) { background: #f8faf9; }
.rating-rank,
.rating-score { font-weight: 800; }
.rating-score { color: var(--flat-blue-dark); }
.rating-score a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rating-score a::after { content: " ↗"; font-size: .72em; }
.rating-score a:hover { text-decoration-thickness: 2px; }
.rating-delta { font-weight: 800; }
.rating-delta.is-positive { color: #08783e; }
.rating-delta.is-negative { color: #b42318; }
.rating-note { margin-top: 1rem; color: var(--flat-muted); font-size: .9rem; }
.rating-empty { padding: 3rem 1.5rem; border: 1px solid var(--color-border); border-radius: 8px; text-align: center; background: #f8faf9; }
.rating-season-list { display: grid; gap: 1rem; }
.rating-season-list article { padding: 1rem; border: 1px solid var(--color-border); border-radius: 8px; }

@media (max-width: 640px) {
    .ratings-page .page-hero { padding: 6rem 0 1.25rem; }
    .ratings-page .page-hero > .container,
    .ratings-page > .section > .container { padding-inline: 1rem; }
    .ratings-page > .section { padding-top: 1.25rem; }
    .rating-game-picker { align-items: stretch; flex-direction: column; margin-bottom: 1.75rem; }
    .rating-game-picker select { width: 100%; }
    .rating-table-wrap { width: 100%; overflow-x: visible; }
    .rating-table { min-width: 0; table-layout: fixed; font-size: clamp(.68rem, 3vw, .82rem); }
    .rating-table th,
    .rating-table td { padding: .7rem .2rem; }
    .rating-table thead th { line-height: 1.25; white-space: normal; }
    .rating-table .rating-col-rank,
    .rating-table .rating-rank { width: 13%; }
    .rating-table .rating-col-name,
    .rating-table tbody th { width: 29%; padding-right: .35rem; padding-left: .35rem; overflow-wrap: anywhere; white-space: normal; }
    .rating-table thead th:nth-child(3) { width: 19%; }
    .rating-table thead th:nth-child(4) { width: 17%; }
    .rating-table thead th:nth-child(5) { width: 22%; }
}
