:root {
    color-scheme: dark;
    --carbon-black: #1d1c1c;
    --cotton-bloom: #ee4ee8;
    --gunmetal-1: #3e3e3e;
    --gunmetal-2: #3c3c3c;
    --gunmetal-3: #454545;
    --bg: #151515;
    --panel: #252424;
    --panel-strong: var(--gunmetal-2);
    --panel-raised: var(--gunmetal-3);
    --text: #fff7fe;
    --muted: #c9bec8;
    --line: var(--gunmetal-3);
    --line-soft: var(--gunmetal-2);
    --accent: var(--cotton-bloom);
    --accent-strong: #ff79f8;
    --accent-deep: #ad2faa;
    --focus: var(--cotton-bloom);
}

@font-face {
    font-display: swap;
    font-family: "MFG PopMix";
    font-style: normal;
    font-weight: 700;
    src: url("ranks/DFG-PopMix-W5.ttf") format("truetype");
}

* {
    box-sizing: border-box;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(180deg, #151515 0%, #111 100%);
    color: var(--text);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("acquisition-pattern.png");
    background-repeat: repeat;
    background-size: 260px 260px;
    opacity: 0.28;
    filter: brightness(0);
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 68px;
    padding: 0 clamp(16px, 3vw, 32px);
    border-bottom: 1px solid rgb(238 78 232 / 0.18);
    background:
        linear-gradient(180deg, rgb(29 28 28 / 0.96), rgb(21 21 21 / 0.88)),
        rgb(29 28 28 / 0.94);
    box-shadow: 0 14px 34px rgb(0 0 0 / 0.24);
    backdrop-filter: blur(18px);
}

.brand-nav,
.brand,
.primary-nav,
.nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.brand {
    gap: 10px;
    min-height: 44px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0;
    text-decoration: none;
}

.brand:hover .brand-name,
.brand:focus .brand-name {
    color: var(--cotton-bloom);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cotton-bloom);
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    font-size: 1.42rem;
    font-weight: 900;
    line-height: 1;
    text-shadow:
        0 0 14px rgb(238 78 232 / 0.44),
        0 2px 0 rgb(0 0 0 / 0.55);
}

.brand-name {
    transition: color 150ms ease;
    white-space: nowrap;
}

.nav a,
.nav-user {
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
}

.nav a:hover {
    color: var(--text);
}

.primary-nav {
    padding-left: 8px;
    border-left: 1px solid rgb(255 255 255 / 0.08);
}

.nav {
    flex: 0 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown[open] {
    z-index: 30;
}

.nav-dropdown summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    padding: 7px 12px;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 150ms ease;
}

.nav-dropdown[open] summary,
.nav-dropdown summary:hover {
    border-color: rgb(238 78 232 / 0.28);
    background: rgb(238 78 232 / 0.08);
    color: var(--text);
}

.nav-dropdown[open] summary::after {
    transform: translateY(1px) rotate(225deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 10;
    display: grid;
    min-width: 188px;
    gap: 2px;
    border: 1px solid rgb(238 78 232 / 0.24);
    border-radius: 8px;
    background: rgb(37 36 36 / 0.98);
    box-shadow: 0 22px 70px rgb(0 0 0 / 0.46);
    padding: 7px;
}

.nav-dropdown-menu a {
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    padding: 9px 11px;
    text-decoration: none;
}

.nav-dropdown-menu a:hover {
    background: rgb(238 78 232 / 0.12);
    color: var(--text);
}

.nav-arcades .nav-dropdown-menu {
    width: max-content;
    max-width: min(320px, calc(100vw - 32px));
    max-height: min(400px, calc(100dvh - 190px));
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.nav-arcades summary {
    white-space: nowrap;
}

@media (min-width: 721px) and (max-width: 1050px) {
    .topbar:has(.nav-arcades) {
        flex-wrap: wrap;
        gap: 8px;
        padding-block: 12px;
    }

    .topbar:has(.nav-arcades) .brand-nav {
        flex-basis: 100%;
    }

    .topbar:has(.nav-arcades) .nav {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }
}

.nav-user {
    border: 1px solid rgb(238 78 232 / 0.32);
    border-radius: 999px;
    background: rgb(238 78 232 / 0.08);
    color: var(--text);
    font-weight: 800;
    padding: 7px 12px;
}

.nav > a:not(.nav-user) {
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    padding: 7px 10px;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.nav > a:not(.nav-user):hover,
.nav > a:not(.nav-user):focus {
    border-color: rgb(255 255 255 / 0.08);
    background: rgb(255 255 255 / 0.04);
}

.language-form {
    display: block;
}

.language-form select {
    min-height: 34px;
    border: 1px solid rgb(255 255 255 / 0.1);
    border-radius: 999px;
    background: rgb(255 255 255 / 0.04);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 6px 28px 6px 10px;
}

.language-form select option {
    background: var(--panel);
    color: var(--text);
}

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

.page {
    position: relative;
    z-index: 1;
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 160px);
    place-items: center;
}

.auth-panel,
.info-panel {
    width: min(100%, 440px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.34), 0 0 0 1px rgb(238 78 232 / 0.04);
}

.auth-panel {
    padding: 28px;
}

.auth-panel-wide {
    width: min(100%, 720px);
}

.section-heading {
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--cotton-bloom);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 2.6rem, 2.6rem);
    line-height: 1.08;
}

