:root {
  color-scheme: dark;
  --ink-950: #0c0f10;
  --ink-900: #111516;
  --ink-850: #171b1c;
  --ink-800: #1d2223;
  --ink-700: #2b3131;
  --ink-600: #3b4241;
  --paper: #f2eee5;
  --paper-muted: #bdb9af;
  --paper-dim: #858781;
  --red: #db4a43;
  --red-dark: #a92e2a;
  --jade: #4ab398;
  --jade-dark: #257963;
  --gold: #d8ae55;
  --danger: #e65c57;
  --line: rgba(242, 238, 229, 0.11);
  --line-strong: rgba(242, 238, 229, 0.22);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --header-h: 72px;
  --content-w: 1240px;
  --font-ui: "Segoe UI Variable Text", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: Bahnschrift, "Segoe UI Variable Display", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --grade-0: #f1d478;
  --grade-1: #65c8ad;
  --grade-2: #75aee0;
  --grade-3: #c59be2;
  --grade-4: #e78278;
  --grade-5: #df9a62;
  --grade-6: #9ba69f;
  --grade-7: #64706e;
  --grade-8: #4c5554;
  font-family: var(--font-ui);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--ink-950);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--ink-900);
  color: var(--paper);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

body::after {
  content: "幻想郷　幻想郷　幻想郷";
  position: fixed;
  right: -43px;
  top: 180px;
  z-index: -1;
  writing-mode: vertical-rl;
  color: rgba(242, 238, 229, 0.018);
  font: 700 100px/1 "Noto Serif CJK SC", "Yu Mincho", serif;
  white-space: nowrap;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  width: 1.1em;
  height: 1.1em;
  stroke-width: 1.8;
}

:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 3px;
}

::selection {
  background: var(--red-dark);
  color: #fff;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--paper);
  color: var(--ink-950);
  border-radius: 4px;
  transition: top 160ms ease;
}

.skip-link:focus { top: 12px; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 21, 22, 0.94);
  backdrop-filter: blur(18px);
}

.header-inner,
.footer-inner {
  width: min(var(--content-w), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 206px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--red);
  color: var(--paper);
  font: 600 19px/1 "Noto Serif CJK SC", "Yu Mincho", serif;
  transform: rotate(45deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(219, 74, 67, 0.45);
}

.brand-mark span { transform: rotate(-45deg); }

.brand-mark.small {
  width: 31px;
  height: 31px;
  font-size: 15px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong,
.footer-brand strong {
  font: 700 19px/1.1 var(--font-display);
}

.brand-copy small {
  color: var(--paper-dim);
  font-size: 9px;
}

.desktop-nav {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  margin: 0 auto;
}

.desktop-nav a {
  position: relative;
  min-width: 88px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--paper-muted);
  font-size: 14px;
  transition: color 160ms ease, background-color 160ms ease;
}

.desktop-nav a:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.025);
}

.desktop-nav a.active {
  color: var(--paper);
}

.desktop-nav a.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 22px;
  right: 22px;
  height: 2px;
  background: var(--red);
}

.header-actions {
  min-width: 206px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--paper-muted);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
}

.icon-button.small {
  width: 34px;
  height: 34px;
}

.account-button {
  height: 42px;
  padding: 0 12px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--paper);
  font-size: 13px;
}

.account-button:hover { border-color: var(--jade-dark); }

.account-avatar,
.avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--ink-700);
  color: var(--paper-muted);
}

.account-avatar {
  width: 29px;
  height: 29px;
}

.account-avatar img,
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#app {
  flex: 1;
  width: 100%;
}

.page {
  width: min(var(--content-w), calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 88px;
}

.route-loading {
  min-height: 62vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--paper-dim);
}

.route-loading p { margin: 0; font-size: 13px; }

.loading-seal {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--red);
  color: var(--red);
  font: 500 22px/1 serif;
  animation: seal-turn 2.4s linear infinite;
}

@keyframes seal-turn {
  50% { transform: rotate(180deg); color: var(--jade); border-color: var(--jade); }
  100% { transform: rotate(360deg); }
}

.eyebrow {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.section-heading,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading { margin-bottom: 22px; }
.page-heading { margin-bottom: 34px; }

.section-heading h2,
.page-heading h1,
.detail-title,
.about-title {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.section-heading h2 { font-size: clamp(24px, 3vw, 34px); }
.page-heading h1 { font-size: clamp(30px, 4vw, 48px); }

.section-heading p,
.page-heading p {
  max-width: 570px;
  margin: 7px 0 0;
  color: var(--paper-dim);
  line-height: 1.75;
  font-size: 13px;
}

.text-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--jade);
  font-size: 13px;
}

.text-link:hover { color: #75cbb6; }

.button {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { border-color: var(--red); background: var(--red); color: #fff; }
.button.primary:hover { border-color: #ea625b; background: #ea625b; }
.button.secondary { border-color: var(--jade-dark); background: var(--jade-dark); color: #fff; }
.button.secondary:hover { border-color: var(--jade); background: var(--jade); }
.button.ghost:hover { border-color: var(--paper-dim); background: rgba(255, 255, 255, 0.04); }
.button.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.button.wide { width: 100%; }
.button.compact { min-height: 36px; padding: 0 12px; }

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.72fr);
  min-height: 450px;
  margin-bottom: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--ink-850);
  box-shadow: var(--shadow);
}

.featured-chart {
  position: relative;
  min-height: 450px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: var(--ink-800);
}

.featured-media {
  position: absolute;
  inset: 0;
}

.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.66;
  filter: saturate(0.84) contrast(1.05);
  transform: scale(1.01);
}

.featured-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 15, 16, 0.18);
}

.featured-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 38px;
  border-top: 1px solid var(--line);
  background: rgba(12, 15, 16, 0.86);
}

.featured-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
}

.featured-content h1 {
  max-width: 760px;
  margin: 0;
  font: 700 clamp(30px, 4.3vw, 56px)/1.14 var(--font-display);
  overflow-wrap: anywhere;
}

.featured-content > p {
  max-width: 680px;
  margin: 12px 0 24px;
  color: rgba(242, 238, 229, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.archive-panel {
  min-width: 0;
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #151a1b;
}

.archive-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.archive-head h2 {
  margin: 4px 0 0;
  font: 700 24px/1.25 var(--font-display);
}

.archive-number {
  color: var(--red);
  font: 600 36px/1 var(--font-display);
}

.archive-rule {
  height: 1px;
  margin: 26px 0;
  background: var(--line);
}

.archive-search {
  position: relative;
}

.archive-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--paper-dim);
}

