/* ============================================================
   Fortune Dragon — style.css
   Design: Asian official style · Gold + Red on Dark Navy
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:      #d4a017;
  --gold-lt:   #f0c84a;
  --gold-dk:   #8a6600;
  --red:       #c0392b;
  --red-lt:    #e74c3c;
  --bg:        #07071a;
  --bg-card:   #0f0f2a;
  --bg-card2:  #131330;
  --text:      #e8d9b8;
  --text-muted:#a09070;
  --border:    rgba(212, 160, 23, 0.35);
  --radius:    8px;
  --max-w:     860px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--gold);
  line-height: 1.25;
}

h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); margin-bottom: 1.25rem; font-weight: 700; }
h2 { font-size: clamp(1.2rem, 3vw, 1.65rem); margin: 2.5rem 0 1rem; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
h3 { font-size: clamp(1rem, 2.5vw, 1.25rem); margin: 1.75rem 0 .75rem; color: var(--gold-lt); }

p  { margin-bottom: 1rem; }
ul, ol { margin: .75rem 0 1rem 1.4rem; }
li { margin-bottom: .4rem; }
strong { color: var(--gold-lt); }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-lt); text-decoration: underline; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */
header {
  background: rgba(7,7,26,.97);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .04em;
  text-shadow: 0 0 18px rgba(212,160,23,.5);
  text-decoration: none;
}
.site-logo:hover { color: var(--gold-lt); text-decoration: none; }

/* ---------- Main ---------- */
main { padding-bottom: 3rem; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 2.5rem 1.25rem 2rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(192,57,43,.12) 0%, transparent 70%);
}

.hero-img-wrap {
  display: inline-block;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 40px rgba(212,160,23,.18), 0 0 80px rgba(192,57,43,.08);
  margin-bottom: 1.75rem;
  max-width: 100%;
}

.hero-img-wrap img {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--red) 0%, #8b1a11 100%);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: .75rem 2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 2px 16px rgba(192,57,43,.4);
  transition: filter .2s, transform .15s;
  text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); color: #fff; text-decoration: none; }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: .75rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  transition: background .2s, color .2s;
  text-decoration: none;
}
.btn-outline:hover { background: rgba(212,160,23,.12); color: var(--gold-lt); text-decoration: none; }

/* ---------- Table of Contents ---------- */
.toc-wrap {
  max-width: var(--max-w);
  margin: 1.75rem auto;
  padding: 0 1.25rem;
}

.toc-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.toc-details summary {
  cursor: pointer;
  padding: .85rem 1.25rem;
  font-family: 'Cinzel', serif;
  font-size: .95rem;
  color: var(--gold);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
}
.toc-details summary::-webkit-details-marker { display: none; }
.toc-details summary::before {
  content: '▶';
  font-size: .7rem;
  transition: transform .2s;
  display: inline-block;
}
.toc-details[open] summary::before { transform: rotate(90deg); }
.toc-details summary:hover { color: var(--gold-lt); }

.toc-list {
  list-style: none;
  margin: 0;
  padding: .5rem 1.25rem 1rem 2.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .25rem 1rem;
}
.toc-list li { margin: 0; }
.toc-list a { font-size: .9rem; color: var(--text-muted); }
.toc-list a:hover { color: var(--gold); }

/* ---------- CTA Card ---------- */
.cta-card {
  max-width: var(--max-w);
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
}

.cta-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 2px 24px rgba(212,160,23,.08);
}

.cta-card-img {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.cta-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cta-card-body { flex: 1; }
.cta-card-body h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.cta-card-body p { margin: 0 0 .85rem; font-size: .9rem; color: var(--text-muted); }

/* ---------- Content ---------- */
.content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

section { margin-bottom: 1rem; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: .93rem;
}
thead tr { background: rgba(212,160,23,.12); }
th {
  text-align: left;
  padding: .7rem 1rem;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: .85rem;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(212,160,23,.1);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(212,160,23,.04); }

/* ---------- Gameplay Figure ---------- */
.gameplay-figure {
  margin: 2rem 0;
  text-align: center;
}
.gameplay-figure img {
  width: 100%;
  max-width: 720px;
  height: auto;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 32px rgba(0,0,0,.5);
}
.gameplay-figure figcaption {
  margin-top: .6rem;
  font-size: .85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- FAQ ---------- */
.faq-list { margin: 0; padding: 0; list-style: none; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
  background: var(--bg-card);
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--gold-lt);
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+';
  font-size: 1.2rem;
  line-height: 1;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] summary::before { content: '−'; }
.faq-item summary:hover { color: var(--gold); }

.faq-answer {
  padding: 0 1.25rem 1rem 3rem;
  font-size: .95rem;
  color: var(--text);
}
.faq-answer p { margin-bottom: 0; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  text-align: center;
  background: rgba(7,7,26,.8);
}

.footer-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--gold);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}
.footer-logo:hover { color: var(--gold-lt); text-decoration: none; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .88rem;
}
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--gold); }

/* ---------- Popup Banner ---------- */
#close-popup { display: none; }

.popup-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: linear-gradient(90deg, #0f0f2a 0%, #1a0a08 50%, #0f0f2a 100%);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -4px 24px rgba(0,0,0,.6);
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.popup-text {
  color: var(--text);
  font-size: .95rem;
  flex: 1;
  min-width: 200px;
  text-align: center;
}
.popup-text strong { color: var(--gold); }

.popup-close {
  position: absolute;
  top: .5rem;
  right: .75rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: 3px;
  transition: color .15s;
}
.popup-close:hover { color: var(--gold); }

#close-popup:checked ~ .popup-banner { display: none; }

/* ---------- Ornamental divider ---------- */
.ornament {
  text-align: center;
  color: var(--gold-dk);
  font-size: 1.2rem;
  margin: 1.5rem 0;
  letter-spacing: .5em;
  opacity: .6;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .cta-card-inner { flex-direction: column; text-align: center; }
  .cta-card-img { width: 80px; height: 80px; }
  .toc-list { grid-template-columns: 1fr; }
  .popup-banner { gap: .6rem; padding: .75rem 2.5rem .75rem 1rem; }
  .popup-text { font-size: .85rem; }
  .hero-btns { flex-direction: column; align-items: center; }
  h2 { font-size: 1.15rem; }
}

@media (max-width: 400px) {
  .btn-primary, .btn-outline { padding: .65rem 1.4rem; font-size: .88rem; }
}
