:root {
  color-scheme: dark;
  --canvas: #0b141c;
  --ink: #f4f2eb;
  --muted: #adbac4;
  --gold: #f4ca89;
  --aqua: #9bcbd3;
  --line: #31434d;
  --display: "Noto Serif TC", "Songti TC", PMingLiU, "Microsoft JhengHei", serif;
  --body: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.75 var(--body); }
body.dialog-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
section[id] { scroll-margin-top: 24px; }
.wrap { width: min(1160px, calc(100% - 96px)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 30;
  top: 12px;
  left: 16px;
  transform: translateY(calc(-100% - 16px));
  padding: 9px 16px;
  background: var(--gold);
  color: #16130f;
}
.skip-link:focus { transform: none; }

.site-header { position: relative; z-index: 5; background: #0a1017; border-bottom: 1px solid #27343d; }
.nav-wrap { width: min(1320px, calc(100% - 96px)); margin-inline: auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: .12em; flex-shrink: 0; }
.brand img { width: 42px; height: 42px; border-radius: 9px; }
.brand small { display: block; margin-top: 5px; font-size: 10px; color: var(--gold); letter-spacing: .32em; }
#main-nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 44px); font-size: 14px; font-weight: 600; }
#main-nav a:hover { color: var(--gold); }
.nav-contact { display: flex; gap: 16px; align-items: center; padding: 7px 0 8px; color: var(--gold); border-bottom: 1px solid #9e7853; }
.menu-toggle { display: none; }

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(500px, 42vw, 680px);
  overflow: hidden;
  isolation: isolate;
  background: #060d15;
  border-bottom: 1px solid #394650;
}
.hero-art, .hero-shade { position: absolute; z-index: -1; inset: 0; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 59% 53%; }
.hero-shade {
  background: linear-gradient(90deg, #060b13e8 0%, #08111bd1 25%, #08111b65 44%, transparent 65%),
    linear-gradient(0deg, #080e16bc 0%, transparent 28%);
}
.hero-content { padding-block: 58px 64px; }
.hero-label { display: flex; align-items: center; gap: 13px; color: var(--aqua); font-size: 13px; font-weight: 650; letter-spacing: .22em; }
.hero-label::before { content: ""; width: 26px; height: 2px; background: var(--gold); }
.hero h1 { margin-top: 23px; font: 750 clamp(53px, 6.5vw, 96px)/1.06 var(--display); letter-spacing: .06em; text-shadow: 0 3px 25px #0306098a; }
.hero h1 > span, .hero h1 em { display: block; }
.hero h1 em { margin-top: 7px; color: var(--gold); font-style: normal; }
.hero-lead { margin-top: 26px; color: #e0e6e9; font-size: 16px; line-height: 1.9; letter-spacing: .04em; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 29px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 48px;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  transition: background-color .2s, border-color .2s;
}
.button span { font-size: 18px; line-height: 1; }
.button-gold { background: var(--gold); color: #21190e; }
.button-gold:hover { background: #ffdfa9; }
.button-outline { border-color: #738490; color: var(--ink); background: #08121a60; }
.button-outline:hover { border-color: var(--gold); }

.game-section { padding-block: 82px 90px; }
.section-title { display: grid; grid-template-columns: 1fr minmax(245px, .55fr); align-items: end; gap: 26px; margin-bottom: 34px; }
.kicker { display: flex; align-items: center; gap: 11px; color: var(--aqua); font-size: 12px; font-weight: 650; letter-spacing: .18em; }
.kicker span { color: var(--gold); font-variant-numeric: tabular-nums; padding-right: 10px; border-right: 1px solid #56717c; }
h2 { font: 700 clamp(31px, 3.9vw, 50px)/1.25 var(--display); letter-spacing: .04em; }
.kicker + h2 { margin-top: 12px; }
.section-title > p { max-width: 410px; color: var(--muted); font-size: 15px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feature { min-width: 0; background: #111e28; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.feature-art { background: #0a131d; border-bottom: 1px solid var(--line); }
.feature-art img { width: 100%; aspect-ratio: 570 / 488; object-fit: contain; }
.feature-body { display: flex; align-items: start; gap: 12px; padding: 18px 18px 21px; }
.feature-body > span { margin-top: 3px; color: var(--gold); font-size: 11px; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.feature h3 { font-size: 19px; line-height: 1.45; }
.feature p { margin-top: 7px; font-size: 14px; color: var(--muted); line-height: 1.8; }

.gallery-section { padding-block: 76px 84px; border-block: 1px solid #263941; background: #101c25; }
.gallery { display: grid; grid-template-columns: minmax(0, 3.2fr) minmax(182px, 1fr); gap: 20px; }
.gallery-main { min-width: 0; background: #0a131d; border: 1px solid #3a505a; border-radius: 5px; overflow: hidden; }
.gallery-image-frame { position: relative; background: #091119; aspect-ratio: 16 / 9; }
#gallery-image { width: 100%; height: 100%; object-fit: contain; }
.gallery-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 17px; border-top: 1px solid #3a505a; }
.gallery-caption h3 { font-size: 17px; line-height: 1.45; }
.gallery-caption p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.gallery-controls { display: none; align-items: center; gap: 7px; flex-shrink: 0; }
.js .gallery-controls { display: flex; }
#gallery-count { padding-right: 6px; color: var(--gold); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#gallery-count span { color: var(--muted); }
.icon-button {
  display: grid;
  place-items: center;
  padding: 0;
  width: 39px;
  height: 39px;
  background: #111e28;
  color: var(--ink);
  border: 1px solid #526672;
  border-radius: 3px;
  font-size: 19px;
}
.icon-button:hover { border-color: var(--gold); color: var(--gold); }
.expand-button { display: none; position: absolute; right: 10px; bottom: 10px; background: #09131deb; }
.js .expand-button { display: grid; }
.expand-button svg { width: 23px; height: 23px; }
.gallery-thumbnails { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 9px; }
.gallery-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px;
  background: #0a141d;
  border: 1px solid #3a505a;
  border-radius: 4px;
}
.gallery-thumb:hover, .gallery-thumb.selected { border-color: var(--gold); background: #1d282e; }
.gallery-thumb img { width: 49%; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 2px; }
.gallery-thumb > span { font-size: 13px; font-weight: 650; line-height: 1.4; }
.gallery-thumb small { display: block; margin-bottom: 3px; color: var(--gold); font-variant-numeric: tabular-nums; }

.support-section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.15fr); gap: clamp(32px, 7vw, 98px); padding-block: 84px 91px; }
.support-intro > p:not(.kicker) { max-width: 400px; margin: 19px 0 23px; color: var(--muted); }
.support-email { display: table; margin-top: 14px; overflow-wrap: anywhere; color: var(--aqua); font-size: 14px; }
.support-email:hover { text-decoration: underline; }
.faq h3 { margin-bottom: 13px; font-size: 18px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; padding: 15px 0; font-size: 15px; font-weight: 650; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary span { width: 13px; height: 13px; position: relative; flex-shrink: 0; }
.faq summary span::before, .faq summary span::after { content: ""; position: absolute; top: 6px; width: 13px; height: 1px; background: var(--gold); }
.faq summary span::after { transform: rotate(90deg); }
.faq details[open] summary span::after { transform: none; }
.faq-answer { padding-bottom: 15px; color: var(--muted); font-size: 14px; }
.faq-answer a { display: inline-block; margin-top: 7px; color: var(--aqua); text-decoration: underline; text-underline-offset: 4px; }

.site-footer { background: #080f16; border-top: 1px solid var(--line); }
.footer-top, .footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.footer-top { padding-block: 31px 24px; }
.footer-contact { text-align: right; }
.footer-contact > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.footer-contact a { color: var(--aqua); font-size: 15px; overflow-wrap: anywhere; }
.footer-bottom { padding-block: 17px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-bottom nav { display: flex; gap: 22px; }
.site-footer a:hover { color: var(--gold); }

dialog { width: min(1100px, calc(100% - 28px)); max-height: 94dvh; padding: 0; color: var(--ink); background: #101d26; border: 1px solid #526672; border-radius: 6px; }
dialog::backdrop { background: #03060be6; }
.dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 15px; }
.dialog-bar button:not(.icon-button) { padding: 5px 9px; background: transparent; border: 0; color: var(--gold); }
#dialog-image { width: 100%; max-height: 72dvh; object-fit: contain; background: #080f16; }

.legal-heading { padding-block: 48px 38px; border-bottom: 1px solid var(--line); }
.back-link { display: inline-block; font-size: 14px; color: var(--gold); }
.back-link:hover { text-decoration: underline; }
.legal-heading .kicker { margin-top: 22px; letter-spacing: .08em; }
.legal-heading h1, .missing-page h1 { margin-top: 9px; font: 750 clamp(37px, 5vw, 63px)/1.23 var(--display); }
.legal-heading > p:last-child { margin-top: 13px; color: var(--muted); font-size: 14px; }
.legal-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); align-items: start; gap: clamp(27px, 5vw, 68px); padding-block: 37px 76px; }
.legal-toc { position: sticky; top: 25px; background: #111f29; border: 1px solid var(--line); padding: 18px; border-radius: 4px; }
.legal-toc h2 { margin-bottom: 12px; font: 700 16px/1.4 var(--body); }
.legal-toc nav { display: grid; gap: 9px; margin-bottom: 15px; }
.legal-toc nav a { display: flex; align-items: baseline; gap: 7px; color: #c2cfd5; font-size: 13px; }
.legal-toc nav a:hover { color: var(--gold); }
.legal-toc small, .legal-content h2 small { color: var(--aqua); font: 650 12px/1 var(--body); font-variant-numeric: tabular-nums; }
.legal-content { max-width: 760px; }
.legal-summary { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.legal-content section { margin-top: 27px; }
.legal-content h2 { display: flex; align-items: baseline; gap: 11px; margin-bottom: 9px; font: 700 23px/1.5 var(--body); }
.legal-content p { margin-bottom: 12px; color: #d1dce0; line-height: 1.9; }
.legal-content a { color: var(--aqua); text-decoration: underline; overflow-wrap: anywhere; }
.missing-page { min-height: 65vh; padding-block: 77px; }
.missing-page > p:not(.kicker) { margin-top: 15px; color: var(--muted); }

@media (max-width: 900px) {
  .wrap, .nav-wrap { width: calc(100% - 64px); }
  .hero { min-height: 530px; }
  .hero h1 { font-size: clamp(48px, 8vw, 76px); }
  .feature-grid { gap: 13px; }
  .feature-body { padding: 14px 12px; gap: 8px; }
  .feature h3 { font-size: 17px; }
  .gallery { grid-template-columns: 1fr; gap: 12px; }
  .gallery-thumbnails { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto; }
  .gallery-thumb { flex-direction: column; align-items: start; gap: 5px; }
  .gallery-thumb img { width: 100%; }
  .gallery-thumb small { display: inline; margin-right: 6px; }
}

@media (max-width: 620px) {
  .wrap, .nav-wrap { width: calc(100% - 38px); }
  .nav-wrap { min-height: 66px; flex-wrap: wrap; gap: 10px; }
  .brand { font-size: 15px; }
  .brand img { width: 37px; height: 37px; }
  #main-nav { width: 100%; flex-wrap: wrap; gap: 12px 20px; padding-block: 4px 13px; font-size: 13px; }
  .js .menu-toggle { display: grid; gap: 5px; place-content: center; width: 39px; height: 39px; background: transparent; border: 1px solid #425461; border-radius: 3px; color: var(--ink); }
  .menu-toggle span { display: block; width: 17px; height: 1px; background: currentColor; }
  .js #main-nav { display: none; position: absolute; top: 66px; left: 0; background: #0b151e; border-bottom: 1px solid var(--line); padding: 13px 20px 18px; }
  .js #main-nav.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .js #main-nav a { padding-block: 10px; }
  .hero { min-height: 0; }
  .hero-art { bottom: auto; }
  .hero-art img { height: auto; object-fit: contain; }
  .hero-shade { background: linear-gradient(180deg, transparent 18%, #070e1748 34%, #070e17 58%); }
  .hero-content { padding-block: min(54vw, 305px) 37px; }
  .hero-label { font-size: 11px; letter-spacing: .17em; }
  .hero h1 { margin-top: 15px; font-size: clamp(44px, 11.8vw, 68px); }
  .hero h1 em { margin-top: 3px; }
  .hero-lead { font-size: 14px; margin-top: 17px; }
  .hero-actions { gap: 9px; margin-top: 22px; }
  .button { min-height: 45px; padding-inline: 13px; gap: 13px; font-size: 13px; }
  .game-section, .gallery-section, .support-section { padding-block: 49px 53px; }
  .section-title { grid-template-columns: 1fr; gap: 12px; margin-bottom: 22px; }
  .section-title > p { font-size: 14px; }
  .feature-grid { grid-template-columns: 1fr; gap: 11px; }
  .feature { display: grid; grid-template-columns: minmax(104px, 35%) minmax(0, 1fr); align-items: stretch; }
  .feature-art { display: grid; align-items: center; border-bottom: 0; border-right: 1px solid var(--line); }
  .feature-body { padding: 12px 10px; gap: 8px; }
  .feature p { font-size: 13px; margin-top: 5px; }
  .gallery-caption { padding: 10px; gap: 9px; }
  .gallery-caption h3 { font-size: 15px; }
  .gallery-caption p { font-size: 12px; }
  .gallery-controls { gap: 5px; }
  #gallery-count { display: none; }
  .icon-button { width: 34px; height: 34px; }
  .gallery-thumbnails { gap: 5px; }
  .gallery-thumb { padding: 4px; }
  .gallery-thumb > span { font-size: 11px; }
  .gallery-thumb small { display: none; }
  .support-section { grid-template-columns: 1fr; gap: 28px; }
  .footer-top, .footer-bottom { align-items: start; flex-direction: column; }
  .footer-contact { text-align: left; }
  .footer-bottom { gap: 9px; }
  .legal-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 24px; padding-bottom: 48px; }
  .legal-toc { position: static; }
  .legal-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-content h2 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