.archive-search input {
  width: 100%;
  height: 46px;
  padding: 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  background: var(--ink-950);
}

.archive-search input:focus { border-color: var(--jade); }

.archive-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-tag {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--paper-muted);
  background: transparent;
  font-size: 11px;
}

.archive-tag:hover { border-color: var(--red); color: var(--paper); }

.archive-note {
  margin-top: auto;
  padding-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.archive-note div { border-top: 1px solid var(--line); padding-top: 12px; }
.archive-note strong { display: block; color: var(--jade); font: 600 20px/1.3 var(--font-display); }
.archive-note small { color: var(--paper-dim); font-size: 10px; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.chart-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--ink-850);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.chart-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.chart-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #232829;
}

.chart-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease, filter 300ms ease;
}

.chart-card:hover .chart-cover img { transform: scale(1.035); filter: saturate(1.08); }

.cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(242, 238, 229, 0.28);
  font: 500 clamp(38px, 7vw, 64px)/1 serif;
  background-color: #232829;
  background-image: linear-gradient(90deg, transparent 49.5%, rgba(242, 238, 229, 0.07) 50%, transparent 50.5%), linear-gradient(0deg, transparent 49.5%, rgba(242, 238, 229, 0.07) 50%, transparent 50.5%);
  background-size: 42px 42px;
}

.chart-card-body { padding: 16px 16px 14px; }

.chart-card-title {
  min-height: 46px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--paper);
  font: 700 17px/1.35 var(--font-display);
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chart-card-subtitle {
  height: 20px;
  margin: 7px 0 12px;
  overflow: hidden;
  color: var(--paper-dim);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card-meta {
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--paper-dim);
  font-size: 11px;
}

.chart-card-meta span { display: inline-flex; align-items: center; gap: 5px; }

.catalog-tools {
  margin-bottom: 26px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.search-field,
.select-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg,
.select-field svg {
  position: absolute;
  left: 13px;
  color: var(--paper-dim);
  pointer-events: none;
}

.search-field input,
.select-field select {
  width: 100%;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: var(--ink-850);
}

.search-field input { padding: 0 42px; }
.select-field select { min-width: 148px; padding: 0 36px 0 39px; appearance: none; }
.select-field::after { content: "⌄"; position: absolute; right: 12px; color: var(--paper-dim); pointer-events: none; }
.search-field input:focus,
.select-field select:focus { border-color: var(--jade); }

.results-row {
  min-height: 31px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--paper-dim);
  font-size: 12px;
}

.view-toggle {
  display: flex;
  gap: 4px;
}

.view-toggle button {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--paper-dim);
}

.view-toggle button.active { border-color: var(--jade-dark); color: var(--jade); }

.catalog-list { display: grid; gap: 8px; }

.chart-row {
  min-width: 0;
  min-height: 92px;
  padding: 10px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1.6fr) minmax(120px, 0.8fr) 90px 110px 24px;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--ink-850);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.chart-row:hover { border-color: var(--line-strong); background: var(--ink-800); }
.chart-row-cover { width: 72px; height: 72px; overflow: hidden; border-radius: 3px; background: var(--ink-700); }
.chart-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.chart-row-main { min-width: 0; }
.chart-row-main strong { display: block; overflow: hidden; color: var(--paper); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.chart-row-main small,
.chart-row-cell { overflow: hidden; color: var(--paper-dim); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chart-row-main small { display: block; margin-top: 7px; }

.pagination {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.pagination button {
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--paper-muted);
}

.pagination button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--paper); }
.pagination button.active { border-color: var(--red); background: var(--red); color: #fff; }
.pagination .ellipsis { width: 24px; text-align: center; color: var(--paper-dim); }

.skeleton-card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--ink-850); }
.skeleton-cover { aspect-ratio: 1; }
.skeleton-body { padding: 16px; }
.skeleton-line { height: 12px; margin-bottom: 10px; border-radius: 2px; }
.skeleton-line.short { width: 58%; }
.skeleton-cover,
.skeleton-line { position: relative; overflow: hidden; background: var(--ink-700); }
.skeleton-cover::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.035);
  animation: skeleton-pulse 1.3s ease-in-out infinite alternate;
}
@keyframes skeleton-pulse { to { background: rgba(255, 255, 255, 0.11); } }

.empty-state,
.error-state,
.auth-gate {
  min-height: 320px;
  padding: 44px 20px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--paper-dim);
}

.empty-state svg,
.error-state svg,
.auth-gate svg { width: 38px; height: 38px; margin-bottom: 13px; color: var(--red); }
.empty-state h2,
.error-state h2,
.auth-gate h2 { margin: 0 0 8px; color: var(--paper); font: 700 21px/1.4 var(--font-display); }
.empty-state p,
.error-state p,
.auth-gate p { max-width: 440px; margin: 0 0 20px; line-height: 1.6; }

.detail-page { padding-top: 28px; }
.back-link { margin-bottom: 20px; display: inline-flex; align-items: center; gap: 7px; color: var(--paper-dim); font-size: 12px; }
.back-link:hover { color: var(--paper); }

.detail-hero {
  position: relative;
  min-height: 390px;
  margin-bottom: 34px;
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--ink-850);
}

.detail-cover { position: relative; min-height: 390px; background: var(--ink-800); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.detail-cover .cover-fallback { position: absolute; inset: 0; }
.detail-cover::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }

.detail-summary {
  min-width: 0;
  padding: 38px 42px 32px;
  display: flex;
  flex-direction: column;
}

.detail-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.detail-title { max-width: 760px; font-size: clamp(30px, 4.3vw, 54px); line-height: 1.16; overflow-wrap: anywhere; }
.detail-subtitle { margin: 10px 0 0; color: var(--paper-muted); font-size: 14px; }
.status-stamp { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--jade-dark); border-radius: 3px; color: var(--jade); font-size: 10px; font-weight: 700; }
.detail-description { max-width: 800px; margin: 22px 0; color: var(--paper-dim); font-size: 13px; line-height: 1.75; white-space: pre-line; }
.detail-meta { margin-top: auto; padding-top: 19px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; border-top: 1px solid var(--line); }
.detail-meta dt { color: var(--paper-dim); font-size: 10px; }
.detail-meta dd { margin: 5px 0 0; overflow: hidden; color: var(--paper); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.detail-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 9px; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink-850);
}