h2 {
    margin-bottom: 18px;
    font-size: 1rem;
}

form {
    display: grid;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--muted);
    font-size: 0.88rem;
}

input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

textarea {
    width: 100%;
    min-height: 132px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

input:focus,
textarea:focus,
.language-form select:focus {
    border-color: var(--focus);
    outline: 2px solid rgb(238 78 232 / 0.2);
}

.field-errors,
.form-errors {
    color: #ffbafc;
    font-size: 0.85rem;
}

.field-errors {
    display: grid;
    gap: 4px;
}

.form-errors {
    padding: 12px;
    border: 1px solid rgb(238 78 232 / 0.46);
    border-radius: 6px;
    background: rgb(238 78 232 / 0.11);
}

.form-errors p {
    margin: 0;
}

.primary-action {
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: #fff7fe;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.primary-action:hover {
    filter: brightness(1.08);
}

.primary-link,
.secondary-link,
.admin-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 700;
    text-decoration: none;
}

.primary-link {
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: #fff7fe;
}

.secondary-link,
.admin-actions a {
    border: 1px solid var(--line);
    color: var(--text);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.danger-action {
    min-height: 38px;
    border: 1px solid rgb(238 78 232 / 0.44);
    border-radius: 6px;
    background: rgb(238 78 232 / 0.1);
    color: #ffbafc;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 8px 12px;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-switch a {
    color: var(--cotton-bloom);
    font-weight: 700;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.message {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgb(238 78 232 / 0.38);
    border-radius: 6px;
    background: rgb(238 78 232 / 0.12);
}

.dashboard {
    padding-top: 24px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 20px;
}

.stat-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 78px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 18px 20px;
}

.stat-panel span {
    color: var(--muted);
}

.stat-panel strong {
    color: var(--cotton-bloom);
    font-size: 2.2rem;
    line-height: 1;
}

.news-panel,
.admin-news-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 60px rgb(0 0 0 / 0.24);
}

.news-panel {
    margin-bottom: 20px;
    padding: 22px;
}

.panel-heading,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-heading {
    margin-bottom: 18px;
}

.panel-heading .section-heading {
    margin-bottom: 0;
}

.carousel-controls {
    display: flex;
    gap: 8px;
}

.carousel-controls button,
.carousel-dots button {
    border: 1px solid var(--line);
    background: var(--carbon-black);
    color: var(--text);
    cursor: pointer;
}

.carousel-controls button {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    font-size: 1.5rem;
    line-height: 1;
}

.news-track {
    position: relative;
    min-height: 300px;
}

.news-slide {
    display: none;
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    align-items: stretch;
}

.news-slide.is-active {
    display: grid;
}

.news-slide:not(:has(.news-media)) {
    grid-template-columns: 1fr;
}

.news-media {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--carbon-black);
}

.news-media img,
.admin-news-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px;
}

.news-copy time,
.admin-news-copy time {
    color: var(--muted);
    font-size: 0.84rem;
}

.news-copy h3 {
    margin: 8px 0 12px;
    font-size: 1.7rem;
    line-height: 1.12;
}

.news-copy p,
.admin-news-copy p {
    color: var(--muted);
    margin-bottom: 0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.carousel-dots button {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    padding: 0;
}

.carousel-dots button.is-active {
    background: var(--cotton-bloom);
    border-color: var(--cotton-bloom);
}

.empty-state {
    display: grid;
    gap: 14px;
    place-items: center;
    min-height: 160px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

.empty-state p {
    margin-bottom: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 20px;
}

.info-panel {
    width: 100%;
    padding: 24px;
}

.account-page {
    width: min(760px, 100%);
    margin: 0 auto;
    padding-top: 24px;
}

.account-panel {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.28);
}

.account-row {
    border-bottom: 1px solid var(--line);
}

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

.account-row:not(details) > div {
    display: grid;
    gap: 4px;
    min-height: 74px;
    padding: 16px 20px;
}

.account-row summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 16px 20px;
}

.account-row summary {
    cursor: pointer;
    list-style: none;
}

.account-row summary::-webkit-details-marker {
    display: none;
}

