/* osuir: osu! community language with compact, content-first dark surfaces. */
:root {
    --page: #18171c; --surface: #242029; --surface-raised: #302a37;
    --surface-hover: #3a3242; --stroke: #4b4055; --text: #faf7fc;
    --muted: #b6acbf; --accent: #ff66aa; --accent-hover: #ff91c2;
    --ink: #23151e; --success: #8dd6ac; --warning: #ffcc80;
    --font-ui: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    --radius: 12px; --pill: 999px;
}
html { background: var(--page); color-scheme: dark; scrollbar-color: #71647d var(--page); }
body.theme-osuir { font-family: var(--font-ui); background: var(--page); color: var(--text); background-image: none; }
.theme-osuir .font-num { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.theme-osuir .glass-card { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; border-radius: var(--radius); box-shadow: none; }
.theme-osuir .glass-card .glass-card { background: var(--surface-raised); }
.theme-osuir [class*='blur-3xl'][class*='pointer-events-none'] { display: none; }
.theme-osuir .portal-header { background: #1e1b23; border-bottom: 1px solid #332d3b; }
.theme-osuir .portal-header > div:first-child { max-width: 1320px; height: 80px; }
.site-mark { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--ink); font-size: 20px; font-weight: 900; letter-spacing: -.04em; border: 2px solid #ffb7d6; flex-shrink: 0; }
.site-wordmark { font-size: 20px; line-height: 1.25; font-weight: 800; color: var(--text); }
.site-wordmark > span { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.theme-osuir .nav-link { position: relative; border-radius: var(--pill); padding: 10px 12px; font-size: 13px; color: var(--muted); }
.theme-osuir .nav-link svg { display: none; }
.theme-osuir .nav-link:hover { color: var(--text); background: var(--surface-raised); }
.theme-osuir .nav-link[aria-current] { color: var(--accent); background: #392635; }
.theme-osuir .portal-header a[href='/login'], .theme-osuir .portal-header a[href='/register'], .theme-osuir .header-profile { border-radius: var(--pill); }
.theme-osuir #player-search, .theme-osuir #player-search-mobile { background: var(--surface-raised); border: 1px solid transparent; border-radius: var(--pill); font-size: 14px; }
.theme-osuir #player-search:focus, .theme-osuir #player-search-mobile:focus { border-color: var(--accent); }
.theme-osuir #mobile-nav-drawer { background: #211d27; max-height: calc(100dvh - 80px); }
.theme-osuir #mobile-nav-drawer nav a { border-radius: 8px; }
.theme-osuir #mobile-nav-drawer a[aria-current] { color: var(--accent); background: #392635; }
.theme-osuir #main-content { max-width: 1280px; padding-top: 40px; padding-bottom: 48px; }
.theme-osuir .public-page > .glass-card { border-radius: var(--radius); }
.theme-osuir .public-page p { line-height: 1.8; }
.theme-osuir .text-slate-500, .theme-osuir .portal-footer { color: var(--muted); }
.theme-osuir .public-page h1 { letter-spacing: -.025em; }
.theme-osuir .portal-primary, .button-main {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 48px; padding: 12px 24px; background: var(--accent); background-image: none;
    color: var(--ink); font-size: 14px; line-height: 1.5; font-weight: 800; border-radius: var(--pill); border: 0; box-shadow: none;
}
.theme-osuir .portal-primary:hover, .button-main:hover { background: var(--accent-hover); filter: none; }
.button-main svg { width: 20px; height: 20px; }
.button-quiet { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 12px 20px; border: 1px solid #76667f; border-radius: var(--pill); color: var(--text); font-size: 14px; font-weight: 700; }
.button-quiet:hover { background: var(--surface-hover); border-color: var(--muted); }
.theme-osuir [data-auth-form] input:not([type=hidden]) { border-radius: 8px; background: #1c1921; border-color: #73657f; min-height: 50px; }
.theme-osuir [data-auth-form] input::placeholder { color: var(--muted); }
.theme-osuir [data-auth-form] button:disabled { opacity: .65; }
.theme-osuir .public-auth > .max-w-lg > .glass-card, .theme-osuir .public-auth > .glass-card { border-radius: 16px; padding: 32px; }
.theme-osuir .public-auth h1 { font-size: 28px; }
.theme-osuir .password-toggle { color: var(--accent-hover); }
.theme-osuir .start-playing { background: var(--surface); border: 0; border-radius: var(--radius); }
.theme-osuir .start-playing-steps a[aria-current] { background: #3a2837; outline: none; }
.theme-osuir .start-playing-number { background: #493041; color: #ffacd1; }
.theme-osuir .start-playing-shortcut { color: var(--accent-hover); }
.theme-osuir .public-download a[href^='/downloads/'] { border-radius: var(--pill); }
.theme-osuir .public-download h1 { font-size: clamp(30px, 4vw, 46px); }
.theme-osuir #game-platform { background: var(--surface-raised); border-radius: var(--pill); border-color: #73657f; }
.theme-osuir .client-guide { border-color: var(--stroke); padding-block: 16px; }
.theme-osuir .public-connect > header { padding-block: 8px; }
.theme-osuir .public-connect [data-copy] { border-radius: var(--pill); background: var(--surface-hover); }
.theme-osuir .portal-feedback { background: var(--surface-raised); border-color: #8b7d96; }
.theme-osuir .portal-footer { background: #141217; border-color: #332d3b; font-size: 12px; }
.theme-osuir .page-rankings table th { font-size: 12px; font-weight: 600; color: var(--muted); }
.theme-osuir .page-rankings table td { padding-block: 16px; }
.theme-osuir .page-rankings table tr:hover { background: var(--surface-hover); }
.theme-osuir .page-beatmaps > div:first-child { padding: 24px; }
.theme-osuir .page-beatmaps form button { background: var(--accent); color: var(--ink); border-radius: var(--pill); }
.theme-osuir .page-beatmaps input, .theme-osuir .page-beatmaps select { min-height: 48px; border-radius: var(--pill); }
.theme-osuir .page-player .glass-card:first-child { background: var(--surface-raised); }
.theme-osuir .page-player img { border-radius: 16px; }
.theme-osuir .public-page [class*='tracking-wider'] { letter-spacing: normal; }

.community-home { display: grid; gap: 32px; }
.community-welcome { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr); gap: 56px; align-items: center; padding-block: 12px 16px; }
.welcome-copy { min-width: 0; }
.welcome-copy h1 { margin: 0; font-size: clamp(40px, 4.5vw, 66px); font-weight: 800; line-height: 1.3; color: var(--text); }
.welcome-copy h1 bdi { color: var(--accent); }
.welcome-copy > p { max-width: 49ch; margin-block: 20px 24px; font-size: 17px; color: var(--muted); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.client-options { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; }
.client-options a { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; min-height: 44px; }
.client-options a > span:last-child { color: var(--muted); font-size: 12px; }
.client-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.client-dot-lazer { background: #7bc9e8; }
.session-panel { background: var(--surface); border-radius: var(--radius); padding: 20px; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { font-size: 20px; font-weight: 700; line-height: 1.5; }
.section-heading > a { color: var(--accent-hover); font-size: 12px; min-height: 32px; display: inline-flex; align-items: center; gap: 8px; }
.muted, .panel-caption { color: var(--muted); font-size: 13px; }
.panel-caption { margin-top: -12px; margin-bottom: 16px; }
.session-cover { position: relative; height: 160px; margin-inline: -20px; }
.session-cover img { width: 100%; height: 100%; object-fit: cover; }
.session-grade { position: absolute; bottom: 12px; left: 16px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #1b1720; color: var(--success); font-size: 24px; font-weight: 800; }
.session-map { display: block; font-size: 16px; font-weight: 700; margin-top: 16px; overflow-wrap: anywhere; }
.session-map > span { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 4px; }
.session-result { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 14px; }
.session-result strong { color: var(--accent-hover); }
.session-detail { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-top: 1px solid var(--stroke); margin-top: 16px; padding-top: 12px; font-size: 12px; color: var(--muted); }
.session-empty { text-align: center; padding-block: 12px 16px; }
.session-empty svg { color: var(--accent); width: 144px; height: 96px; margin: 0 auto 16px; }
.session-empty h3 { font-size: 20px; font-weight: 700; }
.session-empty p { color: var(--muted); font-size: 14px !important; margin-block: 8px 16px; }
.session-empty a { color: var(--accent-hover); font-size: 14px; display: inline-flex; align-items: center; min-height: 44px; }
.community-statistics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: var(--surface); border-radius: var(--radius); padding: 24px; }
.community-statistics > div { min-width: 0; padding-inline: 24px; border-inline-start: 1px solid var(--stroke); }
.community-statistics > div:first-child { border: 0; }
.community-statistics strong { display: block; font-size: clamp(22px,2vw,30px); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.community-statistics span { color: var(--muted); font-size: 13px; }
.data-note { color: var(--muted); font-size: 13px !important; margin-top: -20px; }
.community-content { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 32px; }
.recent-panel, .ranked-panel { min-width: 0; }
.recent-list { background: var(--surface); border-radius: var(--radius); padding-inline: 20px; }
.recent-row { display: flex; align-items: center; gap: 16px; padding-block: 16px; border-bottom: 1px solid #403649; }
.recent-row:last-child { border: 0; }
.score-grade { width: 28px; flex-shrink: 0; color: var(--success); font-size: 22px; font-weight: 800; text-align: center; }
.score-grade-top { color: #ffcc80; }
.recent-map { min-width: 0; flex: 1; }
.recent-map > a { display: block; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.recent-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.game-mods { color: var(--accent-hover); }
.recent-value { flex-shrink: 0; display: grid; text-align: left; gap: 4px; font-size: 12px; }
.recent-value strong { color: var(--accent-hover); font-size: 14px; }
.recent-value > span { color: var(--muted); }
.recent-value a { color: var(--muted); text-decoration: underline; min-height: 32px; display: inline-flex; align-items: center; }
.ranked-player { display: flex; align-items: center; gap: 12px; background: var(--surface); margin-bottom: 8px; padding: 14px 16px; border-radius: 8px; }
.ranked-player:hover { background: var(--surface-hover); }
.player-rank { width: 16px; flex-shrink: 0; font-size: 18px; color: var(--accent-hover); font-weight: 700; }
.ranked-player img { border-radius: 50%; flex-shrink: 0; }
.ranked-name { min-width: 0; flex: 1; }
.ranked-name strong { font-size: 14px; display: block; overflow-wrap: anywhere; }
.ranked-name > span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.ranked-pp { font-size: 13px; color: var(--accent-hover); flex-shrink: 0; }
.panel-footer-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-top: 8px; padding-inline: 16px; color: var(--muted); font-size: 13px; }
.list-empty { padding: 32px 20px; background: var(--surface); border-radius: var(--radius); }
.list-empty p { font-size: 14px !important; color: var(--muted); margin-bottom: 12px; }
.list-empty a { color: var(--accent-hover); font-size: 14px; display: inline-flex; align-items: center; min-height: 44px; }
.join-community { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 24px; border-top: 1px solid var(--stroke); }
.join-community h2 { font-size: 22px; font-weight: 700; }
.join-community p { color: var(--muted); font-size: 14px !important; margin-top: 8px; }
.theme-osuir a:focus-visible, .theme-osuir button:focus-visible { outline-color: var(--accent-hover); }
.theme-osuir .public-page ::selection { background: var(--accent); color: var(--ink); }
@media (max-width: 1100px) {
    .community-welcome { gap: 28px; }
    .community-content { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 767px) {
    .theme-osuir .portal-header > div:first-child { height: 72px; }
    .theme-osuir #mobile-nav-drawer { max-height: calc(100dvh - 72px); }
    .theme-osuir #main-content { padding-top: 24px; }
    .site-wordmark > span { display: none; }
    .community-welcome { grid-template-columns: minmax(0,1fr); gap: 28px; }
    .welcome-copy h1 { font-size: clamp(36px,8vw,52px); }
    .welcome-copy > p { font-size: 16px; }
    .community-statistics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 0; padding: 20px 8px; }
    .community-statistics > div { padding-inline: 16px; }
    .community-statistics > div:nth-child(3) { border: 0; }
    .join-community { align-items: stretch; flex-direction: column; }
    .theme-osuir .public-auth > .max-w-lg > .glass-card, .theme-osuir .public-auth > .glass-card { padding: 24px; }
}
@media (max-width: 480px) {
    .site-mark { width: 40px; height: 40px; font-size: 17px; }
    .site-wordmark { font-size: 16px; }
    .welcome-actions { flex-direction: column; }
    .client-options { gap: 12px; justify-content: space-between; }
    .community-statistics strong { font-size: 23px; }
    .recent-row { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 12px; }
    .recent-value { grid-column: 2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; text-align: start; }
    .recent-value a, .section-heading > a { min-height: 44px; }
    .ranked-player { padding: 12px; gap: 8px; flex-wrap: wrap; }
    .ranked-pp { margin-inline-start: auto; }
    .ranked-name { flex-basis: calc(100% - 84px); }
    .theme-osuir .public-auth h1 { font-size: 26px; }
}
@media (forced-colors: active) {
    .theme-osuir .portal-primary, .button-main, .button-quiet { background: ButtonFace; color: ButtonText; border: 1px solid ButtonText; }
    .theme-osuir .nav-link[aria-current] { color: LinkText; border: 1px solid Highlight; }
}
.beatmap-cover { overflow: hidden; background: var(--surface-raised); }
.beatmap-cover > img { width: 100%; height: 100%; object-fit: cover; }
.beatmap-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent,rgba(20,16,26,.94)); pointer-events: none; }
.beatmap-cover > div { z-index: 1; }
@media (max-width: 639px) {
    .theme-osuir .portal-header .portal-primary { padding-inline: 14px; }
    .theme-osuir .portal-header a[aria-label^='osuir'] { gap: 8px; }
    .theme-osuir .portal-header > div:first-child { gap: 8px; }
}
@media (scripting: none) {
    .theme-osuir .portal-header #mobile-nav-drawer { max-height: none; }
}
.theme-osuir .page-rankings a[class*='bg-gradient'], .theme-osuir .page-player a[class*='bg-gradient'] { background: var(--accent); color: var(--ink); box-shadow: none; }
@media (pointer: coarse) {
    .section-heading > a, .recent-value a { min-height: 44px; }
}
.profile-stat { padding: 16px 8px; text-align: center; border-bottom: 1px solid var(--stroke); }
.profile-level { padding-block: 16px; }
.profile-extra-stat { padding-block: 12px; border-top: 1px solid var(--stroke); }

/* Locale-aware reading order; game values and commands keep their own bidi isolation. */
.language-switch {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; min-height: 44px; padding: 8px 12px;
    flex-shrink: 0; border: 1px solid var(--stroke); border-radius: var(--pill);
    color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.language-switch:hover { background: var(--surface-raised); border-color: var(--accent); }
.recent-value { text-align: end; }
.session-grade { left: auto; inset-inline-start: 16px; }
@media (min-width: 1280px) {
    html[lang=en] .theme-osuir .nav-link { padding-inline: 9px; }
}

.theme-osuir .portal-header > div:first-child { max-width: 1536px; }
@media (max-width: 479px) {
    .theme-osuir .portal-header .header-auth-signup { display: none; }
    .theme-osuir .portal-header .header-profile { max-width: 76px; }
}
html[dir=ltr] .welcome-actions .button-main svg { transform: scaleX(-1); }