.panel + .panel { margin-top: 18px; }
.panel-head { min-height: 62px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 700 17px/1.3 var(--font-display); }
.panel-head small { color: var(--paper-dim); }
.panel-body { padding: 20px; }

.community-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.reaction-button {
  min-width: 86px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--paper-muted);
}
.reaction-button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--paper); }
.reaction-button.active.like { border-color: var(--jade); color: var(--jade); background: rgba(74, 179, 152, 0.09); }
.reaction-button.active.dislike { border-color: var(--red); color: var(--red); background: rgba(219, 74, 67, 0.09); }
.interaction-note { margin-left: auto; color: var(--paper-dim); font-size: 11px; }

.comment-form { margin-top: 18px; }
.comment-form textarea { width: 100%; min-height: 92px; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 4px; outline: none; background: var(--ink-950); line-height: 1.6; }
.comment-form textarea:focus { border-color: var(--jade); }
.comment-form-footer { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; color: var(--paper-dim); font-size: 10px; }
.comments-list { margin-top: 24px; display: grid; gap: 0; }
.comment { padding: 18px 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); }
.comment .avatar { width: 38px; height: 38px; }
.comment-head { display: flex; justify-content: space-between; gap: 16px; }
.comment-head strong { font-size: 12px; }
.comment-head time { color: var(--paper-dim); font-size: 10px; }
.comment-content { margin: 7px 0 10px; color: var(--paper-muted); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-like { padding: 0; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--paper-dim); font-size: 11px; }
.comment-like.active { color: var(--red); }

.leaderboard { display: grid; }
.leaderboard-row { min-height: 56px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 80px 72px; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-rank { color: var(--paper-dim); font: 700 14px/1 var(--font-display); }
.leaderboard-row:nth-child(1) .leaderboard-rank { color: var(--gold); }
.leaderboard-player { min-width: 0; display: flex; align-items: center; gap: 8px; }
.leaderboard-player .avatar { width: 28px; height: 28px; flex: 0 0 auto; }
.leaderboard-player span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-score { text-align: right; font: 600 12px/1 var(--font-display); }
.rank-badge { text-align: right; color: var(--jade); font: 700 13px/1 var(--font-display); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; }
.stat-cell { min-height: 80px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-cell:nth-child(2n) { border-right: 0; }
.stat-cell:nth-last-child(-n+2) { border-bottom: 0; }
.stat-cell strong { display: block; color: var(--paper); font: 600 21px/1.2 var(--font-display); }
.stat-cell span { display: block; margin-top: 6px; color: var(--paper-dim); font-size: 10px; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.upload-form { padding: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { min-width: 0; display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field > span:first-child { color: var(--paper-muted); font-size: 11px; font-weight: 600; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: var(--ink-950);
}
.field input,
.field select { height: 44px; padding: 0 12px; }
.field textarea { min-height: 128px; padding: 12px; resize: vertical; line-height: 1.6; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--jade); }
.field small { color: var(--paper-dim); font-size: 10px; }

.input-wrap { position: relative; display: block; }
.input-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--paper-dim); }
.input-wrap input { padding-left: 40px; }

.file-drop {
  position: relative;
  min-height: 146px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  background: var(--ink-900);
  color: var(--paper-dim);
  text-align: center;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.file-drop:hover,
.file-drop.dragging { border-color: var(--jade); background: rgba(74, 179, 152, 0.035); }
.file-drop svg { width: 30px; height: 30px; color: var(--jade); }
.file-drop strong { color: var(--paper); font-size: 13px; }
.file-drop small { font-size: 10px; }
.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.file-drop.has-file { border-style: solid; border-color: var(--jade-dark); }
.upload-actions { margin-top: 24px; padding-top: 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }

.upload-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.upload-aside .panel-body { display: grid; gap: 18px; }
.aside-step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 11px; }
.aside-step > span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--red-dark); color: var(--red); font: 600 12px/1 var(--font-display); }
.aside-step strong { display: block; margin-bottom: 4px; font-size: 12px; }
.aside-step p { margin: 0; color: var(--paper-dim); font-size: 10px; line-height: 1.6; }

.profile-hero {
  min-height: 210px;
  padding: 32px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--ink-850);
  background-image: linear-gradient(90deg, rgba(219, 74, 67, 0.13) 1px, transparent 1px), linear-gradient(0deg, rgba(74, 179, 152, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
}
.profile-avatar { position: relative; width: 112px; height: 112px; flex: 0 0 auto; display: grid; place-items: center; border: 4px solid var(--ink-850); border-radius: 50%; background: var(--ink-700); box-shadow: 0 0 0 1px var(--line-strong); overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy h1 { margin: 0; font: 700 clamp(26px, 4vw, 42px)/1.2 var(--font-display); overflow-wrap: anywhere; }
.profile-copy p { max-width: 650px; margin: 8px 0 0; color: var(--paper-dim); font-size: 12px; line-height: 1.6; }
.profile-actions { align-self: flex-end; display: flex; gap: 8px; }
.profile-stats { margin: 18px 0; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 6px; background: var(--ink-850); }
.profile-stat { min-height: 92px; padding: 18px; border-right: 1px solid var(--line); }
.profile-stat:last-child { border-right: 0; }
.profile-stat strong { display: block; font: 600 24px/1.2 var(--font-display); }
.profile-stat span { display: block; margin-top: 7px; color: var(--paper-dim); font-size: 10px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; min-height: 48px; padding: 0 18px; border: 0; background: transparent; color: var(--paper-dim); font-size: 12px; }
.tabs button.active { color: var(--paper); }
.tabs button.active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--jade); }
.score-records { display: grid; }
.score-record { min-height: 82px; padding: 10px 16px; display: grid; grid-template-columns: 58px minmax(0, 1fr) 90px 100px 50px; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.score-record:last-child { border-bottom: 0; }
.score-cover { width: 58px; height: 58px; overflow: hidden; border-radius: 3px; background: var(--ink-700); }
.score-cover img { width: 100%; height: 100%; object-fit: cover; }
.score-main { min-width: 0; }
.score-main strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.score-main small { display: block; margin-top: 6px; color: var(--paper-dim); font-size: 10px; }
.score-value { text-align: right; }
.score-value strong { display: block; font: 600 13px/1.2 var(--font-display); }
.score-value small { color: var(--paper-dim); font-size: 9px; }
.grade { text-align: center; color: var(--gold); font: 700 18px/1 var(--font-display); }

.profile-editor { margin-top: 18px; padding: 24px; }
.profile-editor .form-grid { align-items: start; }
.avatar-upload-preview { width: 108px; height: 108px; overflow: hidden; border-radius: 50%; background: var(--ink-700); }
.avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; }