.account-row summary > div,
.account-row:not(details) > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.account-row span {
    color: var(--muted);
    font-size: 0.88rem;
}

.account-row strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 1.05rem;
}

.row-action {
    flex: 0 0 auto;
    border: 1px solid rgb(238 78 232 / 0.4);
    border-radius: 6px;
    color: var(--cotton-bloom) !important;
    font-weight: 700;
    padding: 7px 10px;
}

.inline-form {
    display: grid;
    gap: 14px;
    padding: 0 20px 20px;
}

.inline-form .primary-action {
    justify-self: end;
    min-width: 160px;
}

.account-cards {
    width: 100%;
    margin-top: 20px;
}

.settings-page {
    width: min(760px, 100%);
    margin: 0 auto;
    padding-top: 24px;
}

.settings-panel {
    width: 100%;
}

.mode-stats-panel {
    width: 100%;
    margin-top: 20px;
}

.record-chart-panel {
    width: 100%;
    margin-top: 20px;
}

.settings-details {
    margin-bottom: 20px;
}

.settings-form {
    display: grid;
    gap: 16px;
}

.settings-form .primary-action {
    justify-self: end;
    min-width: 160px;
}

.rank-cell {
    min-width: 220px;
}

.profile-player-name {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.profile-rank-line {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.profile-character {
    display: inline-flex;
    width: 86px;
    max-width: 100%;
    line-height: 0;
}

.profile-character img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.3));
}

.rank-medal {
    position: relative;
    display: inline-block;
    width: min(200px, 100%);
    vertical-align: middle;
}

.rank-medal-base {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.28));
}

.rank-medal-janmusume {
    width: min(216px, 100%);
}

.rank-stars {
    position: absolute;
    top: -6px;
    left: 60%;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
}

.rank-star {
    width: 32px;
    height: auto;
    margin-left: -11px;
    filter: drop-shadow(0 2px 0 rgb(130 28 130 / 0.85));
}

.rank-stars-5 .rank-star {
    margin-left: -15px;
}

.rank-level {
    position: absolute;
    left: 135px;
    bottom: 10px;
    color: #fff;
    font-family: "MFG PopMix", "Yu Gothic", Meiryo, sans-serif;
    font-size: 1.17rem;
    font-weight: 700;
    line-height: 1;
    -webkit-text-stroke: 1px rgb(174 18 164);
    text-shadow:
        1px 1px 0 rgb(174 18 164),
        0 2px 0 rgb(174 18 164 / 0.55);
}

.rank-level strong {
    color: #fff;
    font: inherit;
    font-size: 1.45em;
}

.mode-tabs {
    display: grid;
    gap: 14px;
}

.mode-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-tab-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mode-tab-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

#mode-stat-yonma:checked ~ .mode-tab-list label[for="mode-stat-yonma"],
#mode-stat-sanma:checked ~ .mode-tab-list label[for="mode-stat-sanma"],
#mode-stat-nima:checked ~ .mode-tab-list label[for="mode-stat-nima"] {
    border-color: rgb(238 78 232 / 0.68);
    background: rgb(238 78 232 / 0.14);
    color: var(--text);
}

.mode-stat-panels {
    min-width: 0;
}

.record-chart-panels {
    min-width: 0;
}

.mode-stat-card {
    display: none;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--carbon-black);
    padding: 16px;
}

#mode-stat-yonma:checked ~ .mode-stat-panels .mode-stat-card-yonma,
#mode-stat-sanma:checked ~ .mode-stat-panels .mode-stat-card-sanma,
#mode-stat-nima:checked ~ .mode-stat-panels .mode-stat-card-nima {
    display: grid;
}

.record-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--carbon-black);
}

.record-chart-zero {
    stroke: rgb(255 255 255 / 0.14);
    stroke-dasharray: 5 7;
    stroke-width: 1;
}

.record-chart-line {
    fill: none;
    stroke: var(--cotton-bloom);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgb(238 78 232 / 0.35));
}

.record-chart-point circle {
    fill: #fff;
    stroke: var(--cotton-bloom);
    stroke-width: 2;
}

.record-chart-point image {
    filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.34));
}

.record-chart-range {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 8px;
}

.match-history-panel {
    width: 100%;
    margin-top: 20px;
}

.global-scores-panel {
    width: 100%;
}

.score-filter {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.score-filter-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.score-filter-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.score-filter-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
}

