:root {
  --bg: #f4f7fb;
  --paper: #fff;
  --ink: #18202f;
  --muted: #687489;
  --line: #dbe3ee;
  --brand: #ff6a2a;
  --blue: #2377e8;
  --red: #ee4d5a;
  --green: #18a66a;
  --shadow: 0 18px 42px rgba(36, 60, 92, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.top { background: #172033; color: #dfe8f7; }
.bar, .page, .header-inner {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
}
.bar {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.header {
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(16px);
}
.header-inner {
  min-height: 84px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 26px; }
.mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
}
.search {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 2px solid var(--brand);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.search input { border: 0; min-height: 44px; padding: 0 12px; outline: none; }
.btn {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  text-align: center;
}
.btn.ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn.danger { background: var(--red); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.header-actions, .top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth-user { color: var(--muted); font-size: 13px; white-space: nowrap; }
.page { padding: 20px 0 48px; display: grid; gap: 18px; }
.hero, .panel, .card, .rank, .notice, .comment-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}
.hero { overflow: hidden; }
.hero-cover {
  min-height: 320px;
  padding: 34px;
  display: grid;
  align-content: center;
  gap: 14px;
  color: #fff;
  background: linear-gradient(105deg, rgba(17, 24, 39, .95), rgba(17, 24, 39, .48)), var(--hero-cover, linear-gradient(135deg, var(--brand), var(--blue)));
  background-size: cover;
  background-position: center;
}
h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1; }
.hero p { color: rgba(255, 255, 255, .86); font-size: 16px; line-height: 1.6; max-width: 680px; }
.muted, .card p, .rank span { color: var(--muted); line-height: 1.6; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 8px 12px; }
.chip.active { border-color: var(--brand); color: var(--brand); background: #fff1ea; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.search-hero {
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at top right, rgba(35, 119, 232, .18), transparent 30%),
    linear-gradient(135deg, rgba(255, 106, 42, .12), rgba(35, 119, 232, .1)),
    rgba(255, 255, 255, .96);
}
.search-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.search-sidebar,
.search-results-panel {
  display: grid;
  gap: 12px;
}
.search-sidebar {
  position: sticky;
  top: 104px;
}
.search-category-list {
  align-content: flex-start;
}
.search-empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
}
.search-empty strong {
  font-size: 20px;
  color: var(--ink);
}
.panel { padding: 16px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { overflow: hidden; box-shadow: none; transition: .18s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--brand); }
.thumb {
  height: 126px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 40px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  overflow: hidden;
}
.thumb img, .recent-thumb img, .cover img, .cover-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.info { padding: 12px; display: grid; gap: 8px; }
.rank-list { display: grid; gap: 8px; }
.rank-list.is-fixed-ten {
  grid-template-rows: repeat(10, minmax(0, 1fr));
  min-height: 620px;
}
.rank { box-shadow: none; padding: 10px; display: grid; gap: 4px; min-height: 54px; align-content: center; }
.rank.is-placeholder {
  border: 1px dashed var(--line);
  background: linear-gradient(180deg, #f8fbff, #f3f7fc);
  color: var(--muted);
}
.recent-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: center;
}
.recent-thumb {
  width: 74px;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}
.recent-info { min-width: 0; display: grid; gap: 5px; }
.recent-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
}
.detail-breadcrumb strong { color: var(--ink); }
.detail-hero {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: stretch;
}
.cover {
  min-height: 330px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 120px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  overflow: hidden;
}
.detail-info { padding: 32px; display: grid; align-content: center; gap: 18px; }
.detail-kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff1ea;
  color: #b8421d;
  font-size: 13px;
  font-weight: 800;
}
.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.detail-heading h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: .96;
}
.detail-back { white-space: nowrap; }
.detail-summary {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  max-width: 720px;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  display: grid;
  gap: 6px;
}
.stat b { display: block; font-size: 22px; color: var(--ink); }
.stat small { color: var(--muted); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.detail-panel h2 { margin-bottom: 10px; }
.save-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(16, 24, 39, .66);
}
.save-modal.is-open { display: grid; }
.save-modal-card {
  width: min(680px, 100%);
  max-height: 85vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(24, 32, 47, .28);
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 14px;
  overflow: hidden;
}
.save-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.save-modal-header h2 { margin: 0; }
.save-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.save-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  display: grid;
  gap: 6px;
}
.save-stat .muted { font-size: 13px; }
.save-stat b { font-size: 20px; color: var(--ink); }
.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(244,247,251,.98));
}
.site-footer-inner {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}
.site-footer-title,
.site-footer-meta,
.site-footer-link {
  margin: 0;
  font-size: 14px;
}
.site-footer-link a {
  color: var(--brand);
  font-weight: 700;
  transition: opacity .2s ease;
}
.site-footer-link a:hover {
  opacity: .75;
}