.about-page { padding-top: 60px; }
.about-header { max-width: 840px; margin-bottom: 56px; }
.about-title { font-size: clamp(40px, 7vw, 84px); line-height: 1.05; }
.about-lead { max-width: 720px; margin: 24px 0 0; color: var(--paper-muted); font-size: 16px; line-height: 1.9; }
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; }
.about-block { padding: 28px; border-top: 1px solid var(--line-strong); }
.about-block h2 { margin: 0 0 12px; font: 700 22px/1.4 var(--font-display); }
.about-block p { margin: 0; color: var(--paper-dim); font-size: 13px; line-height: 1.8; }
.about-counters { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 6px; }
.about-counter { min-height: 130px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-counter:nth-child(2n) { border-right: 0; }
.about-counter:nth-last-child(-n+2) { border-bottom: 0; }
.about-counter strong { display: block; color: var(--red); font: 600 32px/1 var(--font-display); }
.about-counter span { display: block; margin-top: 8px; color: var(--paper-dim); font-size: 11px; }
.credits-list { margin: 0; padding: 0; list-style: none; }
.credits-list li { padding: 13px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); color: var(--paper-muted); font-size: 12px; }
.credits-list li:last-child { border-bottom: 0; }
.credits-list small { color: var(--paper-dim); }

.site-footer {
  min-height: 128px;
  border-top: 1px solid var(--line);
  background: var(--ink-950);
}
.footer-inner { min-height: 128px; justify-content: space-between; gap: 26px; }
.footer-brand { display: flex; align-items: center; gap: 13px; }
.footer-brand div { display: grid; gap: 4px; }
.footer-brand small { color: var(--paper-dim); font-size: 9px; }
.site-footer p { max-width: 430px; margin: 0; color: var(--paper-dim); font-size: 10px; line-height: 1.6; text-align: center; }
.footer-links { display: flex; gap: 18px; color: var(--paper-muted); font-size: 11px; }
.footer-links a:hover { color: var(--jade); }
.mobile-nav { display: none; }