.global-scores-panel:has(#score-filter-all:checked) .score-filter-label[for="score-filter-all"],
.global-scores-panel:has(#score-filter-4:checked) .score-filter-label[for="score-filter-4"],
.global-scores-panel:has(#score-filter-3:checked) .score-filter-label[for="score-filter-3"],
.global-scores-panel:has(#score-filter-2:checked) .score-filter-label[for="score-filter-2"] {
    border-color: rgb(238 78 232 / 0.68);
    background: rgb(238 78 232 / 0.14);
    color: var(--text);
}

.global-scores-panel:has(#score-filter-4:checked) .global-match:not(.global-match-players-4),
.global-scores-panel:has(#score-filter-3:checked) .global-match:not(.global-match-players-3),
.global-scores-panel:has(#score-filter-2:checked) .global-match:not(.global-match-players-2) {
    display: none;
}

.global-match-list {
    display: grid;
    gap: 14px;
}

.score-pagination {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.score-page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.score-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

.score-page-link:hover,
.score-page-link:focus {
    border-color: rgb(238 78 232 / 0.68);
    color: var(--cotton-bloom);
}

.score-page-link.is-current {
    border-color: rgb(238 78 232 / 0.76);
    background: rgb(238 78 232 / 0.16);
    color: var(--text);
}

.score-page-link.is-disabled {
    color: var(--muted);
    opacity: 0.52;
}

.score-page-link.is-ellipsis {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.score-page-edge {
    min-width: 92px;
}

.global-match {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--carbon-black);
    padding: 16px;
}

.global-match-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.global-match-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
}

.global-match-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
    margin: 0;
}

.global-match-meta div {
    display: grid;
    gap: 3px;
    min-width: 74px;
    text-align: right;
}

.global-match-meta dt {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.global-match-meta dd {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
}

.global-score-table {
    min-width: 620px;
}

.ranking-panel {
    width: 100%;
}

.ranking-table {
    min-width: 720px;
}

.ranking-position {
    color: var(--cotton-bloom);
    font-size: 1rem;
    font-weight: 900;
}

.ranking-player-link {
    font-size: 1rem;
}

.ranking-character {
    display: inline-flex;
    width: 70px;
    max-width: 100%;
    line-height: 0;
}

.ranking-character img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 7px 14px rgb(0 0 0 / 0.28));
}

.ranking-dan-cell .rank-medal {
    width: min(176px, 100%);
}

.ranking-dan-cell .rank-medal-janmusume {
    width: min(190px, 100%);
}

.ranking-dan-cell .rank-star {
    width: 28px;
    margin-left: -10px;
}

.ranking-dan-cell .rank-stars-5 .rank-star {
    margin-left: -13px;
}

.ranking-dan-cell .rank-level {
    left: 116px;
    bottom: 8px;
    font-size: 0.98rem;
}

.global-player-cell {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.global-player-cell.is-focus .profile-link {
    color: var(--cotton-bloom);
}

.global-player-name {
    display: grid;
    gap: 2px;
}

.global-player-name small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
}

.global-player-character {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 6px;
    object-fit: cover;
    filter: drop-shadow(0 5px 10px rgb(0 0 0 / 0.28));
}

.profile-link {
    color: var(--text);
    font-weight: 800;
    text-decoration-color: rgb(238 78 232 / 0.58);
    text-underline-offset: 3px;
}

.profile-link:hover,
.profile-link:focus {
    color: var(--cotton-bloom);
}

.compact-empty-state {
    margin-top: 12px;
}

.mode-history-panels {
    min-width: 0;
}

.mode-history-panel {
    display: none;
}

#mode-stat-yonma:checked ~ .mode-history-panels .mode-history-panel-yonma,
#mode-stat-sanma:checked ~ .mode-history-panels .mode-history-panel-sanma,
#mode-stat-nima:checked ~ .mode-history-panels .mode-history-panel-nima {
    display: block;
}

.compact-heading {
    margin-top: 16px;
}

.compact-heading h3 {
    margin: 0;
    font-size: 1.15rem;
}

.placement-chart-wrap {
    overflow-x: auto;
}

.placement-chart {
    display: block;
    min-width: 620px;
    width: 100%;
    height: auto;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #171720;
}

.placement-chart-bg {
    fill: #101229;
}

.placement-chart-grid-row,
.placement-chart-grid-column {
    stroke: rgb(255 255 255 / 0.48);
    stroke-width: 1;
}

.placement-chart-glow {
    fill: url("#placementGlow");
}

.placement-chart-line {
    fill: none;
    stroke: var(--cotton-bloom);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5;
    filter: drop-shadow(0 0 5px rgb(238 78 232 / 0.36));
}

.placement-chart-point circle {
    fill: #fff;
    stroke: var(--cotton-bloom);
    stroke-width: 2;
}

.placement-chart-point image {
    filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.34));
}

.placement-chart-match-label {
    fill: #fff7fe;
    font-size: 19px;
    font-weight: 800;
    text-anchor: middle;
}

.placement-chart-place-label {
    dominant-baseline: middle;
    fill: #1c65ff;
    font-size: 18px;
    font-weight: 900;
}

