.arcade-ranking { margin-top: 16px; }
.arcade-ranking h2 { margin-bottom: 8px; }
#ranking-empty { font-size: .9rem; margin: 0; }
#ranking-list { counter-reset: rank; list-style: none; max-height: 22rem; overflow: auto; margin: 0; padding: 0; }
#ranking-list li { counter-increment: rank; display: grid; grid-template-columns: 2.5ch minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid var(--line); }
#ranking-list li:last-child { border-bottom: 0; }
#ranking-list li::before { content: counter(rank, decimal-leading-zero); font: .8rem monospace; color: var(--muted); }
#ranking-list li:first-child::before { color: var(--gold); }
#ranking-list .rank-name { overflow-wrap: anywhere; }
#ranking-list a { margin-left: 8px; font-size: .8rem; color: var(--violet); }
#ranking-list b { color: var(--lime); font: bold 1rem monospace; }
#profile-dialog { width: min(460px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: clamp(16px, 4vw, 26px); }
#profile-dialog [hidden] { display: none; }
.profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1rem; }
#profile-close { font-size: 1.4rem; line-height: 1; padding: 4px 9px; }
#profile-form fieldset { min-width: 0; margin: 0 0 1rem; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--line); }
#profile-form legend, #profile-form label { font-size: .9rem; font-weight: 700; }
#profile-form label span { color: var(--muted); font-size: .8rem; font-weight: 400; }
#profile-form legend { margin-bottom: 8px; }
#profile-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.profile-option { position: relative; text-align: center; cursor: pointer; }
.profile-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-option .option-face { display: grid; justify-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 8px 2px; }
.profile-option input:checked + .option-face { color: var(--lime); border-color: var(--lime); background: #263024; }
.profile-option input:focus-visible + .option-face, #profile-dialog :focus-visible, #ranking-list :focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.profile-option canvas, #profile-image { width: 48px; height: 48px; image-rendering: pixelated; }
#profile-form .profile-upload, #profile-form label[for="profile-name"], #profile-form label[for="profile-link"] { display: block; margin: .7rem 0 4px; }
#profile-dialog input[type="file"] { max-width: 100%; font: inherit; font-size: .82rem; }
#profile-upload-preview { display: flex; align-items: center; gap: 10px; color: var(--lime); font-size: .82rem; margin-top: .4rem; }
#profile-dialog input[type="text"], #profile-dialog input[type="url"] { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 5px; color: inherit; background: var(--bg); padding: 9px; font: inherit; }
.profile-hint { font-size: .82rem; margin: 6px 0 0; }
#profile-error { color: #ffad9e; font-size: .9rem; margin: 8px 0; overflow-wrap: anywhere; }
#profile-error:empty { display: none; }
#profile-submit { width: 100%; margin-top: 15px; background: var(--lime); color: #161a11; font-weight: bold; }
#profile-submit:disabled { opacity: .65; }
