/* Jianghu: Sword & Zither (琴剑江湖) theme, loaded after site.css on the
   /qinjianjianghu/ pages only. Ink-and-gold look carried over from the game's
   original GitHub Pages site: dark night palette, the misty landscape behind
   everything, serif titles. It is always dark, whatever the system setting. */

.theme-qjjh {
  --bg: #0b0b12;
  --bg-2: #14141e;
  --surface: rgb(18 18 28 / .86);
  --line: #30303e;
  --ink: #e0ddd5;
  --dim: #a4a2b0;
  --accent: #c9a84c;
  --accent-hover: #dfc070;
  --on-accent: #100e08;
  --chip: rgb(201 168 76 / .14);
  --chip-ink: #dfc070;
  --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 14px 40px rgb(0 0 0 / .5);
  --gold: linear-gradient(135deg, #d8b558 0%, #a87c2a 100%);
  --serif: Georgia, "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Noto Serif SC", serif;
  color-scheme: dark;
  background: #08080f;
}

/* The landscape sits on a fixed layer instead of background-attachment: fixed,
   which iOS Safari ignores. */
.theme-qjjh::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(5 5 14 / .35) 0%, rgb(5 5 14 / .55) 35%, rgb(8 8 15 / .86) 70%, rgb(8 8 15 / .95) 100%),
    url("/assets/img/qinjianjianghu-bg.webp") center 30% / cover no-repeat #08080f;
}