.record-chart-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.record-chart-legend li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.record-chart-legend img {
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.record-table-wrap {
    overflow-x: auto;
    margin-top: 14px;
}

.record-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.record-table th,
.record-table td {
    border-bottom: 1px solid var(--line-soft);
    padding: 10px 12px;
    text-align: left;
}

.record-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.record-table td {
    color: var(--text);
    font-size: 0.92rem;
}

.record-table .place-1,
.placement-chart-place-label.place-1 {
    color: rgb(0 255 240);
    fill: rgb(0 255 240);
}

.record-table .place-2,
.placement-chart-place-label.place-2 {
    color: rgb(21 209 2);
    fill: rgb(21 209 2);
}

.record-table .place-3,
.placement-chart-place-label.place-3 {
    color: rgb(227 192 2);
    fill: rgb(227 192 2);
}

.record-table .place-4,
.placement-chart-place-label.place-4 {
    color: rgb(244 16 1);
    fill: rgb(244 16 1);
}

.record-table tbody tr:last-child td {
    border-bottom: 0;
}

.record-table-marks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.record-table-marks img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.inline-mode-stat-card {
    display: grid;
    margin-top: 16px;
}

.mode-stat-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mode-stat-card h3 {
    margin: 0;
    font-size: 1rem;
}

.mode-stat-card header span,
.mode-stat-summary dt,
.placement-list span {
    color: var(--muted);
    font-size: 0.82rem;
}

.mode-stat-card header strong {
    color: var(--cotton-bloom);
    font-size: 1.6rem;
    line-height: 1;
}

.mode-stat-summary {
    display: grid;
    gap: 8px;
    margin: 0;
}

.mode-stat-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mode-stat-summary dd {
    color: var(--text);
    font-weight: 700;
}

.placement-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.placement-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: rgb(255 255 255 / 0.025);
    padding: 6px 10px;
}

.placement-list strong {
    color: var(--text);
    font-size: 1.05rem;
}

.account-cards-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.account-cards-header h2 {
    margin-bottom: 0;
}

.card-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.card-add-form .form-errors,
.card-add-form .field-errors {
    grid-column: 1 / -1;
}

.card-add-form .field {
    display: contents;
}

.card-add-form .field label {
    grid-column: 1 / -1;
}

.card-add-form .field input {
    grid-column: 1;
}

.card-add-form .field .field-errors {
    grid-column: 1 / -1;
}

.details {
    display: grid;
    gap: 14px;
    margin: 0;
}

.details div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.details div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    text-align: right;
}

.card-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.card-list form {
    display: block;
}

.admin-page {
    padding-top: 24px;
}

.pcbid-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pcbid-actions a {
    text-decoration: none;
}

.pcbid-search {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.pcbid-search input {
    min-width: 0;
    flex: 1;
}

.pcbid-search button {
    background: var(--carbon-black);
    font: inherit;
    cursor: pointer;
}

.pcbid-table {
    min-width: 900px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.34), 0 0 0 1px rgb(238 78 232 / 0.04);
}

.pcbid-table code {
    white-space: nowrap;
    font-size: 0.8rem;
}

.pcbid-machine-name {
    display: block;
    overflow-wrap: anywhere;
}

.pcbid-description {
    min-width: 140px;
    max-width: 260px;
    overflow-wrap: anywhere;
}

.pcbid-form {
    max-width: 640px;
}

.pcbid-form select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--carbon-black);
    color: var(--text);
    font: inherit;
}

.pcbid-form select:focus-visible,
.pcbid-page a:focus-visible,
.pcbid-page button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

@media (max-width: 720px) {
    .pcbid-page .admin-header {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 20px;
    }

    .pcbid-search {
        flex-wrap: wrap;
    }

    .pcbid-search input {
        flex-basis: 100%;
    }

    .pcbid-table,
    .pcbid-table tbody {
        display: block;
        min-width: 0;
        border: 0;
    }

    .pcbid-table thead {
        display: none;
    }

    .pcbid-table tr {
        display: grid;
        gap: 14px;
        padding: 16px 0;
        border-bottom: 1px solid var(--line);
    }

    .pcbid-table td {
        display: grid;
        grid-template-columns: minmax(72px, 25%) minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        border: 0;
        padding: 0;
        overflow-wrap: anywhere;
    }

    .pcbid-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.78rem;
    }

    .pcbid-description {
        min-width: 0;
        max-width: none;
    }
}

.admin-list {
    display: grid;
    gap: 14px;
}

.admin-card-table {
    min-width: 640px;
}

.admin-card-owner {
    display: grid;
    gap: 2px;
    overflow-wrap: anywhere;
}

.admin-users-table {
    min-width: 760px;
}

.admin-user-email {
    max-width: 240px;
    overflow-wrap: anywhere;
}

