/* B · Sakura Night UI with H4 water-court wallpaper and static foreground petals. */
body.runner-ui .theme-control {display:flex;align-items:center;flex-shrink:0;margin:0}
body.runner-ui .theme-toggle {min-width:87px;border-radius:999px;gap:7px;clip-path:none}
body.runner-ui .theme-toggle svg {width:18px;height:18px;flex:none}
body.runner-ui .theme-moon {display:none}
body.runner-ui .theme-status {position:fixed;right:20px;top:115px;z-index:90;max-width:calc(100vw - 40px);padding:12px 16px;background:var(--paper);color:var(--ink);border:1px solid var(--accent);border-radius:5px;box-shadow:0 8px 30px #0003;font-size:14px}
html[data-theme="dark"] {color-scheme:dark;background:#10101a}
html[data-theme="dark"] body.runner-ui {
  --accent:#ff9bab;--accent-bright:#ca1b30;--ink:#f4eef5;--muted:#b7aebb;
  --line:#433744;--paper:#1e1a25;--soft:#292332;
  position:relative;isolation:isolate;min-height:100vh;color:var(--ink);background:#10101a;
}
html[data-theme="dark"] body.runner-ui::before {
  position:fixed;inset:0;height:auto;z-index:-2;
  background:linear-gradient(180deg,rgba(15,12,25,.16),rgba(15,12,25,.25) 60%,rgba(15,12,25,.5)),url("theme/dark-h4-petals-1080p.0fc0640c4ced.webp") center center/cover no-repeat;
  filter:contrast(.86) brightness(.95) saturate(.88);
}
/* Fine-sand glass: static grain, translucent coating and a restrained reflection. */
html[data-theme="dark"] body.runner-ui::after {
  content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background-image:url("theme/frosted-fine-grain.499038066030.svg"),linear-gradient(124deg,rgba(224,229,244,.09),rgba(158,162,185,.025) 44%,rgba(17,15,27,.12)),linear-gradient(rgba(38,36,46,.38),rgba(38,36,46,.38));
  background-repeat:repeat,no-repeat,no-repeat;background-size:180px 180px,cover,cover;
}
html[data-theme="dark"] body.runner-ui .theme-sun {display:none}
html[data-theme="dark"] body.runner-ui .theme-moon {display:block}
html[data-theme="dark"] body.runner-ui a:hover {color:#ffc7d1}
html[data-theme="dark"] body.runner-ui :is(a,button,input,select,textarea):focus-visible {outline-color:#ffa7ba}
html[data-theme="dark"] body.runner-ui .site-header {
  margin:22px 24px 0;border:1px solid #594051;border-radius:6px;
  background:rgba(25,21,33,.96);box-shadow:0 12px 32px #08061155;
}
html[data-theme="dark"] body.runner-ui .header-inner {padding:14px 24px}
html[data-theme="dark"] body.runner-ui .site-brand {color:var(--ink)}
html[data-theme="dark"] body.runner-ui .brand-mark {color:#e31b23}
html[data-theme="dark"] body.runner-ui .site-brand small {color:var(--muted)}
html[data-theme="dark"] body.runner-ui .nav-button {
  background:transparent;border-color:transparent;border-radius:4px;color:var(--ink);box-shadow:none;clip-path:none;
}
html[data-theme="dark"] body.runner-ui .nav-button:hover {background:#3b283b;border-color:#735163;color:#ffc1cf}
html[data-theme="dark"] body.runner-ui .nav-button.active {background:#c91c31;border-color:#e95068;color:#fff}
html[data-theme="dark"] body.runner-ui .nav-submit:not(.active) {background:transparent;border-color:transparent;color:var(--ink)}
html[data-theme="dark"] body.runner-ui .nav-submit:not(.active):hover {background:#3b283b;border-color:#735163;color:#ffc1cf}
html[data-theme="dark"] body.runner-ui .nav-account .player-link {border-color:transparent;background:transparent}
html[data-theme="dark"] body.runner-ui .nav-logout {color:var(--muted)}
html[data-theme="dark"] body.runner-ui .theme-toggle {border-color:#b96b83;background:#352330;color:#fff;border-radius:999px}
html[data-theme="dark"] body.runner-ui .message-alert {background:#ec2440;border:1px solid #f58a9b;box-shadow:0 0 0 2px #211b29}
html[data-theme="dark"] body.runner-ui .skip-link {background:var(--paper);color:var(--ink)}
html[data-theme="dark"] body.runner-ui .site-footer {background:rgba(25,21,33,.95);border:1px solid var(--line);border-radius:5px;box-shadow:0 6px 20px #08061130}
html[data-theme="dark"] body.runner-ui .site-footer a {background:var(--soft);border-color:var(--line);color:var(--ink);border-radius:4px}

/* Keep the full existing horizontal game images and their compact card sizes. */
html[data-theme="dark"] body.runner-ui .home-game-cover {background:var(--paper);border-color:#c88498;border-radius:5px;box-shadow:0 10px 25px #09070f66}
html[data-theme="dark"] body.runner-ui .home-art {background:var(--paper)}
html[data-theme="dark"] body.runner-ui .home-game-caption {background:rgba(27,23,33,.97);border-top:1px solid #b8788d;border-radius:0;color:var(--ink)}
html[data-theme="dark"] body.runner-ui .home-game-caption::before {display:none}
html[data-theme="dark"] body.runner-ui .home-game-title {color:var(--ink);letter-spacing:-.025em}
html[data-theme="dark"] body.runner-ui .home-game-year {color:#ffa3b7}
html[data-theme="dark"] body.runner-ui .home-game-action {color:#ff9bab}
html[data-theme="dark"] body.runner-ui .home-game-arrow {background:#c81e34;color:#fff;border-radius:4px}
html[data-theme="dark"] body.runner-ui .home-game-cover:hover {border-color:#ffc1d0;box-shadow:0 14px 28px #08061280}
html[data-theme="dark"] body.runner-ui .home-game-description {color:var(--muted)}

/* Almost opaque dark plum surfaces keep lists and forms readable on the scenery. */
html[data-theme="dark"] body.runner-ui :is(.profile-card,.activity-panel,.profile-run-panel,.card,.auth-card) {background:rgba(29,25,36,.97);border-color:var(--line);border-radius:5px;box-shadow:0 7px 24px #08061144}
html[data-theme="dark"] body.runner-ui .activity-heading {background:rgba(30,25,37,.98);border-bottom-color:#d2869b}
html[data-theme="dark"] body.runner-ui :is(.activity-heading h2,.latest-game h3 a,.profile-run-game h3>a,.empty-state strong) {color:var(--ink)}
html[data-theme="dark"] body.runner-ui .activity-heading h2::before {background:#e92d45}
html[data-theme="dark"] body.runner-ui .latest-game+.latest-game {border-color:var(--line)}
html[data-theme="dark"] body.runner-ui .activity-run {background:#24202c;border-color:var(--line);border-radius:4px}
html[data-theme="dark"] body.runner-ui .activity-run:hover {border-color:#846073}
html[data-theme="dark"] body.runner-ui .activity-runner {border-color:var(--line)}
html[data-theme="dark"] body.runner-ui :is(.activity-category,a.activity-level,.profile-run-category,.profile-run-level a,.overview-level-link,.run-project-links a,.run-detail dd>a:not(.player-link)) {background:#2b2533;border-color:#514251;color:#eee6ef;border-radius:4px}
html[data-theme="dark"] body.runner-ui span.activity-level {display:inline-flex;max-width:100%;width:auto;padding:5px 9px;border:1px solid #514251;background:#2b2533;color:#eee6ef;border-radius:4px;font-size:13px;line-height:1.5}
html[data-theme="dark"] body.runner-ui :is(.activity-category,a.activity-level,.profile-run-category,.profile-run-level a,.overview-level-link,.run-project-links a,.run-detail dd>a:not(.player-link)):hover {background:#432b3c;border-color:#ba778f;color:#ffd1dc}
html[data-theme="dark"] body.runner-ui :is(.time-link,.activity-time,.overview-time,.profile-run-time) {background:#3a222e;border-color:#b04963;color:#ffa2b5;border-radius:4px;box-shadow:none}
html[data-theme="dark"] body.runner-ui :is(.time-link,.activity-time,.overview-time,.profile-run-time):hover {background:#b61d38;border-color:#e9708c;color:#fff}
html[data-theme="dark"] body.runner-ui :is(.run-rank,.profile-run-meta) {color:#eee7f1}
html[data-theme="dark"] body.runner-ui .rank-gold .rank-trophy {color:#f2c45d}
html[data-theme="dark"] body.runner-ui .rank-silver .rank-trophy {color:#cdd6e3}
html[data-theme="dark"] body.runner-ui .rank-bronze .rank-trophy {color:#dda377}
html[data-theme="dark"] body.runner-ui .player-link {background:#292330;color:#eee6f0;border-color:#504052;border-radius:4px}
html[data-theme="dark"] body.runner-ui .player-link:hover {background:#412a3b;color:#ffd3dd;border-color:#b6778d}
html[data-theme="dark"] body.runner-ui .avatar-fallback {background:#542633;color:#ffced7}
html[data-theme="dark"] body.runner-ui :is(.activity-heading>span,.activity-runner time,.activity-empty,.activity-pagination,.overview-empty,.profile-game-count,.profile-run-date,.profile-run-pagination,.profile-no-rank,.rank-unavailable,.run-game-name,.profile-run-level span,.message-peer,.message-compose-actions span,.message-bubble small,.message-detail dt,.message-item small) {color:var(--muted)}

/* D3: The View sakura glass-gallery panorama for the Dark leaderboard masthead. */
html[data-theme="dark"] body.runner-ui .game-masthead {
  background:linear-gradient(90deg,rgba(22,17,29,.96),rgba(22,17,29,.85) 35%,rgba(22,17,29,.2) 75%,rgba(22,17,29,.08)),url("theme/d3-sakura-glass-banner.a4d062a1587b.webp") center center/cover no-repeat;
  border-color:#745366;border-bottom:3px solid #e195ab;border-radius:5px;
  box-shadow:0 8px 24px #08061144;
}
html[data-theme="dark"] body.runner-ui .game-masthead h1 {color:#fff3f6;text-shadow:0 2px 8px #080511cc}
/* Category names remain legible without a light-theme or solid-color backplate. */
html[data-theme="dark"] body.runner-ui .board-controls>nav[aria-label="分类"] {background:transparent}
html[data-theme="dark"] body.runner-ui .board-controls>nav[aria-label="分类"] .button {
  background:transparent;color:#f4eef5;border-color:#9d758b;box-shadow:none;
}
html[data-theme="dark"] body.runner-ui .board-controls>nav[aria-label="分类"] .button:is(.primary,:hover,:focus-visible) {
  background:transparent;color:#ffd0dd;border-color:#ff9bab;box-shadow:none;
}
html[data-theme="dark"] body.runner-ui .board-controls>nav[aria-label="分类"] .button.primary {box-shadow:inset 0 -2px 0 #ff9bab}
html[data-theme="dark"] body.runner-ui .section-eyebrow {color:#e6bdcb}
html[data-theme="dark"] body.runner-ui :is(.button,.level-picker button,.auth-card button) {background:#2b2533;border-color:#554452;color:#f0e7f1;border-radius:4px;clip-path:none;box-shadow:0 2px 0 #09071155}
html[data-theme="dark"] body.runner-ui :is(.button,.level-picker button,.auth-card button):hover {background:#432b3c;border-color:#b7778e;color:#ffd3de}
html[data-theme="dark"] body.runner-ui :is(.button.primary,.profile-run-tab.active,.settings-tabs a.active) {background:#bd1d35;border-color:#e35c77;color:#fff;box-shadow:0 2px 0 #570d25}
html[data-theme="dark"] body.runner-ui :is(.button.primary,.profile-run-tab.active,.settings-tabs a.active):hover {background:#d42542;border-color:#ff91a8;color:#fff}
html[data-theme="dark"] body.runner-ui :is(.level-picker,.leaderboard-table-scroll,.level-overview-scroll,.level-overview-caption) {background:var(--paper);border-color:var(--line);color:var(--ink);border-radius:5px}
html[data-theme="dark"] body.runner-ui table {background:#211c29;color:var(--ink)}
html[data-theme="dark"] body.runner-ui :is(th,td) {border-color:var(--line)}
html[data-theme="dark"] body.runner-ui thead th {background:#302638;color:#f9f0f7}
html[data-theme="dark"] body.runner-ui tbody tr:nth-child(even) {background:#28212f}
html[data-theme="dark"] body.runner-ui tbody tr:hover {background:#352638}
html[data-theme="dark"] body.runner-ui .overview-result+.overview-result {border-color:var(--line)}
html[data-theme="dark"] body.runner-ui .recent-runs .activity-run {border-color:var(--line);border-radius:0}

/* Profiles, all submission fields, login, and account settings. */
html[data-theme="dark"] body.runner-ui .profile-sidebar {background:rgba(29,25,36,.97);border-top-color:#dd7b98}
html[data-theme="dark"] body.runner-ui .profile-avatar {border-radius:7px;box-shadow:5px 5px 0 #473045}
html[data-theme="dark"] body.runner-ui .profile-links a {background:#2b2533;color:var(--ink);border-color:var(--line);border-radius:4px}
html[data-theme="dark"] body.runner-ui :is(.profile-run-tabs,.profile-runs-toolbar) {background:#26202e;border-color:#765368}
html[data-theme="dark"] body.runner-ui .profile-run-tab {background:#332a3c;color:var(--ink);border-color:#594755;border-radius:4px}
html[data-theme="dark"] body.runner-ui .profile-tab-count {background:#48384d;color:#eeddea}
html[data-theme="dark"] body.runner-ui .profile-run-tab.active .profile-tab-count {background:#ffe5ee;color:#92213c}
html[data-theme="dark"] body.runner-ui .profile-run-game+.profile-run-game {border-color:var(--line)}
html[data-theme="dark"] body.runner-ui .profile-run-row {background:#24202c;border-color:var(--line);border-radius:4px}
html[data-theme="dark"] body.runner-ui .profile-run-row:nth-of-type(even) {background:#2b2232}
html[data-theme="dark"] body.runner-ui .profile-run-video {background:#2b2533;color:#d6bfcf;border-color:var(--line);border-radius:4px}
html[data-theme="dark"] body.runner-ui .settings-tabs a {background:#312736;color:var(--ink);border-color:var(--line);border-radius:4px}
html[data-theme="dark"] body.runner-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {background:#292230;color:var(--ink);border-color:#725d73;border-radius:4px}
html[data-theme="dark"] body.runner-ui :is(input,select,textarea):hover {border-color:#a7869e}
html[data-theme="dark"] body.runner-ui :is(input,select,textarea)::placeholder {color:#a89aab;opacity:1}
html[data-theme="dark"] body.runner-ui input:-webkit-autofill {-webkit-text-fill-color:#f4eef5;box-shadow:0 0 0 1000px #292230 inset}
html[data-theme="dark"] body.runner-ui input::file-selector-button {background:#423047;color:#ffe2ec;border:1px solid #826079;border-radius:4px;padding:7px 10px;margin-right:10px;cursor:pointer}
html[data-theme="dark"] body.runner-ui :is(input[type=checkbox],input[type=radio]) {accent-color:#d74b72}
html[data-theme="dark"] body.runner-ui :is(.run-primary,.time-input-row) {background:#302333;border-color:var(--line)}
html[data-theme="dark"] body.runner-ui .badge {background:#453747;color:#ebd4e3;border-radius:4px}
html[data-theme="dark"] body.runner-ui .badge.approved {background:#193b31;color:#a9e9c7}
html[data-theme="dark"] body.runner-ui .badge.pending {background:#46341f;color:#ffda9b}
html[data-theme="dark"] body.runner-ui .badge.rejected {background:#4a2434;color:#ffb8c7}
html[data-theme="dark"] body.runner-ui .notice {background:#203a31;color:#d9f2e3;border-color:#54745f}
html[data-theme="dark"] body.runner-ui .errorlist {color:#ffafbf}
html[data-theme="dark"] body.runner-ui .time-part span {color:var(--muted)}
html[data-theme="dark"] body.runner-ui .submission-choice>a:hover {background:#382838}
html[data-theme="dark"] body.runner-ui .video {background:#090610}

/* Existing notification and private-message behavior is kept; style all dialog states. */
html[data-theme="dark"] body.runner-ui .message-dialog {background:#1e1926;color:var(--ink);border-color:#9c6982;border-radius:7px;box-shadow:0 24px 80px #05020bb3}
html[data-theme="dark"] body.runner-ui .message-dialog::backdrop {background:rgba(7,4,14,.68)}
html[data-theme="dark"] body.runner-ui .message-heading {background:#292031;border-bottom:1px solid #b77b96}
html[data-theme="dark"] body.runner-ui .message-heading button {color:#f6d9e5;border-color:#8b627a;border-radius:4px}
html[data-theme="dark"] body.runner-ui .message-heading #message-clear {color:#ffb3c6;border-color:#8b627a}
html[data-theme="dark"] body.runner-ui .message-heading button:hover {background:#553147}
html[data-theme="dark"] body.runner-ui .message-item {background:#292230;color:var(--ink);border-color:var(--line);border-radius:5px}
html[data-theme="dark"] body.runner-ui .message-item.unread {background:#3a2333;border-color:#8a536e;border-left:4px solid #ef7095}
html[data-theme="dark"] body.runner-ui .message-item:hover {background:#422c3d;border-color:#bf7995}
html[data-theme="dark"] body.runner-ui .message-bubble {background:#2b2636;border-color:#58455e;border-radius:5px 10px 10px 10px;color:var(--ink)}
html[data-theme="dark"] body.runner-ui .message-bubble.mine {background:#482a3e;border-color:#8e526f;border-radius:10px 5px 10px 10px}
html[data-theme="dark"] body.runner-ui :is(.message-footer,.message-compose) {background:#251e2d;border-color:#574254}
html[data-theme="dark"] body.runner-ui .message-peer a {background:#33283d;color:#ffc6d7;border-color:var(--line);border-radius:4px}
html[data-theme="dark"] body.runner-ui .message-error {background:#4c2435;color:#ffc5d2}

@media (max-width:760px) {
  html[data-theme="dark"] body.runner-ui .site-header {margin:12px 12px 0}
  html[data-theme="dark"] body.runner-ui .header-inner {padding:16px;gap:14px}
  html[data-theme="dark"] body.runner-ui .game-masthead {background-position:70% center}
  html[data-theme="dark"] body.runner-ui .site-footer {margin:0 12px}
}
@media (max-width:580px) {
  html[data-theme="dark"] body.runner-ui::before {background-position:72% center}
  html[data-theme="dark"] body.runner-ui .home-game-caption {min-height:150px}
  html[data-theme="dark"] body.runner-ui .home-game-title br {display:block}
}
@media (prefers-reduced-motion:reduce) {
  body.runner-ui :is(.button,.nav-button,.home-game-cover,.home-game-arrow) {transition:none}
}