.about-hero {
  background:
    radial-gradient(circle at top right, rgba(35, 119, 232, .18), transparent 30%),
    linear-gradient(135deg, rgba(255, 106, 42, .12), rgba(35, 119, 232, .1)),
    rgba(255, 255, 255, .96);
}
.about-hero-inner {
  padding: 28px 8px;
  display: grid;
  gap: 10px;
}
.about-hero h1 {
  font-size: clamp(28px, 5vw, 42px);
}
.about-section {
  display: grid;
  gap: 16px;
}
.about-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.about-icon {
  font-size: 28px;
}
.about-section-head h2 {
  font-size: 22px;
  margin: 0;
}
.about-section-body {
  display: grid;
  gap: 14px;
  line-height: 1.8;
  color: var(--muted);
  font-size: 15px;
}
.about-section-body p {
  margin: 0;
  line-height: 1.9;
}
.about-section-body strong {
  color: var(--ink);
  font-weight: 700;
}
.about-tech-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.about-tech-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  display: grid;
  gap: 6px;
}
.about-tech-item strong {
  font-size: 18px;
}
.about-disclaimer-highlight {
  padding: 16px 20px;
  background: #fff1ea;
  border: 1px solid #ffd0c2;
  border-radius: 8px;
  color: #b8421d !important;
  font-weight: 600;
}
.about-disclaimer-highlight strong {
  color: var(--ink) !important;
  font-size: 16px;
  font-weight: 900;
}
.about-notice {
  display: grid;
  gap: 8px;
  padding: 14px 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.about-notice p {
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .about-tech-info {
    grid-template-columns: 1fr;
  }
  .site-footer-inner {
    justify-content: center;
    text-align: center;
  }
}
.save-list {
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}
.save-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  display: grid;
  gap: 10px;
}
.save-item-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.save-item-name {
  font-weight: 800;
  word-break: break-all;
  max-width: 70%;
}
.save-item-size {
  color: var(--muted);
  font-size: 13px;
}
.save-item-preview {
  font-family: monospace;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.save-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.save-empty {
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}
.save-detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .6);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.save-detail-card {
  width: min(640px, 100%);
  max-height: 80vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
}
.save-detail-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.save-detail-header h3 { margin: 0; }
.save-detail-key {
  padding: 12px 20px;
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  background: #f8fbff;
  border-bottom: 1px solid var(--line);
}
.save-detail-content {
  margin: 0;
  padding: 16px 20px;
  overflow: auto;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  background: #fff;
}
.save-detail-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.support-history-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 24, 39, .68);
}

.support-history-card {
  width: min(860px, 100%);
  max-height: 88vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(24, 32, 47, .28);
}

.support-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.support-history-header h2 {
  margin: 2px 0 0;
}