.admin-user-section {
    margin-top: 20px;
}

.admin-user-section h2 {
    font-size: 1.15rem;
}

.admin-user-summary {
    margin: 8px 0 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.admin-user-section .form-grid > .form-errors {
    grid-column: 1 / -1;
}

.admin-user-section .danger-action {
    text-decoration: none;
}

.admin-user-permissions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.admin-user-permissions h3 {
    margin: 0;
    font-size: 1rem;
}

.admin-permission-choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    width: fit-content;
    cursor: pointer;
}

.admin-permission-choice input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    accent-color: var(--accent);
}

.arcade-table {
    min-width: 1160px;
}

.page:has(.arcade-admin-page) {
    width: min(1480px, calc(100% - 32px));
}

.arcade-flag {
    text-align: center;
}

.arcade-table td:nth-child(4) {
    min-width: 100px;
}

.arcade-current-pin {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.arcade-current-pin > span {
    color: var(--muted);
    font-size: 0.88rem;
}

.arcade-current-pin code {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.owner-picker {
    min-width: 0;
}

.owner-picker [hidden] {
    display: none;
}

.owner-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.owner-selected {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 5px 6px 5px 10px;
    border: 1px solid var(--accent-deep);
    border-radius: 6px;
    background: rgb(238 78 232 / 0.08);
}

.owner-selected > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.owner-selected button {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    min-height: 0;
    border: 0;
    border-radius: 4px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 20px;
}

.owner-selected button:hover {
    background: var(--gunmetal-2);
    color: var(--text);
}

.owner-picker-menu {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
}

.owner-picker-menu summary {
    min-height: 44px;
    padding: 10px 12px;
    cursor: pointer;
}

.owner-picker-options {
    padding: 0 12px 12px;
}

.owner-option-list {
    max-height: 220px;
    margin-top: 8px;
    overflow: auto;
}

.owner-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px;
    color: var(--text);
    overflow-wrap: anywhere;
    cursor: pointer;
}

.owner-option label:hover {
    background: var(--gunmetal-2);
}

.owner-option input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    accent-color: var(--accent);
}

.owner-empty,
.paseli-empty {
    color: var(--muted);
}

.arcade-paseli-section {
    min-width: 0;
    scroll-margin-top: 100px;
}

.arcade-paseli-section h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.paseli-balance-table {
    min-width: 620px;
}

.paseli-history-table {
    min-width: 860px;
}

.paseli-user-id,
.paseli-history-pcbid {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.paseli-credit-form {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.paseli-credit-form input[type="number"] {
    flex: 1 1 120px;
    min-width: 0;
}

.paseli-credit-form button {
    flex: 0 0 auto;
    min-height: 44px;
    font: inherit;
    background: var(--carbon-black);
    cursor: pointer;
}

.arcade-paseli-section td {
    overflow-wrap: anywhere;
}

.record-table .paseli-positive {
    color: #85e3b2;
}

.record-table .paseli-negative {
    color: #ff8989;
}

@media (max-width: 720px) {
    .arcade-flag {
        text-align: left;
    }

    .arcade-table td:nth-child(4) {
        min-width: 0;
    }

    .paseli-balance-table,
    .paseli-history-table {
        min-width: 0;
    }

    .arcade-paseli-section h2 {
        font-size: 1.1rem;
    }
}

.arcade-table td,
.arcade-machines-table td {
    overflow-wrap: anywhere;
}

.arcade-identity,
.arcade-owners {
    display: grid;
    gap: 4px;
}

.arcade-identity > span,
.arcade-machine-count {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 400;
}

.arcade-form {
    max-width: none;
}

.arcade-form select,
.pcbid-arcade-filter {
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    color: var(--text);
    font: inherit;
}

.arcade-form select {
    width: 100%;
}

.pcbid-arcade-filter {
    flex: 0 1 220px;
    max-width: 100%;
}

.arcade-form select:focus-visible,
.pcbid-arcade-filter:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.arcade-form select[multiple] {
    min-height: 150px;
}

.arcade-owners-field {
    grid-column: 1 / -1;
}

.arcade-options {
    display: grid;
    gap: 0;
}

.arcade-options label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    min-height: 52px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
}

.arcade-options input[type="checkbox"] {
    appearance: none;
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 22px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--gunmetal-2);
    cursor: pointer;
}

.arcade-options input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--muted);
}

.arcade-options input[type="checkbox"]:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.arcade-options input[type="checkbox"]:checked::before {
    transform: translateX(16px);
    background: var(--carbon-black);
}

.arcade-machines {
    min-width: 0;
}

.arcade-machines h2 {
    margin: 0;
    font-size: 1.2rem;
}

@media (max-width: 720px) {
    .arcade-table {
        min-width: 0;
    }

    .pcbid-arcade-filter {
        flex-basis: 100%;
    }

}

