:root {
  --subpage-text: #0f172a;
  --subpage-text-soft: #1e3a5f;
  --subpage-text-muted: #334155;
  --subpage-border: rgba(255, 255, 255, .72);
  --subpage-shadow: var(--shadow-subtle);
  --text-contrast-shadow: none;
}

html[data-theme="dark"] {
  --subpage-text: #f5f5f7;
  --subpage-text-soft: #a1a1a6;
  --subpage-text-muted: #86868b;
  --subpage-border: rgba(255, 255, 255, .14);
  --subpage-shadow: var(--shadow-subtle);
  --text-contrast-shadow: none;
}

/* Shared inner-page layout. Single source of truth for subpages. */
.subpage-body {
  min-height: 100vh;
  color: var(--subpage-text);
  background: #dce7f1 url('../assets/server-background.avif') center top / cover fixed;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
.subpage-main { width: min(1440px, calc(100% - 64px)); margin: 0 auto; padding: 142px 0 88px; }
.subpage-hero { max-width: 760px; margin: 0 auto 52px; text-align: center; }
.subpage-hero h1 { margin: 0; font-size: clamp(42px, 5vw, 72px); font-weight: 750; line-height: 1.08; letter-spacing: -.02em; }
.subpage-hero p { max-width: 560px; margin: 18px auto 0; color: var(--subpage-text-soft); font-size: 14px; font-weight: 550; line-height: 1.8; }
.subpage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.subpage-footer { margin-top: 34px; color: var(--subpage-text-soft); font-size: 11.5px; font-weight: 650; text-align: center; }

/* Server rules: a spacious, document-like page rather than a collection of cards. */
.rules-main { width: min(1200px, calc(100% - 64px)); }
.rules-page { background-color: #dce7f1; background-image: url('../assets/about-background.avif'); background-position: center top; background-size: cover; background-attachment: fixed; }
.rules-hero { max-width: 820px; margin: 0 0 56px; text-align: left; }
.subpage-kicker { margin: 0 0 15px; color: var(--pink-strong); font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.rules-hero p { max-width: 680px; margin-left: 0; }
.rules-content { padding-left: 38px; border-left: 1px solid rgba(136, 122, 170, .2); }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 52px 74px; }
.rules-page .rule-card { min-height: 196px; padding: 24px; border-radius: 18px; }
.rules-page .rule-card > svg { width: 24px; height: 24px; margin-bottom: 20px; color: var(--pink); }
.rules-page .rule-card h2 { margin: 0 0 12px; font-size: 19px; }
.rules-page .rule-card p { margin: 0; color: var(--ink-soft); font-size: 13px; font-weight: 650; line-height: 1.85; }
html[data-theme="light"] .rules-page .rules-hero > p:last-child,
html[data-theme="light"] .rules-page .rule-card p,
html[data-theme="light"] .rules-page .subpage-footer { color: var(--ink-soft); }
html[data-theme="dark"] .rules-page { background-color: #161617; background-image: url('../assets/about-background.avif'); }
html[data-theme="dark"] .rules-page .rules-content { border-left-color: rgba(255, 255, 255, .14); }

/* History: central timeline with alternating portrait cards. */
.timeline { position: relative; max-width: 1000px; margin: 0 auto; padding: 48px 0; }
.timeline::before { content: ''; position: absolute; top: 48px; bottom: 48px; left: 50%; width: 2px; background: rgba(0, 113, 227, .28); transform: translateX(-50%); }
.timeline-item { position: relative; min-height: 366px; margin-bottom: 64px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker { position: absolute; z-index: 2; top: 0; left: 50%; display: flex; align-items: center; justify-content: center; width: 129px; height: 61px; border: 0; border-radius: 999px; color: #fff; background: transparent; transform: translateX(-50%); }
.timeline-marker::before { content: ''; position: absolute; width: 22px; height: 22px; border: 4px solid rgba(255,255,255,.92); border-radius: 50%; background: var(--pink); box-shadow: 0 7px 18px rgba(0, 113, 227, .28); }
.timeline-dot { position: relative; z-index: 1; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.timeline-date { position: relative; z-index: 3; display: inline-flex; align-items: center; min-height: 33px; margin-top: 70px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--pink-strong); background: var(--glass); box-shadow: var(--shadow-subtle); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); font-family: 'Quicksand', sans-serif; font-size: 11px; font-weight: 800; white-space: nowrap; }
.timeline-content { position: relative; width: 412px; padding: 0; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--glass-gradient, var(--glass)); box-shadow: var(--shadow-subtle); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
.timeline-item:nth-child(odd) .timeline-content { margin-right: auto; }
.timeline-item:nth-child(even) .timeline-content { margin-left: auto; }
.history-card { display: block; min-height: 366px; }
.history-image { position: relative; height: 231px; min-height: 0; background: url('../assets/server-background.avif') center / cover; }
.history-image.gallery-tile { min-height: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; box-shadow: none; background: none; cursor: zoom-in; transition: none; }
.history-image.gallery-tile::before,
.history-image.gallery-tile::after { display: none; }
.history-image.gallery-tile img { position: relative; z-index: 0; transform: translateZ(0); transform-origin: center; transition: transform .62s cubic-bezier(.22,.61,.36,1); will-change: transform; }
.history-image.gallery-tile::after { display: block; position: absolute; inset: -30% -70%; z-index: 2; background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.3) 48%, transparent 58%); content: ''; opacity: 0; transform: translate3d(-34%, 0, 0); transition: opacity .18s ease, transform .72s cubic-bezier(.22,.61,.36,1); pointer-events: none; }
.history-image.gallery-tile:hover img,
.history-image.gallery-tile:focus-visible img { transform: translateZ(0) scale(1.028); }
.history-image.gallery-tile:hover::before,
.history-image.gallery-tile:focus-visible::before { display: block; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(23,30,53,.05), rgba(23,30,53,.48)); content: ''; opacity: 1; }
.history-image.gallery-tile:hover::after,
.history-image.gallery-tile:focus-visible::after { opacity: 1; transform: translate3d(34%, 0, 0); }
.timeline-content { transition: transform .42s cubic-bezier(.22,.61,.36,1), box-shadow .42s cubic-bezier(.22,.61,.36,1); }
.timeline-content:hover { transform: translate3d(0, -6px, 0); box-shadow: 0 20px 40px rgba(76,57,104,.16); }
.history-image.gallery-tile .gallery-view-button { top: 50%; left: 50%; z-index: 4; }
.history-image--world { background-image: url('../assets/server-background.avif'); }
.history-image--community { background-image: url('../assets/server-background.avif'); }
.history-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.history-content-info { padding: 24px; }
.history-item-title { margin: 0 0 9px; font-size: 19px; line-height: 1.35; }
.history-description { margin: 0; color: var(--ink-soft); font-size: 12.5px; font-weight: 650; line-height: 1.75; }
.history-authors { margin: 14px 0 0; color: var(--ink-soft); font-size: 11.5px; font-weight: 750; }
.author-tag { display: inline-flex; margin-left: 5px; padding: 4px 9px; border-radius: 999px; color: var(--pink-strong); background: rgba(255,120,173,.14); }

/* Ranking */
.ranking-layout { max-width: 1120px; margin: 0 auto; }
.ranking-updated { display: block; margin-bottom: 14px; color: var(--subpage-text-soft); font-size: 12px; font-weight: 650; }
.ranking-unit-legend { margin: -7px 0 14px; color: var(--subpage-text-soft); font-size: 11.5px; font-weight: 650; }
.ranking-filters { padding: 8px 12px; border: 1px solid rgba(255,255,255,.72); border-radius: 980px; background: rgba(255,255,255,.5); }
.ranking-table-header { border: 1px solid rgba(255,255,255,.72); border-radius: 980px; background: rgba(255,255,255,.5); }
.ranking-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.ranking-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px; border: 1px solid rgba(255,255,255,.72); border-radius: 999px; color: #1d1d1f; background: rgba(255,255,255,.55); font-size: 12.5px; font-weight: 750; cursor: pointer; transition: .18s var(--ease-smooth); }
.ranking-tab svg { width: 16px; height: 16px; }
.ranking-tab:hover, .ranking-tab.is-active { color: #fff; background: var(--pink); box-shadow: 0 8px 18px rgba(10,132,255,.18); }
.ranking-table-header { display: grid; grid-template-columns: 90px 1fr 140px; gap: 14px; margin-top: 18px; padding: 13px 24px; color: var(--ink); font-size: 11.5px; font-weight: 800; }
.ranking-table-header span:last-child { text-align: right; }
.ranking-table { display: grid; gap: 9px; padding-top: 9px; }
.ranking-table-shell { overflow: hidden; max-height: var(--ranking-collapsed-height, 900px); transition: max-height .45s var(--ease-smooth); }
.ranking-table-shell.is-expanded { max-height: var(--ranking-expanded-height, 24000px); }
.ranking-row { display: grid; grid-template-columns: 90px 1fr 140px; align-items: center; gap: 14px; min-height: 68px; padding: 0 24px; border: 1px solid rgba(255,255,255,.7); border-radius: 980px; background: rgba(255,255,255,.52); }
.ranking-row.is-top { background: rgba(255,214,229,.52); }
.ranking-rank, .ranking-value { color: var(--pink-strong); font-family: 'Quicksand', sans-serif; font-weight: 800; }
.ranking-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ranking-player strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 800; }
.ranking-player small { display: block; margin-top: 3px; color: var(--ink-muted); font-size: 11px; font-weight: 700; }
.ranking-value { text-align: right; }
.ranking-avatar, .member-avatar { position: relative; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--pink), #6ed6e3); }
.ranking-avatar { width: 38px; height: 38px; }
.ranking-avatar img, .member-avatar img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s ease; }
.ranking-avatar > img:not(.ranking-avatar-default), .member-avatar > img:not(.member-avatar-default) { position: absolute; inset: 0; z-index: 1; }
.ranking-avatar-default, .member-avatar-default { display: block; }
.ranking-toggle, .members-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 14px auto 0; padding: 0 24px; border: 1px solid rgba(255,255,255,.72); border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.58); font-size: 12px; font-weight: 700; cursor: pointer; }
.ranking-empty, .members-empty { margin: 28px 0; color: var(--ink-soft); font-size: 13px; font-weight: 750; text-align: center; }