.support-history-kicker {
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.support-history-body {
  max-height: calc(88vh - 88px);
  overflow: auto;
  padding: 20px;
}

.support-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.support-history-summary div,
.support-history-feedback {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.support-history-summary span,
.support-history-feedback span {
  color: var(--muted);
  font-size: 12px;
}

.support-history-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-history-feedback {
  margin-bottom: 16px;
}

.support-history-feedback p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.support-history-messages .support-message-list {
  max-height: 48vh;
  overflow: auto;
  padding-right: 4px;
}

@media (max-width: 720px) {
  .support-history-modal {
    padding: 10px;
  }

  .support-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-history-body {
    padding: 14px;
  }
}

.notice { padding: 12px; background: #f8fbff; color: var(--muted); box-shadow: none; }
.notice.error { border-color: #ffd0c2; background: #fff1ea; color: #b8421d; }
.notice.success { border-color: #c7f2dd; background: #eaf8f1; color: var(--green); }
.comment-form, .form-grid { display: grid; gap: 12px; margin-top: 14px; }
.rating-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rating-choice input { position: absolute; opacity: 0; pointer-events: none; }
.rating-choice span {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}
.rating-choice input:checked + span { border-color: var(--brand); background: #fff1ea; color: #b8421d; }
textarea, input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 100px; resize: vertical; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.comment-list { display: grid; gap: 12px; margin-top: 16px; }
.comment-item { padding: 14px; background: #f8fbff; box-shadow: none; display: grid; gap: 8px; }
.comment-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.comment-author, .comment-rating { font-weight: 900; }
.comment-rating { color: #d35a1f; }
.auth-card {
  width: min(420px, 100%);
  margin: 8vh auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 14px;
}
.auth-card h1 { font-size: 34px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 8px; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 13px; }
.file { color: var(--muted); font-size: 13px; }
.cover-preview { width: 74px; height: 52px; border-radius: 6px; border: 1px solid var(--line); background: #f8fbff; }
.admin-actions { display: grid; gap: 8px; align-items: start; }
.admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8f2 0%, #ffffff 100%);
  padding: 16px;
  display: grid;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(24, 32, 47, .08);
}
.stat-card strong { font-size: 30px; line-height: 1; }
.stat-card span { color: var(--muted); font-size: 13px; }
.admin-inline-editor { margin-top: 12px; display: grid; gap: 10px; }
.admin-inline-editor label { display: grid; gap: 6px; }
.admin-inline-editor textarea { min-height: 86px; }
.dark-page {
  min-height: 100svh;
  background: radial-gradient(circle at 20% 0, rgba(255, 106, 42, .18), transparent 26%), #101827;
  color: #f8fbff;
}
.dark-page .page { padding-top: 18px; }
.dark-page[data-page="player"] .page {
  width: min(1680px, calc(100vw - 24px));
  gap: 12px;
  padding-top: 10px;
}
.dark-page[data-page="player"] .bar {
  width: 100%;
  min-height: 28px;
}
.dark-page .btn.ghost { background: #202c42; border-color: #2e3b53; color: #f8fbff; }
.player-layout {
  display: block;
}
.player-toolbar, .player-config {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.player-toolbar {
  display: grid;
  gap: 16px;
}
.player-toolbar-copy, .player-config-head {
  display: grid;
  gap: 6px;
}
.player-toolbar-copy h2, .player-config-head h2 { font-size: 20px; }
.player-toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #2e3b53;
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: #f8fbff;
}
.toggle input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}
.player-stage-stack {
  display: grid;
  gap: 0;
  width: 100%;
}
.player-stage-wrap {
  display: grid;
  gap: 0;
  width: 100%;
}
.player-stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.player-stage-copy {
  display: grid;
  gap: 6px;
}
.player-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 106, 42, .16);
  color: #ffb084;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.player-fullscreen-toggle {
  min-width: 132px;
}
.player-stage {
  position: relative;
  width: 100%;
  height: 78svh;
  min-height: 520px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(72, 91, 122, .56);
  background:
    radial-gradient(circle at 50% 0, rgba(64, 97, 162, .2), transparent 30%),
    linear-gradient(180deg, rgba(10, 16, 29, .86), rgba(4, 6, 14, .96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .04),
    0 28px 60px rgba(0, 0, 0, .34);
}
.player-shell, .stage {
  border: 1px solid #243047;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(15, 23, 38, .98), rgba(8, 12, 22, .98));
  min-height: auto;
  display: grid;
  padding: 18px;
  overflow: visible;
  position: relative;
}
.player-stage-stack .player-shell {
  border-radius: 28px 28px 0 0;
  border-bottom: 0;
  padding-bottom: 12px;
}
.player-toolbelt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px 18px;
  border: 1px solid #243047;
  border-top: 1px solid rgba(72, 91, 122, .32);
  border-radius: 0 0 28px 28px;
  background:
    linear-gradient(180deg, rgba(11, 18, 31, .98), rgba(8, 12, 22, 1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .03),
    0 18px 40px rgba(0, 0, 0, .18);
}
.player-toolbelt-copy {
  display: grid;
  gap: 4px;
}
.player-toolbelt-copy strong {
  color: #ffb084;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.player-toolbelt .muted {
  color: #95a6c5;
}
.player-tools-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.player-overlay-panel {
  position: absolute;
  top: 74px;
  right: 18px;
  width: min(360px, calc(100% - 36px));
  max-height: calc(78svh - 22px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 21, 34, .98), rgba(9, 14, 24, .96));
  border-color: #2e3b53;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .34);
  z-index: 7;
}
.player-shell.is-panel-open .player-overlay-panel {
  display: block;
}
.player-overlay-scroll {
  max-height: calc(78svh - 22px);
  overflow: auto;
  padding: 16px;
}
#ruffle-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
}
#ruffle-player > ruffle-player {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: block !important;
}
.player-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: 16px;
  border-radius: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}
.player-shell:fullscreen .player-stage-wrap {
  height: 100%;
}
.player-shell:fullscreen .player-stage {
  min-height: 0;
  height: 100%;
}
.player-shell:fullscreen #ruffle-player {
  min-height: 0;
  height: 100%;
}
#ruffle-player:fullscreen, #ruffle-player:fullscreen ruffle-player {
  width: 100%;
  height: 100%;
}
.player-toolbar .btn.is-active,
.player-fullscreen-toggle.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.login-modal, .sponsor-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(16, 24, 39, .66);
}
.login-modal.is-open, .sponsor-modal.is-open { display: grid; }
.modal-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(24, 32, 47, .28);
  padding: 22px;
  display: grid;
  gap: 12px;
}
.sponsor-image { width: 100%; max-height: 68vh; object-fit: contain; border-radius: 8px; background: #f8fbff; border: 1px solid var(--line); }
.stage img { width: 100%; height: 100%; max-height: 76svh; object-fit: contain; display: block; }

@media (max-width: 900px) {
  .header-inner, .layout, .detail-hero, .search-layout { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-strip, .stats { grid-template-columns: 1fr; }
  .header-actions { justify-content: flex-start; }
  .detail-heading { flex-direction: column; align-items: flex-start; }
  .detail-info { padding: 24px; }
  .player-stage-top { align-items: flex-start; flex-direction: column; }
  .search-sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .search { grid-template-columns: 1fr; }
  .dark-page[data-page="player"] .page {
    width: min(100vw - 12px, 100%);
    padding-top: 6px;
  }
  .player-shell { padding: 12px; border-radius: 22px; }
  .player-stage { height: 54svh; min-height: 320px; border-radius: 18px; }
  #ruffle-player { min-height: 0; height: 100%; }
  .player-overlay-panel {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-height: min(52svh, 420px);
    border-radius: 20px;
  }
  .player-overlay-scroll {
    max-height: min(52svh, 420px);
  }
  .player-toolbar-actions { width: 100%; }
  .player-toolbar-actions .btn,
  .player-toolbar-actions .toggle { width: 100%; }
  .player-tools-actions {
    width: 100%;
  }
  .player-tools-actions .btn {
    width: 100%;
  }
  .virtual-list { grid-template-columns: 1fr; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td, .admin-table th { display: block; }
  .admin-table th { display: none; }
  .admin-table td { border-bottom: 0; }
  .admin-table tr { border-bottom: 1px solid var(--line); padding: 10px 0; display: block; }
}

/* Player page: focused stage */
.player-page {
  min-height: 100svh;
  display: grid;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 106, 42, .22), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(35, 119, 232, .16), transparent 26%),
    linear-gradient(180deg, #09111b 0%, #04070d 72%);
  color: #f7fbff;
  overflow: hidden;
}
.player-page .top,
.player-page .header {
  display: none;
}
.player-page-shell {
  width: 100%;
  min-height: 100svh;
  min-height: 0;
  padding: 18px;
  display: grid;
}
.player-page-grid {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.player-stage-shell {
  width: min(1600px, 100%);
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}
.player-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding: 4px 2px 0;
}
.player-back {
  min-width: 96px;
}
.player-stage-header {
  min-width: 0;
  display: grid;
  align-items: start;
}
.player-stage-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.player-stage-copy h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: .94;
  letter-spacing: -.04em;
}
.player-stage-copy p {
  max-width: 760px;
  color: #93a4c0;
  font-size: 14px;
  line-height: 1.7;
}
.player-account {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 42px;
}
.player-account .auth-user,
.player-account .auth-link,
.player-account [data-logout] {
  white-space: nowrap;
}
.player-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.player-page .player-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: 18px;
  border: 1px solid rgba(142, 160, 190, .14);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(12, 18, 28, .96), rgba(5, 7, 11, .98)),
    #05070b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 28px 80px rgba(0, 0, 0, .42);
  overflow: hidden;
}
.player-stage-body {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px;
}
.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(100%, calc((100svh - 240px) * 16 / 9));
  max-width: 100%;
  max-height: 100%;
  justify-self: center;
  align-self: center;
  min-height: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(58, 84, 132, .16), transparent 42%),
    #000;
  border: 1px solid rgba(142, 160, 190, .14);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, .46),
    inset 0 0 0 1px rgba(255, 255, 255, .03);
}
.player-card-footer {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.player-fullscreen-toggle {
  min-width: 150px;
}
#ruffle-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}
#ruffle-player > ruffle-player {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  display: block !important;
}
.player-page .player-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: 16px;
  border-radius: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
}
.player-page .player-shell:fullscreen .player-stage-body {
  padding: 0;
}
.player-page .player-shell:fullscreen .player-frame {
  width: min(100%, calc((100svh - 112px) * 16 / 9));
  max-height: 100%;
  border-radius: 0;
}
.player-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #c6d2e6;
  text-align: center;
  line-height: 1.7;
}
.modal-card-player {
  width: min(460px, 100%);
  background: #101722;
  color: #f8fbff;
  border-color: rgba(142, 160, 190, .2);
}
.modal-card-player .muted {
  color: #b7c3d6;
}