.theme-qjjh h1, .theme-qjjh h2, .theme-qjjh h3 { font-family: var(--serif); color: #ede9dc; font-weight: 600; }
.theme-qjjh .site-header { border-bottom-color: rgb(201 168 76 / .16); }
.theme-qjjh .site-footer { border-top-color: rgb(201 168 76 / .16); }
.theme-qjjh .btn:hover { border-color: var(--accent); }
.theme-qjjh .btn.primary { background: var(--gold); border-color: #b8913a; box-shadow: 0 4px 20px rgb(201 168 76 / .4); }
.theme-qjjh .btn.primary:hover { background: var(--gold); border-color: #dfc070; color: var(--on-accent); box-shadow: 0 6px 28px rgb(201 168 76 / .6); }
.theme-qjjh .btn:not(.primary) {
  background: rgb(255 255 255 / .06); border-color: rgb(201 168 76 / .38);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.theme-qjjh .panel, .theme-qjjh .policy { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.theme-qjjh .shots img { border-color: rgb(201 168 76 / .2); }
.theme-qjjh .policy .box { background: rgb(201 168 76 / .1); }

/* ---------- hero ---------- */
.qj-hero { text-align: center; padding: 8px 0 24px; }
.qj-hero .breadcrumb { text-align: left; }
.qj-title { margin: 28px 0 0; }
.qj-title .zh {
  display: block; font-size: clamp(2.8rem, 1.6rem + 6vw, 5.5rem); line-height: 1.05;
  letter-spacing: .22em; margin-right: -.22em; /* keep the spaced title centred */
  text-shadow: 0 0 90px rgb(201 168 76 / .5), 0 0 36px rgb(201 168 76 / .25), 0 4px 30px rgb(0 0 0 / .95);
}
.qj-title .en {
  display: block; margin-top: 10px; color: #dfc070;
  font-size: clamp(.85rem, .7rem + 1vw, 1.2rem); letter-spacing: .3em; text-transform: uppercase;
  text-shadow: 0 0 28px rgb(201 168 76 / .6), 0 2px 12px rgb(0 0 0 / .9);
}

.qj-trailer {
  position: relative; display: block; width: 100%; max-width: 820px; margin: 28px auto 24px;
  padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--bg-2);
  aspect-ratio: 1024 / 500;
  box-shadow: 0 0 0 1px rgb(201 168 76 / .22), 0 20px 60px rgb(0 0 0 / .75);
  transition: box-shadow .18s ease;
}
.qj-trailer img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, filter .4s ease; }
.qj-trailer:hover, .qj-trailer:focus-visible { box-shadow: 0 0 0 1px rgb(201 168 76 / .5), 0 20px 60px rgb(0 0 0 / .75); }
.qj-trailer:hover img, .qj-trailer:focus-visible img { transform: scale(1.03); filter: brightness(.65); }
.qj-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgb(10 9 6 / .5); border: 1px solid rgb(201 168 76 / .6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: 0 8px 30px rgb(0 0 0 / .6); transition: transform .18s ease;
}
.qj-trailer:hover .qj-play, .qj-trailer:focus-visible .qj-play { transform: translate(-50%, -50%) scale(1.08); }
.qj-play svg { width: 26px; height: 26px; fill: #ede9dc; margin-left: 4px; }
.qj-play-label {
  position: absolute; left: 0; right: 0; bottom: 14px; color: #ede9dc;
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  text-shadow: 0 2px 10px rgb(0 0 0 / .9);
}

.qj-tagline {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.05rem, .95rem + .6vw, 1.35rem);
  color: #ddd9cc; margin: 0 0 20px; text-shadow: 0 2px 12px rgb(0 0 0 / .8);
}
.qj-hero .actions { justify-content: center; }
.qj-hero .actions .btn { min-height: 48px; padding: 10px 22px; }
.qj-hero .chips { justify-content: center; margin-top: 18px; }

/* ---------- trailer dialog ---------- */
.qj-video {
  padding: 0; border: 0; background: transparent; overflow: visible;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
}
.qj-video::backdrop { background: rgb(5 5 10 / .9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.qj-video video {
  display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); width: auto; height: auto;
  border-radius: 10px; background: #000;
  box-shadow: 0 0 0 1px rgb(201 168 76 / .3), 0 20px 80px rgb(0 0 0 / .9);
}
/* YouTube Short: portrait 9:16, as tall as the screen allows */
.qj-video .qj-yt {
  display: block; border: 0; border-radius: 10px; background: #000;
  height: min(calc(100vh - 110px), calc((100vw - 32px) * 16 / 9));
  width: auto; aspect-ratio: 9 / 16; max-width: calc(100vw - 32px);
  box-shadow: 0 0 0 1px rgb(201 168 76 / .3), 0 20px 80px rgb(0 0 0 / .9);
}
.qj-video-close {
  display: flex; align-items: center; justify-content: center; margin: 0 0 10px auto;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: #ede9dc;
  background: rgb(255 255 255 / .06); border: 1px solid rgb(201 168 76 / .4);
}
.qj-video-close:hover { background: rgb(201 168 76 / .16); border-color: rgb(201 168 76 / .7); }
.qj-video-close svg { width: 16px; height: 16px; }

/* ---------- music button ---------- */
.qj-music {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: rgb(10 10 20 / .88); border: 1px solid rgb(201 168 76 / .32);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgb(0 0 0 / .45);
}
.qj-music:hover { border-color: rgb(201 168 76 / .7); }
.qj-music svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qj-music .off { display: none; }
.qj-music[aria-pressed="false"] .on { display: none; }
.qj-music[aria-pressed="false"] .off { display: block; }
@keyframes qj-pulse {
  0% { box-shadow: 0 4px 18px rgb(0 0 0 / .45), 0 0 0 0 rgb(201 168 76 / .35); }
  70% { box-shadow: 0 4px 18px rgb(0 0 0 / .45), 0 0 0 10px rgb(201 168 76 / 0); }
  100% { box-shadow: 0 4px 18px rgb(0 0 0 / .45), 0 0 0 0 rgb(201 168 76 / 0); }
}
.qj-music[aria-pressed="true"] { animation: qj-pulse 2.4s ease-out infinite; }
/* keep the last line of the footer clear of the button */
.theme-qjjh .site-footer { padding-bottom: 80px; }

@media (prefers-reduced-motion: reduce) {
  .qj-music[aria-pressed="true"] { animation: none; }
  .qj-trailer img { transition: none; }
}