/* About */
.about-content { max-width: 1240px; margin: 0 auto; }
.about-grid, .rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.about-card, .rule-card, .about-contact-card, .members-section { border: 1px solid rgba(255,255,255,.72); border-radius: 18px; background: rgba(255,255,255,.5); box-shadow: 0 14px 34px rgba(31,44,61,.08); }
.about-card { min-height: 220px; padding: 24px; }
.about-card-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 17px; border-radius: 13px; color: var(--pink); background: rgba(255,255,255,.68); }
.about-card-icon svg { width: 21px; }
.about-card h2, .rule-section h2, .members-section h2 { margin: 0 0 16px; font-size: 20px; color: var(--ink); font-weight: 800; }
.about-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.about-list li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.about-list strong { color: var(--ink); text-align: right; font-weight: 800; }
.rule-section { margin-top: 22px; }
.rule-grid { margin-top: 0; }
.rule-card { padding: 20px; }
.rule-card h3 { margin: 0 0 8px; font-size: 15px; color: var(--ink); font-weight: 800; }
.rule-card p { margin: 0; color: var(--ink-soft); font-size: 12.5px; font-weight: 650; line-height: 1.75; }
.members-section { margin-top: 22px; padding: 24px; }
.members-section-header { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 18px; }
.members-section-header h2 { margin-bottom: 6px; }
.members-section-header p { margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.members-kicker { margin: 0 0 7px; color: var(--pink-strong); font-family: 'Quicksand', sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.members-count { color: var(--pink-strong); font-size: 12px; font-weight: 800; }
.members-list-shell { max-height: var(--members-collapsed-height, 1000px); margin: -6px -8px -14px; padding: 6px 8px 14px; overflow: hidden; transition: max-height .45s var(--ease-smooth); }
.members-list-shell.is-expanded { max-height: var(--members-expanded-height, 24000px); }
.members-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 164px;
  padding: 24px 16px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background-color: rgba(255, 255, 255, .48);
  box-shadow: 0 4px 16px rgba(31, 44, 61, .04);
  text-align: center;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transition: transform .22s cubic-bezier(.22, .61, .36, 1), background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.member-card:hover {
  transform: translate3d(0, -4px, 0);
  background-color: rgba(255, 255, 255, .82);
  border-color: rgba(255, 255, 255, .95);
  box-shadow: 0 16px 32px rgba(31, 44, 61, .14);
}
.member-avatar { width: 68px; height: 68px; margin-bottom: 13px; border-radius: 16px; transform: translateZ(0); }
.member-info { width: 100%; min-width: 0; }
.member-info h4 { overflow: hidden; margin: 0; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.about-contact-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 22px; padding: 22px 24px; }
.about-contact-copy h2 { margin: 0 0 8px; font-size: 19px; color: var(--ink); font-weight: 800; }
.about-contact-copy p { margin: 0; color: var(--ink-soft); font-size: 12.5px; font-weight: 650; line-height: 1.7; }
.qq-link { display: inline-flex; align-items: center; gap: 8px; color: var(--pink-strong); font-size: 12px; font-weight: 800; }

/* Gallery */
.gallery-page-content { max-width: 1240px; margin: 0 auto; }
.gallery-page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.gallery-page-grid,
.gallery-page-content .gallery-grid,
.gallery-grid.gallery-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.gallery-page-grid .gallery-tile,
.gallery-page-content .gallery-tile {
  position: relative;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--glass-gradient, var(--glass));
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: transform .42s cubic-bezier(.22,.61,.36,1), box-shadow .42s cubic-bezier(.22,.61,.36,1), border-color .3s ease;
}
.gallery-page-grid .gallery-tile:hover { transform: translate3d(0, -6px, 0); border-color: rgba(0, 113, 227, .38); box-shadow: 0 22px 48px rgba(0, 113, 227, .16); }
.gallery-page-grid .gallery-media { position: relative; aspect-ratio: 16 / 9; min-height: 0; overflow: hidden; isolation: isolate; transform: translateZ(0); transform-origin: center; will-change: transform; transition: transform .62s cubic-bezier(.22,.61,.36,1); }
.gallery-page-grid .gallery-media-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gallery-page-grid .gallery-media::before { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(23, 30, 53, .03), rgba(23, 30, 53, .35)); content: ''; opacity: 0; transition: opacity .28s ease; }
.gallery-page-grid .gallery-media::after { position: absolute; inset: -30% -70%; z-index: 2; background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.3) 48%, transparent 58%); content: ''; opacity: 0; transform: translate3d(-34%, 0, 0); transition: opacity .18s ease, transform .72s cubic-bezier(.22,.61,.36,1); pointer-events: none; }
.gallery-page-grid .gallery-tile:hover .gallery-media, .gallery-page-grid .gallery-tile:focus-visible .gallery-media { transform: translateZ(0) scale(1.028); }
.gallery-page-grid .gallery-tile:hover .gallery-media::before, .gallery-page-grid .gallery-tile:focus-visible .gallery-media::before { opacity: 1; }
.gallery-page-grid .gallery-tile:hover .gallery-media::after, .gallery-page-grid .gallery-tile:focus-visible .gallery-media::after { opacity: 1; transform: translateX(34%); }
.gallery-page-grid .gallery-copy,
.gallery-page-content .gallery-copy {
  position: relative;
  inset: auto;
  z-index: 3;
  min-height: 96px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  color: var(--subpage-text);
  text-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: none;
  pointer-events: auto;
}
.gallery-page-grid .gallery-copy h3 { margin: 0; color: var(--subpage-text); font-size: 17px; font-weight: 800; line-height: 1.35; }
.gallery-page-grid .gallery-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 0; }
.gallery-page-grid .gallery-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 72%;
  min-height: 28px;
  padding: 0 12px;
  overflow: hidden;
  border-radius: 999px;
  color: #0f172a;
  background: rgba(0, 113, 227, .08);
  border: 1px solid rgba(0, 113, 227, .2);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.gallery-page-grid .gallery-author small {
  color: #0071e3;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.gallery-page-grid .gallery-author strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-page-grid .gallery-meta-date {
  flex: 0 0 auto;
  color: var(--subpage-text-soft, var(--ink-soft));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}