@media (max-width: 720px) {
  .player-page-shell {
    padding: 10px;
  }
  .player-stage-shell {
    gap: 12px;
  }
  .player-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .player-account {
    justify-content: flex-start;
  }
  .player-actions {
    width: 100%;
    justify-content: stretch;
  }
  .player-actions .btn {
    flex: 1 1 140px;
  }
  .player-stage-copy h1 {
    font-size: clamp(24px, 8vw, 36px);
  }
  .player-page .player-shell {
    padding: 12px;
    border-radius: 24px;
  }
  .player-frame {
    width: 100%;
    border-radius: 18px;
  }
  .player-card-footer {
    justify-content: stretch;
  }
  .player-card-footer .btn {
    width: 100%;
  }
}

#ruffle-player {
  pointer-events: all;
  user-select: none;
}
#ruffle-player ruffle-player {
  pointer-events: all !important;
}
#ruffle-player ruffle-player::part(container) {
  pointer-events: all !important;
}

#ruffle-player ruffle-player::part(splash),
#ruffle-player ruffle-player::part(loading-indicator),
#ruffle-player ruffle-player::part(status) {
  display: none !important;
}

.player-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 30%, rgba(255, 106, 42, .12), transparent 55%),
    linear-gradient(180deg, rgba(5, 8, 15, .96), rgba(2, 4, 8, .98));
  transition: opacity .4s ease, visibility .4s ease;
}
.player-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-content {
  width: min(420px, calc(100% - 48px));
  display: grid;
  gap: 18px;
  text-align: center;
  color: #f7fbff;
}
.loading-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  justify-self: center;
}
.loading-icon svg {
  display: block;
  filter: drop-shadow(0 6px 18px rgba(255, 106, 42, .35));
}
.loading-progress-ring {
  transition: stroke-dashoffset .18s ease-out;
}
.loading-percent {
  position: absolute;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .02em;
  color: #ffb084;
}
.loading-text {
  display: grid;
  gap: 6px;
}
.loading-text strong {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .02em;
}
.loading-text .muted {
  color: #8fa0be;
  font-size: 13px;
}
.loading-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.loading-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8a50, #ff6a2a 50%, #ff4e7a);
  box-shadow: 0 0 16px rgba(255, 106, 42, .5);
  transition: width .2s ease-out;
}
.loading-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #7e8fb0;
  font-family: "Consolas", "Monaco", monospace;
}
