/* 12天堂 官網樣式
   配色跟著 LOGO：純黑底、火焰紅、銀白字；金色只給「開始遊戲」。 */
:root {
  --black: #000;
  --coal: #0e0708;
  --coal-2: #170b0c;
  --line: #3b1215;
  --blood: #7d1016;
  --ember: #e3303a;
  --steel: #e8e3de;
  --ash: #a39a94;
  --gold: #e8b84a;
  --gold-deep: #b98722;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", "MingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--black);
  color: var(--steel);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  padding-bottom: 96px; /* 手機版留給右下浮動按鈕 */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--steel); text-underline-offset: 3px; text-decoration-color: var(--blood); }
a:hover { color: #fff; text-decoration-color: var(--ember); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.3; margin: 0; letter-spacing: 0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
.muted { color: var(--ash); }
.small { font-size: 0.875rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--black); padding: 8px 12px; }

/* ---------- 版面寬度 ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---------- 頂部導覽 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.94);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; margin-right: auto; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand span { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.06em; }
.nav { display: none; }
.nav a {
  text-decoration: none; padding: 6px 10px; color: var(--ash); font-size: 0.95rem; white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ember); }
.menu-btn {
  background: none; border: 1px solid var(--line); color: var(--steel);
  font: inherit; font-size: 0.95rem; padding: 6px 12px; border-radius: 4px; cursor: pointer;
}
.site-header.open .nav {
  display: grid; grid-template-columns: 1fr 1fr;
  position: absolute; left: 0; right: 0; top: var(--header-h);
  background: var(--black); border-bottom: 1px solid var(--line); padding: 8px 12px 14px;
}
.site-header.open .nav a { padding: 12px 10px; font-size: 1.05rem; color: var(--steel); border-bottom: 1px solid var(--coal-2); }

/* ---------- 按鈕 ---------- */
.btn-play {
  display: inline-block; text-decoration: none; text-align: center;
  background: linear-gradient(#f3cd6c, var(--gold) 45%, var(--gold-deep));
  color: #1b0d00; font-family: var(--serif); font-weight: 700; letter-spacing: 0.1em;
  padding: 8px 16px; border-radius: 4px; border: 1px solid #f7dc8f;
}
.btn-play:hover { color: #000; filter: brightness(1.08); }
.btn-play.big { font-size: 1.35rem; padding: 14px 44px; }
.btn-line {
  display: inline-block; text-decoration: none; text-align: center;
  border: 1px solid var(--blood); color: var(--steel);
  padding: 10px 18px; border-radius: 4px; background: var(--coal);
}
.btn-line:hover { border-color: var(--ember); }
button.btn-line, button.btn-play { font: inherit; cursor: pointer; }
button.btn-play { font-family: var(--serif); font-weight: 700; }
button[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- 首屏 ---------- */
.hero { text-align: center; padding: 8px 0 40px; border-bottom: 1px solid var(--line); }
.hero .logo {
  width: min(640px, 100%); margin: 0 auto -18px;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at center, #000 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at center, #000 78%, transparent 100%);
}
.hero h1 { font-size: clamp(1.45rem, 5.2vw, 2.3rem); margin-bottom: 10px; }
.hero .sub { color: var(--ash); margin-bottom: 22px; }
.facts { list-style: none; padding: 0; margin: 26px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.facts li { margin: 0; border: 1px solid var(--line); background: var(--coal); padding: 4px 14px; border-radius: 999px; font-size: 0.95rem; }

/* ---------- 區塊 ---------- */
.section { padding: 44px 0 12px; }
.section > h2, .page-title { font-size: 1.6rem; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.section > h2::before, .page-title::before {
  content: ""; flex: none; width: 10px; height: 10px; background: var(--ember);
  transform: rotate(45deg); box-shadow: 0 0 10px var(--ember);
}
.page-title { font-size: 1.9rem; margin: 32px 0 8px; }
.lead { color: var(--ash); margin-bottom: 24px; }
h3 { font-size: 1.15rem; margin-bottom: 6px; }

/* 「我想找…」快速入口 */
.finder { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.finder li { margin: 0; }
.finder a { display: block; text-decoration: none; background: var(--coal); padding: 14px 16px; height: 100%; }
.finder a:hover { background: var(--coal-2); }
.finder strong { display: block; font-family: var(--serif); font-size: 1.12rem; color: #fff; }
.finder span { color: var(--ash); font-size: 0.92rem; }

/* 並排項目 */
.grid { display: grid; gap: 14px; margin-bottom: 1em; }
.item { background: var(--coal); border: 1px solid var(--line); padding: 16px 18px; }
.item p:last-child, .item ul:last-child { margin-bottom: 0; }
.item.red { border-top: 3px solid var(--ember); }
.item.calm { border-top: 3px solid #5b7fa6; }
.item.gold { border-top: 3px solid var(--gold); }

/* 可以 / 不行 */
.allow h3 { color: #9fd39b; }
.deny h3 { color: var(--ember); }

/* 路線圖 */
.roadmap { list-style: none; padding: 0; counter-reset: stage; border-left: 2px solid var(--blood); margin-left: 8px; }
.roadmap li { counter-increment: stage; position: relative; padding: 0 0 18px 22px; margin: 0; }
.roadmap li::before {
  content: counter(stage); position: absolute; left: -13px; top: 2px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--black); border: 2px solid var(--ember);
  font-size: 0.8rem; line-height: 20px; text-align: center; font-family: var(--serif);
}
.roadmap strong { font-family: var(--serif); font-size: 1.1rem; }
.roadmap span { display: block; color: var(--ash); }

/* GM 的話 */
.letter { background: var(--coal); border: 1px solid var(--line); border-left: 3px solid var(--ember); padding: 26px 22px; font-family: var(--serif); line-height: 2.05; font-size: 1.05rem; }
.letter p { margin-bottom: 1.4em; }
.letter .sign { text-align: right; color: var(--ash); margin: 0; }

/* 收尾 */
.closing { text-align: center; padding: 48px 0 24px; border-top: 1px solid var(--line); margin-top: 44px; }
.closing p { font-family: var(--serif); font-size: 1.25rem; }

/* 公告 */
.news { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.news li { margin: 0; border-bottom: 1px solid var(--line); }
.news details > summary { list-style: none; cursor: pointer; padding: 12px 4px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; }
.news details > summary::-webkit-details-marker { display: none; }
.news time { color: var(--ash); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.news .tag { grid-column: 1; font-size: 0.8rem; color: var(--ember); }
.news .title { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; }
.news .body { padding: 2px 4px 16px; color: var(--steel); }
.news details[open] > summary .title { color: #fff; }

/* 表格 */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); margin-bottom: 1em; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--coal-2); font-weight: 700; color: #fff; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.wrap-cell { white-space: normal; min-width: 14em; }
.notice { border: 1px dashed var(--gold-deep); color: var(--gold); padding: 8px 12px; font-size: 0.92rem; margin-bottom: 16px; background: #140e02; }

/* 分頁籤（資料庫） */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -20px 16px; padding: 0 20px 6px; position: sticky; top: var(--header-h); background: var(--black); z-index: 5; }
.tabs a { flex: none; text-decoration: none; padding: 8px 14px; border: 1px solid var(--line); background: var(--coal); border-radius: 4px; }
.tabs a:hover { border-color: var(--ember); }
.search { width: 100%; font: inherit; color: var(--steel); background: var(--coal); border: 1px solid var(--line); padding: 10px 12px; border-radius: 4px; margin-bottom: 12px; }
.search::placeholder { color: var(--ash); }

/* 步驟（真的有順序才用編號） */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 14px 44px; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px;
  border: 1px solid var(--ember); border-radius: 50%; text-align: center; line-height: 28px; font-family: var(--serif);
}
.steps strong { display: block; font-family: var(--serif); font-size: 1.08rem; }

/* 常見問題 */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 12px 4px; font-weight: 700; }
.faq details p { padding: 0 4px 6px; color: var(--steel); }

/* ---------- 浮動：社群 + 贊助 ---------- */
.dock { position: fixed; right: 12px; bottom: 14px; z-index: 50; display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 78px; }
.dock a { text-decoration: none; text-align: center; }
.dock-community { background: #fff; color: #111; border-radius: 8px; padding: 5px 5px 3px; box-shadow: 0 0 0 1px var(--blood), 0 6px 18px rgba(0, 0, 0, 0.8); font-size: 0.8rem; font-weight: 700; line-height: 1.4; }
.dock-community:hover { color: #000; }
.dock-community img { width: 100%; border-radius: 4px; }
.dock-community .desk { display: none; }
.dock-sponsor { background: var(--blood); color: #fff; border: 1px solid var(--ember); border-radius: 8px; padding: 7px 4px; font-family: var(--serif); font-weight: 700; letter-spacing: 0.08em; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8); line-height: 1.3; }
.dock-sponsor:hover { background: #9c141c; color: #fff; }
.dock-sponsor small { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.68rem; letter-spacing: 0; color: #ffd9a0; }
[hidden] { display: none !important; }

/* ---------- 頁尾 ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 8px; color: var(--ash); font-size: 0.88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.site-footer a { color: var(--ash); }

/* ---------- 平板以上 ---------- */
@media (min-width: 720px) {
  .finder { grid-template-columns: 1fr 1fr; }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .letter { padding: 36px 44px; }
}

/* ---------- 桌機：導覽展開、浮動區移到右上 ---------- */
@media (min-width: 1100px) {
  body { padding-bottom: 0; }
  .nav { display: flex; }
  .menu-btn { display: none; }
  .wrap { margin-right: max(230px, calc((100vw - 860px) / 2)); }
  .dock { top: calc(var(--header-h) + 20px); bottom: auto; right: 24px; width: 172px; gap: 10px; }
  .dock-community { padding: 8px 8px 6px; font-size: 0.92rem; }
  .dock-community .desk { display: block; font-weight: 400; font-size: 0.78rem; color: #555; }
  .dock-community .mob { display: none; }
  .dock-sponsor { padding: 11px 6px; font-size: 1.1rem; }
  .dock-sponsor small { font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