dialog {
  padding: 0;
  border: 0;
  outline: none;
  color: var(--paper);
  background: transparent;
}
dialog::backdrop { background: rgba(6, 8, 8, 0.78); backdrop-filter: blur(7px); }
.auth-dialog { width: min(880px, calc(100% - 32px)); border-radius: 6px; box-shadow: var(--shadow); }
.dialog-shell { position: relative; min-height: 520px; display: grid; grid-template-columns: 0.88fr 1.12fr; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--ink-850); }
.dialog-close { position: absolute; z-index: 2; top: 14px; right: 14px; }
.auth-aside { position: relative; padding: 34px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: var(--red-dark); }
.auth-aside::after { content: "夢"; position: absolute; right: -25px; bottom: -40px; color: rgba(255, 255, 255, 0.07); font: 700 230px/1 serif; }
.vertical-kicker { writing-mode: vertical-rl; color: rgba(255, 255, 255, 0.65); font-size: 10px; }
.auth-seal { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.65); font: 500 18px/1 serif; }
.auth-aside h2 { margin: 18px 0 0; font: 700 30px/1.4 var(--font-display); }
.auth-aside p { position: relative; z-index: 1; max-width: 280px; margin: 0; color: rgba(255, 255, 255, 0.67); font-size: 11px; line-height: 1.8; }
.auth-panel { padding: 44px 48px; display: flex; flex-direction: column; justify-content: center; }
.segmented { align-self: flex-start; margin-bottom: 36px; padding: 3px; display: flex; border: 1px solid var(--line); border-radius: 4px; background: var(--ink-950); }
.segmented button { min-width: 76px; height: 34px; border: 0; border-radius: 2px; background: transparent; color: var(--paper-dim); font-size: 11px; }
.segmented button.active { background: var(--paper); color: var(--ink-950); }
.form-heading { margin-bottom: 25px; }
.form-heading h3 { margin: 5px 0 0; font: 700 25px/1.4 var(--font-display); }
#auth-form { display: grid; gap: 18px; }
.form-error { margin: 0; padding: 10px 12px; border-left: 2px solid var(--danger); background: rgba(230, 92, 87, 0.08); color: #f08a85; font-size: 11px; }
.confirm-dialog { width: min(430px, calc(100% - 32px)); }
.confirm-shell { padding: 30px; display: grid; justify-items: center; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--ink-850); text-align: center; box-shadow: var(--shadow); }
.confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--red); color: var(--red); }
.confirm-icon svg { width: 24px; height: 24px; }
.confirm-shell h3 { margin: 18px 0 7px; font: 700 20px/1.4 var(--font-display); }
.confirm-shell p { margin: 0; color: var(--paper-dim); font-size: 12px; line-height: 1.7; }
.dialog-actions { margin-top: 24px; display: flex; gap: 9px; }
.toast-region { position: fixed; z-index: 300; right: 20px; bottom: 20px; width: min(370px, calc(100% - 40px)); display: grid; gap: 9px; pointer-events: none; }
.toast { min-height: 54px; padding: 12px 14px; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-left: 3px solid var(--jade); border-radius: 4px; background: #202525; color: var(--paper); box-shadow: var(--shadow); animation: toast-in 180ms ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast svg { color: var(--jade); }
.toast.error svg { color: var(--danger); }
.toast strong { display: block; font-size: 11px; }
.toast small { display: block; margin-top: 3px; color: var(--paper-dim); font-size: 10px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .chart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desktop-nav a { min-width: 72px; padding: 0 11px; }
  .brand,
  .header-actions { min-width: 175px; }
  .detail-hero { grid-template-columns: 320px minmax(0, 1fr); }
  .detail-summary { padding: 30px; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 290px; }
}

@media (max-width: 820px) {
  :root { --header-h: 62px; }
  .header-inner,
  .footer-inner,
  .page { width: min(100% - 32px, var(--content-w)); }
  .brand { min-width: auto; }
  .brand-copy small,
  .desktop-nav,
  .search-trigger,
  .account-button > span:last-child { display: none; }
  .header-actions { min-width: auto; margin-left: auto; }
  .account-button { width: 40px; padding: 0; justify-content: center; border: 0; }
  .account-avatar { width: 32px; height: 32px; }
  .page { padding-top: 28px; padding-bottom: 100px; }
  .home-intro { grid-template-columns: 1fr; min-height: 0; }
  .featured-chart { min-height: 430px; }
  .archive-panel { min-height: 300px; border-left: 0; border-top: 1px solid var(--line); }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-hero { grid-template-columns: 260px minmax(0, 1fr); }
  .detail-cover { min-height: 360px; }
  .detail-heading-row { display: block; }
  .status-stamp { display: inline-block; margin-top: 12px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .detail-side .panel + .panel { margin-top: 0; }
  .upload-layout { grid-template-columns: 1fr; }
  .upload-aside { position: static; }
  .profile-hero { align-items: center; flex-wrap: wrap; }
  .profile-actions { width: 100%; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
  .profile-stat:nth-child(3) { border-right: 0; }
  .profile-stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .about-grid { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: 76px; }
  .footer-inner { padding: 25px 0; flex-wrap: wrap; }
  .site-footer p { order: 3; width: 100%; max-width: none; text-align: left; }
  .mobile-nav {
    position: fixed;
    z-index: 110;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 64px;
    padding: 6px max(12px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line-strong);
    background: rgba(12, 15, 16, 0.96);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a,
  .mobile-nav button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--paper-dim); font-size: 9px; }
  .mobile-nav a.active { color: var(--red); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .toast-region { bottom: 80px; }
}

@media (max-width: 620px) {
  .header-inner,
  .footer-inner,
  .page { width: min(100% - 24px, var(--content-w)); }
  .brand-copy strong { font-size: 16px; }
  .brand-mark { width: 33px; height: 33px; font-size: 16px; }
  .page-heading { display: block; margin-bottom: 24px; }
  .page-heading .button { margin-top: 16px; }
  .section-heading { align-items: flex-start; }
  .section-heading .text-link { margin-top: 7px; }
  .home-intro { margin-bottom: 40px; }
  .featured-chart { min-height: 390px; }
  .featured-content { padding: 25px 22px; }
  .featured-content h1 { font-size: 30px; }
  .archive-panel { padding: 26px 22px; }
  .chart-grid { gap: 11px; }
  .chart-card-body { padding: 12px; }
  .chart-card-title { min-height: 41px; font-size: 14px; }
  .chart-card-subtitle { margin-top: 5px; margin-bottom: 9px; font-size: 10px; }
  .chart-card-meta { font-size: 9px; }
  .catalog-tools { grid-template-columns: 1fr 1fr; padding: 12px 0; }
  .catalog-tools .search-field { grid-column: 1 / -1; }
  .select-field select { min-width: 0; }
  .chart-row { grid-template-columns: 62px minmax(0, 1fr) 20px; min-height: 82px; gap: 12px; }
  .chart-row-cover { width: 62px; height: 62px; }
  .chart-row-cell,
  .detail-hero { grid-template-columns: 1fr; }
  .detail-cover { min-height: 0; aspect-ratio: 1.25 / 1; }
  .detail-cover::after { display: none; }
  .detail-summary { padding: 24px 20px; }
  .detail-title { font-size: 30px; }
  .detail-meta { gap: 15px; }
  .detail-side { grid-template-columns: 1fr; }
  .detail-side .panel + .panel { margin-top: 0; }
  .interaction-note { width: 100%; margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .upload-form { padding: 18px; }
  .profile-hero { padding: 24px 20px; text-align: center; justify-content: center; }
  .profile-avatar { width: 94px; height: 94px; }
  .profile-copy { flex: 1 1 100%; }
  .profile-actions { justify-content: center; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .profile-stat { border-top: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .profile-stat:nth-child(2n) { border-right: 0; }
  .profile-stat:nth-child(3) { border-right: 1px solid var(--line); }
  .profile-stat:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .score-record { grid-template-columns: 52px minmax(0, 1fr) 48px; padding: 9px; gap: 10px; }
  .score-cover { width: 52px; height: 52px; }
  .score-value { display: none; }
  .tabs { overflow-x: auto; }
  .tabs button { flex: 0 0 auto; padding: 0 13px; }
  .about-page { padding-top: 38px; }
  .about-counters { grid-template-columns: 1fr; }
  .about-counter,
  .about-counter:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .about-counter:last-child { border-bottom: 0; }
  .auth-dialog { width: min(480px, calc(100% - 20px)); }
  .dialog-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-panel { min-height: 510px; padding: 38px 24px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Product home */
.home-page { padding-top: 28px; }
.game-hero {
  position: relative;
  width: 100vw;
  min-height: min(650px, calc(100svh - var(--header-h) - 76px));
  margin-left: calc(50% - 50vw);
  padding: 38px max(24px, calc((100vw - var(--content-w)) / 2)) 46px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.game-hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: min(78vw, 1120px);
  background: linear-gradient(90deg, rgba(12, 15, 16, 0.99) 0%, rgba(12, 15, 16, 0.94) 34%, rgba(12, 15, 16, 0.68) 55%, rgba(12, 15, 16, 0.18) 76%, rgba(12, 15, 16, 0) 100%);
  pointer-events: none;
}
.game-hero-copy { position: relative; z-index: 2; width: min(680px, 56vw); }
.game-hero-copy h1 {
  margin: 12px 0 0;
  font: 700 clamp(46px, 6vw, 82px)/0.98 var(--font-display);
  overflow-wrap: anywhere;
}
.game-hero-copy h1 span { display: inline-block; margin-top: 12px; color: var(--red); font-size: 0.48em; line-height: 1.12; }
.game-hero-lead { max-width: 620px; margin: 28px 0 0; color: var(--paper-muted); font-size: 16px; line-height: 1.85; }
.game-hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cta { min-width: 155px; }
.release-note { margin: 18px 0 0; display: flex; align-items: center; gap: 8px; color: var(--paper-dim); font-size: 11px; }
.release-note span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(216, 174, 85, 0.1); }
.hero-cover-stage {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(64vw, 980px);
  min-width: 0;
  height: auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
}
.hero-cover { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--line); background: var(--ink-800); }
.hero-cover:hover { border-color: var(--line-strong); }
.hero-cover img,
.hero-cover .cover-fallback { width: 100%; height: 100%; object-fit: cover; transition: transform 260ms ease, filter 260ms ease; }
.hero-cover:hover img { transform: scale(1.035); filter: saturate(1.08); }
.hero-cover > span:last-child { position: absolute; left: 0; right: 0; bottom: 0; padding: 9px 10px; overflow: hidden; background: rgba(12, 15, 16, 0.88); color: var(--paper-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hero-cover-1 { grid-column: 1 / 3; grid-row: 1 / 3; }
.hero-cover-2 { grid-column: 3; grid-row: 1; }
.hero-cover-3 { grid-column: 3; grid-row: 2; }
.hero-cover-4 { grid-column: 1; grid-row: 3; }
.hero-cover-5 { grid-column: 2; grid-row: 3; }
.hero-cover-6 { grid-column: 3; grid-row: 3; }
.hero-seal { position: absolute; right: -13px; bottom: 18%; width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--red); background: var(--ink-950); color: var(--paper); font: 500 25px/1 serif; transform: rotate(6deg); }
.hero-cover-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-content: center; justify-items: center; border: 1px solid var(--line); background: var(--ink-850); }
.hero-cover-empty span { color: var(--red); font: 500 80px/1 serif; }
.hero-cover-empty small { margin-top: 16px; color: var(--paper-dim); }
.game-pillars { margin: 6px 0 88px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.game-pillars article { position: relative; min-height: 210px; padding: 34px 34px 30px; border-right: 1px solid var(--line); }
.game-pillars article:last-child { border-right: 0; }
.game-pillars svg { width: 27px; height: 27px; color: var(--jade); }
.game-pillars h2 { margin: 22px 0 8px; font: 700 19px/1.3 var(--font-display); }
.game-pillars p { margin: 0; color: var(--paper-dim); font-size: 12px; line-height: 1.7; }
.pillar-index { position: absolute; right: 24px; top: 29px; color: var(--line-strong); font: 700 28px/1 var(--font-display); }
.download-section { margin-bottom: 96px; padding: 48px; display: grid; grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr); gap: 54px; align-items: center; border: 1px solid var(--line); background: var(--ink-850); }
.download-copy h2,
.home-archive-copy h2 { margin: 7px 0 0; font: 700 clamp(28px, 4vw, 46px)/1.18 var(--font-display); }
.download-copy p,
.home-archive-copy p { margin: 18px 0 0; color: var(--paper-dim); font-size: 13px; line-height: 1.8; }
.download-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.download-option { min-width: 0; min-height: 82px; padding: 16px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--ink-900); }
.download-option.available:hover { border-color: var(--jade-dark); background: var(--ink-800); }
.download-option > svg:first-child { width: 25px; height: 25px; color: var(--jade); }
.download-option > span { min-width: 0; display: grid; gap: 5px; }
.download-option strong { font-size: 13px; }
.download-option small { overflow: hidden; color: var(--paper-dim); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.download-option em { padding: 4px 6px; border: 1px solid var(--line); color: var(--paper-dim); font-size: 9px; font-style: normal; }
.download-option.pending { opacity: 0.66; }
.home-archive { margin-bottom: 88px; padding: 8px 0 36px; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr); align-items: end; gap: 70px; border-bottom: 1px solid var(--line); }
.home-archive-copy strong { color: var(--red); }
.home-archive .archive-search { max-width: 580px; margin-top: 28px; }
.home-archive .archive-tags { margin: 0; padding-bottom: 2px; justify-content: flex-end; }
.latest-section { padding-bottom: 10px; }

/* Catalog metrics */
.chart-card-meta { justify-content: flex-start; gap: 14px; }
.chart-card-meta span { min-width: 0; white-space: nowrap; }
.chart-card-meta span:last-child { margin-left: auto; color: var(--gold); }
.chart-card-byline { margin: 10px 0 0; overflow: hidden; color: var(--paper-dim); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chart-row { grid-template-columns: 72px minmax(0, 1.5fr) minmax(110px, 0.7fr) minmax(210px, 0.9fr) 86px 24px; }
.chart-row-metrics { display: flex; align-items: center; gap: 18px; color: var(--paper-dim); font-size: 11px; }
.chart-row-metrics span { display: inline-flex; align-items: center; gap: 5px; }
.chart-row-pp { color: var(--gold); text-align: right; }

/* Chart detail and ranking */
.personal-best { min-height: 50px; padding: 7px 13px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--gold); color: var(--gold); }
.personal-best > span { display: grid; gap: 2px; }
.personal-best small { color: var(--paper-dim); font-size: 9px; }
.personal-best strong { font: 700 15px/1.1 var(--font-display); }
.client-sync-note { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; color: var(--paper-dim); font-size: 11px; }
.chart-performance { margin-bottom: 28px; display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); background: var(--ink-850); }
.chart-performance > div { min-width: 0; min-height: 92px; padding: 18px; display: flex; align-items: center; gap: 12px; border-right: 1px solid var(--line); }
.chart-performance > div:last-child { border-right: 0; }
.chart-performance svg { flex: 0 0 auto; color: var(--jade); }
.chart-performance span { min-width: 0; display: grid; gap: 5px; }
.chart-performance strong { overflow: hidden; font: 600 19px/1.15 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.chart-performance small { color: var(--paper-dim); font-size: 9px; }
.leaderboard-panel { margin-bottom: 28px; }
.leaderboard-heading { min-height: 112px; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.leaderboard-heading h2 { margin: 6px 0 0; font: 700 clamp(24px, 3vw, 34px)/1.25 var(--font-display); }
.leaderboard-heading p { margin: 7px 0 0; color: var(--paper-dim); font-size: 11px; }
.leaderboard-heading > strong { color: var(--red); font: 600 30px/1 var(--font-display); text-align: right; }
.leaderboard-heading > strong small { display: block; margin-top: 6px; color: var(--paper-dim); font: 400 9px/1.2 var(--font, sans-serif); }
.leaderboard-body { padding: 0 28px; }
.leaderboard-entry { min-width: 0; min-height: 122px; padding: 17px 0; display: grid; grid-template-columns: 48px minmax(145px, 0.7fr) minmax(380px, 1.7fr); grid-template-rows: auto auto; align-items: center; column-gap: 18px; border-bottom: 1px solid var(--line); }
.leaderboard-entry:last-child { border-bottom: 0; }
.leaderboard-entry.is-mine { margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-left: 2px solid var(--jade); background: rgba(74, 179, 152, 0.045); }
.leaderboard-position { grid-row: 1 / 3; display: grid; justify-items: center; gap: 6px; color: var(--paper-dim); font: 700 16px/1 var(--font-display); }
.leaderboard-position svg { color: var(--gold); }
.leaderboard-entry:nth-child(1) .leaderboard-position { color: var(--gold); }
.leaderboard-identity { grid-row: 1 / 3; min-width: 0; display: flex; align-items: center; gap: 10px; }
.leaderboard-identity .avatar { width: 38px; height: 38px; flex: 0 0 auto; }
.leaderboard-identity > span { min-width: 0; display: grid; gap: 5px; }
.leaderboard-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-identity small { color: var(--paper-dim); font-size: 9px; }
.leaderboard-core { min-width: 0; display: grid; grid-template-columns: 0.75fr 1.15fr 0.9fr; gap: 8px; }
.ranking-metric { min-width: 0; padding-left: 16px; border-left: 1px solid var(--line); }
.ranking-metric strong { display: block; overflow: hidden; font: 600 17px/1.15 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.ranking-metric span { display: block; margin-top: 4px; color: var(--paper-dim); font-size: 8px; }
.ranking-metric.pp strong { color: var(--gold); font-size: 23px; }
.leaderboard-details { min-width: 0; margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; color: var(--paper-dim); font-size: 9px; }
.leaderboard-details > span,
.leaderboard-details time { display: inline-flex; align-items: center; gap: 5px; }
.leaderboard-details time { margin-left: auto; }
.judgment.perfect { color: var(--jade); }
.judgment.great { color: #7fc5b3; }
.judgment.good { color: var(--gold); }
.judgment.bad { color: #d68661; }
.judgment.miss { color: var(--danger); }
.leaderboard-empty { min-height: 250px; border: 0; }
.detail-lower-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.archive-client-note { margin: 0; padding: 16px; display: flex; gap: 8px; border-top: 1px solid var(--line); color: var(--paper-dim); font-size: 9px; line-height: 1.55; }
.archive-client-note svg { flex: 0 0 auto; color: var(--jade); }

/* Player archive */
.profile-hero { align-items: center; }
.profile-copy { flex: 1 1 210px; }
.profile-ranking { flex: 0 1 410px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); background: rgba(12, 15, 16, 0.7); }
.profile-ranking > div { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); }
.profile-ranking > div:last-child { border-right: 0; }
.profile-ranking small,
.profile-ranking span { display: block; color: var(--paper-dim); font-size: 9px; }
.profile-ranking strong { display: block; margin: 7px 0 6px; overflow: hidden; color: var(--gold); font: 700 27px/1 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.profile-actions { align-self: center; }
.profile-stats { grid-template-columns: repeat(8, 1fr); }
.profile-stat { min-width: 0; padding: 16px 13px; }
.profile-stat strong { overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.profile-insights { margin: 18px 0; display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); gap: 18px; align-items: stretch; }
.profile-insights .panel + .panel { margin-top: 0; }
.distribution-empty { min-height: 180px; display: grid; place-items: center; color: var(--paper-dim); font-size: 11px; }
.grade-composition { min-height: 220px; padding: 22px; display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 28px; }
.grade-ring { position: relative; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: var(--grade-gradient); box-shadow: 0 0 0 1px var(--line-strong), 0 16px 35px rgba(0, 0, 0, 0.24); }
.grade-ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--ink-850); box-shadow: inset 0 0 0 1px var(--line); }
.grade-ring > div { position: relative; display: grid; justify-items: center; gap: 5px; }
.grade-ring strong { color: var(--paper); font: 700 29px/1 var(--font-display); }
.grade-ring span { color: var(--paper-dim); font-size: 8px; }
.grade-legend { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.grade-key { min-width: 0; min-height: 42px; display: grid; grid-template-columns: 8px 34px minmax(42px, 1fr) auto; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); }
.grade-key i { width: 7px; height: 7px; border-radius: 50%; background: var(--grade-color); box-shadow: 0 0 10px color-mix(in srgb, var(--grade-color), transparent 45%); }
.grade-key strong { font: 700 12px/1 var(--font-display); }
.grade-key span { color: var(--paper-muted); font: 600 11px/1 var(--font-display); }
.grade-key small { color: var(--paper-dim); font-size: 8px; white-space: nowrap; }
.judgment-composition { min-height: 220px; padding: 26px 24px 22px; display: grid; align-content: center; gap: 26px; }
.judgment-stack { width: 100%; height: 18px; display: flex; overflow: hidden; border: 1px solid var(--line-strong); background: var(--ink-700); }
.judgment-stack i { width: var(--segment-width); min-width: 0; height: 100%; }
.judgment-stack i + i { border-left: 2px solid var(--ink-850); }
.judgment-stack .perfect,
.judgment-legend .perfect > i { background: var(--jade); }
.judgment-stack .great,
.judgment-legend .great > i { background: #7fc5b3; }
.judgment-stack .good,
.judgment-legend .good > i { background: var(--gold); }
.judgment-stack .bad,
.judgment-legend .bad > i { background: #d68661; }
.judgment-stack .miss,
.judgment-legend .miss > i { background: var(--danger); }
.judgment-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.judgment-legend > div { min-width: 0; display: grid; grid-template-columns: 8px minmax(0, 1fr); align-items: center; gap: 7px; }
.judgment-legend > div > i { width: 7px; height: 7px; border-radius: 50%; }
.judgment-legend span { min-width: 0; display: grid; gap: 4px; }
.judgment-legend strong { overflow: hidden; font-size: 9px; font-weight: 600; text-overflow: ellipsis; }
.judgment-legend small { color: var(--paper-dim); font-size: 8px; }
.judgment-legend em { grid-column: 2; color: var(--paper-muted); font: 600 12px/1 var(--font-display); font-style: normal; }
.score-record { grid-template-columns: 58px minmax(0, 1fr) 80px 90px 100px 50px; }
.score-pp strong { color: var(--gold); font-size: 17px; }

@media (max-width: 1050px) {
  .game-hero-copy { width: min(610px, 60vw); }
  .chart-performance { grid-template-columns: repeat(3, 1fr); }
  .chart-performance > div:nth-child(3n) { border-right: 0; }
  .chart-performance > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .profile-ranking { flex-basis: 360px; }
  .profile-stats { grid-template-columns: repeat(4, 1fr); }
  .profile-stat:nth-child(4) { border-right: 0; }
  .profile-stat:nth-child(n+5) { border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .game-hero { min-height: calc(100svh - var(--header-h) - 142px); padding-top: 24px; padding-bottom: 30px; }
  .game-hero-copy { width: 100%; max-width: 680px; }
  .game-hero::before { width: 100%; background: linear-gradient(90deg, rgba(12, 15, 16, 0.96) 0%, rgba(12, 15, 16, 0.82) 68%, rgba(12, 15, 16, 0.58) 100%); }
  .hero-cover-stage { inset: 0; width: 100%; height: auto; opacity: 0.28; }
  .hero-cover { border-color: transparent; }
  .game-pillars { grid-template-columns: 1fr; }
  .game-pillars article { min-height: 160px; border-right: 0; border-bottom: 1px solid var(--line); }
  .game-pillars article:last-child { border-bottom: 0; }
  .download-section { padding: 36px; grid-template-columns: 1fr; gap: 32px; }
  .home-archive { grid-template-columns: 1fr; gap: 28px; }
  .home-archive .archive-tags { justify-content: flex-start; }
  .chart-row { grid-template-columns: 72px minmax(0, 1fr) minmax(190px, 0.8fr) 70px 24px; }
  .chart-row > .chart-row-cell:nth-of-type(1) { display: none; }
  .leaderboard-entry { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .leaderboard-position { grid-row: 1; }
  .leaderboard-identity { grid-column: 2; grid-row: 1; }
  .leaderboard-core { grid-column: 1 / -1; grid-row: 2; margin-top: 14px; }
  .leaderboard-details { grid-column: 1 / -1; grid-row: 3; }
  .detail-lower-layout { grid-template-columns: 1fr; }
  .profile-ranking { order: 4; flex: 1 1 100%; }
  .profile-actions { order: 5; }
}

@media (max-width: 620px) {
  .home-page { padding-top: 16px; }
  .game-hero { min-height: calc(100svh - var(--header-h) - 138px); padding: 22px 12px 28px; }
  .game-hero-copy h1 { font-size: 43px; }
  .game-hero-lead { margin-top: 20px; font-size: 14px; }
  .game-hero-actions .button { flex: 1 1 150px; }
  .hero-cover-stage { height: auto; gap: 6px; }
  .hero-cover > span:last-child { display: none; }
  .hero-seal { right: -6px; width: 48px; height: 48px; }
  .game-pillars { margin-bottom: 60px; }
  .game-pillars article { padding: 28px 22px; }
  .download-section { margin-left: -12px; margin-right: -12px; margin-bottom: 68px; padding: 30px 20px; }
  .download-options { grid-template-columns: 1fr; }
  .home-archive { margin-bottom: 64px; }
  .chart-card-meta { grid-template-columns: 1fr 1fr; gap: 8px 10px; display: grid; }
  .chart-card-meta span:last-child { margin-left: 0; }
  .chart-row { grid-template-columns: 62px minmax(0, 1fr) 20px; }
  .chart-row-metrics,
  .chart-row-pp { display: none; }
  .detail-actions { align-items: center; }
  .chart-performance { grid-template-columns: 1fr 1fr; }
  .chart-performance > div { min-height: 78px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .chart-performance > div:nth-child(2n) { border-right: 0; }
  .chart-performance > div:nth-last-child(-n+2) { border-bottom: 0; }
  .chart-performance > div:nth-child(3) { border-right: 1px solid var(--line); }
  .chart-performance strong { font-size: 15px; }
  .leaderboard-heading { padding: 20px; align-items: flex-start; }
  .leaderboard-heading p { max-width: 230px; }
  .leaderboard-heading > strong { font-size: 23px; }
  .leaderboard-body { padding: 0 16px; }
  .leaderboard-entry { min-height: 0; padding: 18px 0; column-gap: 9px; }
  .leaderboard-entry.is-mine { margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
  .leaderboard-core { grid-template-columns: 0.75fr 1.15fr 1fr; }
  .ranking-metric { padding-left: 9px; }
  .ranking-metric strong { font-size: 13px; }
  .ranking-metric.pp strong { font-size: 19px; }
  .leaderboard-details { gap: 7px 10px; }
  .leaderboard-details time { width: 100%; margin-left: 0; }
  .profile-hero { text-align: left; justify-content: flex-start; }
  .profile-avatar { margin: 0 auto; }
  .profile-copy { text-align: center; }
  .profile-ranking { grid-template-columns: 1fr 1fr; }
  .profile-ranking > div { padding: 14px 12px; }
  .profile-ranking strong { font-size: 22px; }
  .profile-actions { width: 100%; justify-content: center; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .profile-stat,
  .profile-stat:nth-child(3),
  .profile-stat:nth-child(4) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .profile-stat:nth-child(2n) { border-right: 0; }
  .profile-stat:nth-child(n+3) { border-top: 0; }
  .profile-stat:nth-last-child(-n+2) { border-bottom: 0; }
  .profile-insights { grid-template-columns: 1fr; }
  .grade-composition { grid-template-columns: 1fr; justify-items: center; gap: 18px; padding: 18px; }
  .grade-ring { width: 108px; height: 108px; }
  .grade-legend { width: 100%; grid-template-columns: 1fr; }
  .grade-key { min-height: 36px; }
  .judgment-composition { padding: 22px 18px; }
  .judgment-legend { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .score-record { grid-template-columns: 52px minmax(0, 1fr) 58px 38px; }
  .score-record .score-value { display: none; }
  .score-record .score-pp { display: block; }
  .score-pp strong { font-size: 14px; }
}
