: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 { box-shadow: none; padding: 10px; display: grid; gap: 4px; }
.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; }
.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; }
.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-message {
  padding: 0 4px 2px;
}
.virtual-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.virtual-controls.is-editing {
  background: linear-gradient(180deg, rgba(7, 10, 17, .12), rgba(7, 10, 17, .2));
}
.virtual-key {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 24px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .3), rgba(35, 119, 232, .28) 38%, rgba(5, 8, 18, .88));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  color: #fff;
  display: grid;
  place-items: center;
  gap: 2px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.virtual-key span {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.virtual-key small {
  font-size: 10px;
  color: rgba(255, 255, 255, .72);
  line-height: 1;
}
.virtual-key.is-pressed {
  transform: translate(-50%, -50%) scale(.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.virtual-controls.is-editing .virtual-key {
  border-style: dashed;
  border-color: rgba(255, 255, 255, .42);
}
.virtual-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.virtual-item {
  border: 1px solid #2e3b53;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.virtual-item input[type="range"] {
  padding: 0;
  min-height: auto;
}
.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 {
  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;
  overflow: hidden;
  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-message {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: 100%;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(35, 119, 232, .14);
  color: #8ec5ff;
  white-space: nowrap;
}
.player-message.error {
  background: rgba(238, 77, 90, .14);
  color: #ffb199;
}
.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%;
  }
  .player-message {
    justify-self: stretch;
    width: 100%;
    text-align: center;
    white-space: normal;
  }
}