.page:has(.arcade-edit-page) {
    width: min(1240px, calc(100% - 48px));
    padding-top: 32px;
}

.arcade-edit-page {
    padding-top: 0;
}

.arcade-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.arcade-editor-heading > div {
    min-width: 0;
}

.arcade-editor-heading h1 {
    margin: 4px 0 8px;
    font-size: 1.8rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.arcade-editor-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.arcade-editor-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.arcade-editor-actions button {
    font: inherit;
}

.arcade-editor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: var(--muted);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.arcade-editor-tabs {
    display: flex;
    gap: 6px;
    max-width: 100%;
    margin-bottom: 28px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.arcade-editor-tabs a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 18px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.arcade-editor-tabs a:hover {
    background: rgb(255 255 255 / 0.03);
    color: var(--text);
}

.arcade-editor-tabs a.is-active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.arcade-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 21px;
    padding: 0 6px;
    border-radius: 4px;
    background: var(--gunmetal-2);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.arcade-edit-page [hidden] {
    display: none;
}

.arcade-panel {
    min-width: 0;
    margin-top: 28px;
    scroll-margin-top: 90px;
}

.arcade-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 48px;
}

.arcade-editor-column {
    display: grid;
    align-content: start;
    gap: 32px;
    min-width: 0;
}

.arcade-form-section {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.arcade-form-section legend {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 18px;
    padding: 0;
    font-size: 1rem;
    font-weight: 650;
}

.arcade-fields-grid,
.arcade-security-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.arcade-field-wide {
    grid-column: 1 / -1;
}

.arcade-fields-grid .field,
.arcade-security-grid .field {
    min-width: 0;
    align-content: start;
}

.arcade-savebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 24px;
    margin-top: 28px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.arcade-savebar .form-actions {
    margin: 0;
}

.arcade-dirty-state {
    margin-right: auto;
    color: var(--accent-strong);
    font-size: 0.82rem;
}

.arcade-panel-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin-bottom: 16px;
}

.arcade-panel-heading h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.1rem;
}

.arcade-panel .record-table-wrap {
    margin-top: 0;
}

.arcade-panel .record-table {
    box-shadow: none;
    font-variant-numeric: tabular-nums;
}

.arcade-paseli-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 28px;
}

.paseli-card-tool {
    position: sticky;
    top: 92px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.paseli-card-tool h2 {
    font-size: 1rem;
    line-height: 1.4;
}

.paseli-card-form {
    display: grid;
    gap: 16px;
}

.paseli-card-form .primary-action {
    width: 100%;
    margin-top: 2px;
}

.paseli-card-shortcut {
    display: none;
}

.arcade-edit-page :is(a, button, summary):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

@media (max-width: 1050px) {
    .arcade-paseli-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .paseli-card-tool {
        position: static;
        max-width: 560px;
    }

    .paseli-card-shortcut {
        display: inline-block;
        margin: 0 0 16px;
        color: var(--accent);
        font-size: 0.85rem;
    }
}

@media (max-width: 720px) {
    .page:has(.arcade-edit-page) {
        width: calc(100% - 24px);
        padding-top: 24px;
    }

    .arcade-editor-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 18px;
    }

    .arcade-editor-heading h1 {
        font-size: 1.5rem;
    }

    .arcade-editor-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .arcade-editor-actions a {
        padding: 8px 12px;
    }

    .arcade-editor-actions button {
        flex: 1;
        padding: 10px 12px;
    }

    .arcade-editor-tabs {
        gap: 0;
        margin-bottom: 24px;
    }

    .arcade-editor-tabs a {
        gap: 6px;
        padding-inline: 12px;
        font-size: 0.82rem;
    }

    .arcade-editor-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .arcade-fields-grid,
    .arcade-security-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .arcade-editor-column {
        gap: 28px;
    }

    .arcade-savebar .form-actions {
        flex-direction: row;
        width: 100%;
    }

    .arcade-savebar .primary-action {
        flex: 1;
        min-width: 0;
    }

    .arcade-panel-heading h2 {
        font-size: 1rem;
    }

    .paseli-card-tool {
        max-width: none;
        padding: 16px;
    }
}

.event-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin-bottom: 24px;
}

.event-filters > div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.event-type-filter {
    flex: 0 1 240px;
}

.event-search-filter {
    flex: 1 1 200px;
}

.event-filters label {
    color: var(--muted);
    font-size: 0.85rem;
}

.event-filters select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--carbon-black);
    color: var(--text);
    font: inherit;
}

.event-filters button {
    min-height: 44px;
    background: var(--carbon-black);
    font: inherit;
    cursor: pointer;
}

.events-admin-page :is(a, button, select, summary):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.admin-events-table {
    min-width: 760px;
    table-layout: fixed;
}