.gallery-note { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 20px 0 0; color: var(--subpage-text-soft); font-size: 11.5px; font-weight: 650; }

@media (max-width: 900px) {
  .subpage-main { width: min(100% - 40px, 720px); }
  .timeline { max-width: 720px; }
  .timeline::before { left: 25px; transform: none; }
  .timeline-item { min-height: 0; padding-left: 76px; }
  .timeline-marker { left: 0; width: 44px; height: 44px; transform: none; }
  .timeline-marker::before { width: 18px; height: 18px; }
  .timeline-date, .timeline-item:nth-child(even) .timeline-date { position: absolute; top: 4px; left: 76px; right: auto; margin: 0; }
  .timeline-content, .timeline-item:nth-child(even) .timeline-content { width: 100%; margin: 0; }
  .history-card { grid-template-columns: 1fr; }
  .history-image { min-height: 190px; }
  .about-grid, .rule-grid { grid-template-columns: 1fr; }
  .gallery-page-grid,
  .gallery-page-content .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .subpage-body {
    background-color: transparent !important;
    background-image: none !important;
    background-attachment: scroll !important;
  }
  html[data-theme="dark"] .subpage-body {
    background-color: transparent !important;
    background-image: none !important;
  }

  .gallery-page-grid,
  .gallery-page-content .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .gallery-page-grid .gallery-media { aspect-ratio: 16 / 10; }
  .gallery-page-grid .gallery-copy { min-height: auto; padding: 14px 18px; }
  .gallery-page-grid .gallery-copy h3 { font-size: 16px; }

  .ranking-filters {
    border-radius: 20px !important;
    padding: 10px !important;
  }
  .ranking-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .ranking-tab {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 12px;
    justify-content: center;
  }
  .ranking-tab:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .ranking-table-header {
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 11px;
  }
  .ranking-row {
    border-radius: 16px;
    min-height: 62px;
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page-grid .gallery-tile,
  .gallery-page-grid .gallery-media,
  .gallery-page-grid .gallery-media::before,
  .gallery-page-grid .gallery-media::after { transition-duration: .01ms; }
}
@media (max-width: 600px) {
  .subpage-main { width: min(100% - 28px, 520px); padding-top: 112px; padding-bottom: 56px; }
  .subpage-hero { margin-bottom: 34px; }
  .subpage-hero h1 { font-size: 42px; }
  .rules-main { width: min(100% - 28px, 520px); }
  .rules-hero { margin-bottom: 42px; }
  .rules-content { padding-left: 20px; }
  .rules-grid { grid-template-columns: 1fr; gap: 38px; }
  .timeline { gap: 34px; }
  .timeline-item { padding-left: 54px; }
  .timeline::before { left: 18px; }
  .timeline-marker { width: 38px; height: 38px; border-width: 4px; }
  .timeline-marker::before { width: 15px; height: 15px; }
  .timeline-dot { width: 9px; height: 9px; }
  .timeline-date, .timeline-item:nth-child(even) .timeline-date { top: 2px; left: 54px; font-size: 10px; }
  .timeline-content { border-radius: 16px; }
  .history-content-info { padding: 18px; }
  .ranking-table-header, .ranking-row { grid-template-columns: 54px 1fr 94px; padding-left: 12px; padding-right: 12px; gap: 8px; }
  .ranking-player { gap: 8px; }
  .ranking-avatar { width: 32px; height: 32px; }
  .gallery-page-heading, .members-section-header, .about-contact-card { align-items: flex-start; flex-direction: column; }
  .gallery-page-grid { grid-template-columns: 1fr; }
  .members-section, .about-card { padding: 18px; }
  .members-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .member-card { min-height: 138px; padding: 18px 12px; }
  .member-avatar { width: 56px; height: 56px; margin-bottom: 10px; }
  .about-contact-card { gap: 14px; }
}

/* Dark theme surfaces: Apple-grade frosted dark acrylic */
html[data-theme="dark"] .subpage-body {
  --subpage-text: #ffffff;
  --subpage-text-soft: #e2e8f0;
  --subpage-text-muted: #cbd5e1;
  --subpage-border: rgba(255, 255, 255, .14);
  --subpage-shadow: 0 12px 40px rgba(0, 0, 0, .45), inset 0 1px 0 0 rgba(255, 255, 255, .12);
  color: var(--subpage-text);
  background-color: #161617;
  background-image: linear-gradient(rgba(18, 18, 20, .78), rgba(18, 18, 20, .86)), url('../assets/server-background.avif');
}

html[data-theme="dark"] .timeline-date,
html[data-theme="dark"] .timeline-content,
html[data-theme="dark"] .ranking-filters,
html[data-theme="dark"] .ranking-table-header,
html[data-theme="dark"] .ranking-row,
html[data-theme="dark"] .about-card,
html[data-theme="dark"] .rule-card,
html[data-theme="dark"] .about-contact-card,
html[data-theme="dark"] .members-section,
html[data-theme="dark"] .ranking-toggle,
html[data-theme="dark"] .members-toggle,
html[data-theme="dark"] .gallery-page-grid .gallery-tile,
html[data-theme="dark"] .gallery-page-content .gallery-tile {
  border-color: var(--subpage-border);
  background: var(--glass-gradient, rgba(30, 30, 32, .75));
  box-shadow: var(--subpage-shadow);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

html[data-theme="dark"] .gallery-page-grid .gallery-copy,
html[data-theme="dark"] .gallery-page-content .gallery-copy {
  background: transparent;
  border-top: none;
  color: #ffffff;
}

html[data-theme="dark"] .gallery-page-grid .gallery-copy h3 {
  color: #ffffff;
}

html[data-theme="dark"] .gallery-page-grid .gallery-author {
  background: rgba(10, 132, 255, .15);
  border-color: rgba(96, 165, 250, .3);
}
html[data-theme="dark"] .gallery-page-grid .gallery-author small {
  color: #60a5fa;
}
html[data-theme="dark"] .gallery-page-grid .gallery-author strong {
  color: #f1f5f9;
}
html[data-theme="dark"] .gallery-page-grid .gallery-meta-date {
  color: #94a3b8;
}

html[data-theme="dark"] .history-description,
html[data-theme="dark"] .history-authors {
  color: #cbd5e1;
}

html[data-theme="dark"] .author-tag {
  color: #5ac8fa;
  background: rgba(90, 200, 250, .14);
}

html[data-theme="dark"] .timeline-date {
  color: #2997ff;
  background: rgba(30, 30, 32, .9);
}

html[data-theme="dark"] .ranking-tab,
html[data-theme="dark"] .about-card-icon {
  border-color: var(--subpage-border);
  color: var(--subpage-text-soft);
  background: rgba(255, 255, 255, .08);
}

html[data-theme="dark"] .ranking-tab:hover,
html[data-theme="dark"] .ranking-tab.is-active {
  color: #fff;
  background: var(--pink);
}

html[data-theme="dark"] .ranking-row.is-top {
  background: rgba(74, 48, 68, .78);
}

html[data-theme="dark"] .member-card {
  border-color: var(--subpage-border, rgba(255, 255, 255, .12));
  background-color: rgba(255, 255, 255, .06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .member-card:hover {
  background-color: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .24);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .45);
}

/* Shared Apple Frosted Glass material for subpage cards */
.timeline-date,
.timeline-content,
.ranking-filters,
.ranking-table-header,
.ranking-row,
.ranking-tab,
.ranking-toggle,
.about-card,
.rule-card,
.members-section,
.members-toggle,
.about-contact-card,
.subpage-actions .button-secondary {
  border-color: var(--line);
  background: var(--glass-gradient, var(--glass));
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.timeline-date,
.ranking-toggle,
.members-toggle,
.about-card-icon { background: var(--glass); }
.author-tag,
.ranking-row.is-top { background: var(--glass-subtle); }

html[data-theme="dark"] .timeline-date,
html[data-theme="dark"] .timeline-content,
html[data-theme="dark"] .ranking-filters,
html[data-theme="dark"] .ranking-table-header,
html[data-theme="dark"] .ranking-row,
html[data-theme="dark"] .ranking-tab,
html[data-theme="dark"] .ranking-toggle,
html[data-theme="dark"] .about-card,
html[data-theme="dark"] .rule-card,
html[data-theme="dark"] .members-section,
html[data-theme="dark"] .members-toggle,
html[data-theme="dark"] .about-contact-card,
html[data-theme="dark"] .subpage-actions .button-secondary {
  background: var(--glass-gradient, var(--glass));
  border-color: var(--line);
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
html[data-theme="dark"] .timeline-date,
html[data-theme="dark"] .ranking-toggle,
html[data-theme="dark"] .members-toggle,
html[data-theme="dark"] .about-card-icon { background: var(--glass); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