.admin-events-table th:nth-child(1) {
    width: 190px;
}

.admin-events-table th:nth-child(2) {
    width: 210px;
}

.event-identity,
.event-content {
    display: grid;
    gap: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.event-id {
    color: var(--muted);
    font-size: 0.78rem;
}

.event-kind {
    font-weight: 650;
}

.event-kind-error {
    color: #ff8989;
}

.event-kind-warning {
    color: #e6c46f;
}

.event-summary {
    margin: 0;
}

.event-context {
    display: grid;
    gap: 4px;
    margin: 0;
    font-size: 0.82rem;
}

.event-context > div {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.event-context dt {
    color: var(--muted);
}

.event-context dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.event-data {
    min-width: 0;
}

.event-data summary {
    width: fit-content;
    color: var(--accent);
    cursor: pointer;
}

.event-data pre {
    max-height: 360px;
    margin: 10px 0 0;
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--carbon-black);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
}

@media (max-width: 720px) {
    .events-admin-page .admin-header {
        gap: 12px;
    }

    .event-type-filter,
    .event-search-filter {
        flex-basis: 100%;
    }

    .admin-events-table {
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .admin-users-table {
        min-width: 0;
    }

    .admin-user-edit-page .admin-header {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .cards-admin-page .admin-header {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 20px;
    }

    .admin-card-table {
        min-width: 0;
    }
}

.admin-news-item {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
}

.admin-news-item img {
    height: 104px;
    border-radius: 6px;
}

.admin-news-copy h2 {
    margin: 5px 0 8px;
    font-size: 1.05rem;
}

.muted {
    color: var(--muted);
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 720px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .page {
        width: min(100% - 24px, 1040px);
        padding: 28px 0;
    }

    .auth-panel {
        padding: 22px;
    }

    .brand-nav,
    .nav {
        flex-wrap: wrap;
    }

    .brand-nav {
        justify-content: space-between;
    }

    .brand {
        min-height: 38px;
    }

    .brand-mark {
        font-size: 1.3rem;
    }

    .primary-nav {
        border-left: 0;
        padding-left: 0;
    }

    .nav {
        justify-content: flex-start;
        width: 100%;
        gap: 8px;
    }

    .language-form {
        flex: 1 1 120px;
    }

    .language-form select {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        left: 0;
        right: auto;
        margin-top: 4px;
        box-shadow: none;
    }

    .form-grid,
    .card-add-form,
    .dashboard-stats,
    .dashboard-grid,
    .mode-tab-list {
        grid-template-columns: 1fr;
    }

    .news-slide,
    .news-slide.is-active,
    .admin-news-item {
        grid-template-columns: 1fr;
    }

    .news-copy {
        min-height: 0;
    }

    .admin-actions,
    .form-actions,
    .panel-heading,
    .admin-header,
    .account-row > div,
    .account-row summary {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form .primary-action {
        justify-self: stretch;
    }

    .settings-form .primary-action {
        justify-self: stretch;
    }

    .card-list li {
        align-items: stretch;
        flex-direction: column;
    }

    .details div {
        align-items: flex-start;
        flex-direction: column;
    }

    dd {
        text-align: left;
    }

    .rank-cell {
        min-width: 0;
        width: 100%;
    }

    .profile-rank-line {
        justify-content: flex-start;
    }

    .global-match-header {
        flex-direction: column;
    }

    .global-match-meta {
        justify-content: flex-start;
    }

    .global-match-meta div {
        text-align: left;
    }

    .score-filter-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .score-pagination {
        grid-template-columns: 1fr;
    }

    .score-page-edge {
        width: 100%;
    }

    .global-score-table,
    .ranking-table {
        min-width: 0;
        border: 0;
        background: transparent;
    }

    .global-score-table thead,
    .ranking-table thead {
        display: none;
    }

    .global-score-table tbody,
    .ranking-table tbody {
        display: grid;
        gap: 10px;
    }

    .global-score-table tr,
    .ranking-table tr {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        border: 1px solid var(--line-soft);
        border-radius: 8px;
        background: rgb(255 255 255 / 0.025);
        padding: 10px;
    }

    .global-score-table td,
    .ranking-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 0;
        padding: 0;
        text-align: right;
    }

    .global-score-table td::before,
    .ranking-table td::before {
        content: attr(data-label);
        color: var(--muted);
        flex: 0 0 auto;
        font-size: 0.72rem;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
    }

    .global-score-table td:first-child,
    .ranking-table td:first-child {
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }

    .global-score-table td:first-child::before,
    .ranking-table td:first-child::before {
        display: none;
    }

    .ranking-dan-cell {
        align-items: flex-start;
    }

    h1 {
        font-size: 2rem;
    }
}
