/* หน้าแรก TABARD ONLINE — เว็บหลักของเกม (แยกจาก CSS ตัวเกม) โทนทอง/น้ำตาลเข้มเดียวกับหน้าโหลดและหน้าเข้าสู่ระบบ */
:root {
    --site-bg: #0d0a08;
    --site-panel: #17120e;
    --site-panel-hi: #211a13;
    --site-line: rgba(212, 175, 55, 0.24);
    --site-gold: #d4af37;
    --site-gold-hi: #f0d78c;
    --site-text: #ece4d6;
    --site-muted: #a89c88;
    --site-max: 1120px;
    --site-header-h: 64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--site-header-h) + 12px);
}

body.site-body {
    margin: 0;
    min-height: 100vh;
    background: var(--site-bg);
    color: var(--site-text);
    font-family: 'Kanit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.site-body a {
    color: inherit;
    text-decoration: none;
}

.site-wrap {
    width: min(100% - 40px, var(--site-max));
    margin-inline: auto;
}

/* ---------- แถบหัวเว็บ ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--site-header-h);
    background: rgba(13, 10, 8, 0.88);
    border-bottom: 1px solid var(--site-line);
    backdrop-filter: blur(10px);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
}

.site-brand {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: 'Cinzel', 'Times New Roman', serif;
    line-height: 1;
    white-space: nowrap;
}

.site-brand-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(180deg, #fff3c4 0%, #d4af37 45%, #8a6a18 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.site-brand-online {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--site-gold);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.site-nav a {
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 400;
    color: var(--site-muted);
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
    color: var(--site-gold-hi);
    background: rgba(212, 175, 55, 0.1);
}

/* เมนูย่อยในแถบหัวเว็บ (ชุมชน) — <details> เปิดปิดได้เองแม้ไม่มีสคริปต์ */
.site-nav-menu {
    position: relative;
}

.site-nav-menu > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 400;
    color: var(--site-muted);
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav-menu > summary::-webkit-details-marker {
    display: none;
}

.site-nav-menu > summary::after {
    content: '';
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.site-nav-menu[open] > summary::after {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.site-nav-menu > summary:hover,
.site-nav-menu > summary:focus-visible,
.site-nav-menu[open] > summary {
    color: var(--site-gold-hi);
    background: rgba(212, 175, 55, 0.1);
}

.site-nav-menu-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 190px;
    padding: 6px;
    background: var(--site-panel-hi);
    border: 1px solid var(--site-line);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.site-nav .site-nav-menu-list a {
    display: block;
    padding: 9px 12px;
    white-space: nowrap;
    color: var(--site-text);
}

/* ---------- ปุ่ม ---------- */
.site-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 22px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.site-btn--play {
    color: #1a1206 !important;
    background: linear-gradient(180deg, #ffe9a6 0%, #e2b440 48%, #b9871c 100%);
    border-color: #f6dd92;
    box-shadow:
        0 2px 0 #6b4c0c,
        0 8px 24px rgba(212, 175, 55, 0.28);
}

.site-btn--play:hover,
.site-btn--play:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow:
        0 3px 0 #6b4c0c,
        0 12px 30px rgba(212, 175, 55, 0.4);
}

.site-btn--play:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 #6b4c0c;
}

.site-btn--ghost {
    color: var(--site-gold-hi) !important;
    background: rgba(13, 10, 8, 0.55);
    border-color: rgba(212, 175, 55, 0.5);
}

.site-btn--ghost:hover,
.site-btn--ghost:focus-visible {
    background: rgba(212, 175, 55, 0.14);
    border-color: var(--site-gold-hi);
}

.site-btn--lg {
    min-height: 58px;
    padding: 10px 40px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.site-header .site-btn--play {
    min-height: 40px;
    padding: 6px 20px;
    font-size: 15px;
}

/* ---------- ฮีโร่ ---------- */
.site-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(78vh, 720px);
    padding: 72px 0 96px;
    overflow: hidden;
    isolation: isolate;
}

.site-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url('/assets/main/bg.webp') center 30% / cover no-repeat;
}

.site-hero-veil {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(13, 10, 8, 0.45) 0%, rgba(13, 10, 8, 0.2) 38%, rgba(13, 10, 8, 0.86) 84%, var(--site-bg) 100%),
        radial-gradient(ellipse 80% 70% at 50% 40%, transparent 30%, rgba(13, 10, 8, 0.6) 100%);
}

.site-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.site-hero-eyebrow {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--site-gold);
}

.site-hero-title {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Cinzel', 'Times New Roman', serif;
    line-height: 1;
}

.site-hero-title-main {
    font-size: clamp(54px, 11vw, 112px);
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(180deg, #fff6d2 0%, #e2b947 44%, #8a6a18 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.7)) drop-shadow(0 0 26px rgba(212, 175, 55, 0.35));
}

.site-hero-title-sub {
    margin-top: 6px;
    font-size: clamp(15px, 2.6vw, 24px);
    font-weight: 600;
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    color: var(--site-gold);
    text-shadow: 0 1px 0 #000;
}

.site-hero-lead {
    max-width: 620px;
    margin: 26px 0 0;
    font-size: clamp(16px, 2.2vw, 20px);
    color: #f3ecdf;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.site-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 34px;
}

.site-hero-note {
    margin: 18px 0 0;
    font-size: 14px;
    color: rgba(236, 228, 214, 0.75);
}

/* ---------- แถบจุดเด่นสั้น ---------- */
.site-facts {
    position: relative;
    z-index: 2;
    margin-top: -52px;
}

.site-facts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: linear-gradient(180deg, var(--site-panel-hi) 0%, var(--site-panel) 100%);
    border: 1px solid var(--site-line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.site-fact {
    padding: 20px 18px;
    text-align: center;
}

.site-fact + .site-fact {
    border-left: 1px solid var(--site-line);
}

.site-fact-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--site-gold-hi);
}

.site-fact-text {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--site-muted);
}

/* ---------- โครงหมวด ---------- */
.site-section {
    padding: 84px 0 0;
}

.site-section-head {
    max-width: 640px;
    margin: 0 auto 36px;
    text-align: center;
}

.site-kicker {
    margin: 0 0 6px;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.34em;
    color: var(--site-gold);
}

.site-h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    line-height: 1.25;
    color: #fff6dc;
}

.site-h2::after {
    content: '';
    display: block;
    width: 72px;
    height: 2px;
    margin: 14px auto 0;
    background: linear-gradient(90deg, transparent, var(--site-gold), transparent);
}

.site-section-lead {
    margin: 14px 0 0;
    color: var(--site-muted);
}

/* ---------- การ์ดระบบเกม ---------- */
.site-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.site-feature {
    display: flex;
    flex-direction: column;
    padding: 24px 22px;
    background: linear-gradient(165deg, var(--site-panel-hi) 0%, var(--site-panel) 100%);
    border: 1px solid var(--site-line);
    border-radius: 12px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a.site-feature:hover,
a.site-feature:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(240, 215, 140, 0.6);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.site-feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    padding: 9px;
    color: var(--site-gold-hi);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

.site-feature-title {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 500;
    color: #fff6dc;
}

.site-feature-text {
    margin: 0;
    font-size: 15px;
    color: var(--site-muted);
}

.site-feature-more {
    margin-top: auto;
    padding-top: 14px;
    font-size: 14px;
    font-weight: 400;
    color: var(--site-gold);
}

/* ---------- โชว์ตัวละคร ---------- */
.site-showcase {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 36px;
    align-items: center;
    padding: 28px;
    background:
        radial-gradient(ellipse 70% 90% at 28% 70%, rgba(212, 175, 55, 0.12), transparent 70%),
        linear-gradient(165deg, var(--site-panel-hi) 0%, var(--site-panel) 100%);
    border: 1px solid var(--site-line);
    border-radius: 16px;
}

.site-parade {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.site-showcase-text .site-h2 {
    text-align: left;
}

.site-showcase-text .site-h2::after {
    margin-left: 0;
}

.site-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.site-list li {
    position: relative;
    margin-top: 8px;
    padding-left: 22px;
    color: var(--site-text);
}

.site-list li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 8px;
    height: 8px;
    background: var(--site-gold);
    transform: rotate(45deg);
}

/* ---------- ข้อมูลเกม (ศูนย์รวมคู่มือ) ---------- */
.site-guide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.site-guide-group {
    padding: 20px 20px 22px;
    background: var(--site-panel);
    border: 1px solid var(--site-line);
    border-radius: 12px;
}

.site-guide-title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    font-size: 17px;
    font-weight: 500;
    color: var(--site-gold-hi);
    border-bottom: 1px solid var(--site-line);
}

.site-guide-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-guide-links a {
    padding: 5px 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--site-text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 999px;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.site-guide-links a:hover,
.site-guide-links a:focus-visible {
    color: var(--site-gold-hi);
    border-color: var(--site-gold-hi);
    background: rgba(212, 175, 55, 0.12);
}

.site-section-cta {
    margin-top: 28px;
    text-align: center;
}

/* ---------- ขั้นตอนเริ่มเล่น ---------- */
.site-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.site-step {
    position: relative;
    padding: 26px 22px 22px 76px;
    background: var(--site-panel);
    border: 1px solid var(--site-line);
    border-radius: 12px;
    counter-increment: step;
}

.site-step::before {
    content: counter(step);
    position: absolute;
    left: 20px;
    top: 22px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1206;
    background: linear-gradient(180deg, #ffe9a6 0%, #c9992a 100%);
    border-radius: 50%;
}

.site-step-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 500;
    color: #fff6dc;
}

.site-step-text {
    margin: 0;
    font-size: 15px;
    color: var(--site-muted);
}

/* ---------- ปิดท้าย + ฟุตเตอร์ ---------- */
.site-final {
    margin-top: 84px;
    padding: 64px 0;
    text-align: center;
    background:
        linear-gradient(180deg, var(--site-bg) 0%, rgba(13, 10, 8, 0.7) 40%, var(--site-bg) 100%),
        url('/assets/main/select.webp') center / cover no-repeat;
    border-top: 1px solid var(--site-line);
    border-bottom: 1px solid var(--site-line);
}

.site-final-title {
    margin: 0 0 22px;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 600;
    color: #fff6dc;
}

.site-footer {
    padding: 28px 0 36px;
    font-size: 14px;
    color: var(--site-muted);
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
    color: var(--site-gold-hi);
}

/* ---------- อัปเดตล่าสุด (หน้าแรก) ---------- */
.site-news {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.site-news-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--site-panel);
    border: 1px solid var(--site-line);
    border-radius: 12px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.site-news-card:hover,
.site-news-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--site-gold);
}

.site-news-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top center;
    background: #0a0806;
    border-bottom: 1px solid var(--site-line);
}

.site-news-body {
    padding: 14px 16px 18px;
}

.site-news-meta {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--site-gold);
}

.site-news-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--site-text);
}

.site-news-lead {
    margin: 0;
    font-size: 14px;
    color: var(--site-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- หน้าแพตช์โน้ต ---------- */
.site-patch-page {
    padding-top: 56px;
}

.site-patch-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 860px;
    margin-inline: auto;
}

.site-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.site-pager .site-pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 14px;
    font-weight: 500;
    color: var(--site-gold-hi);
    background: var(--site-panel);
    border: 1px solid var(--site-line);
    border-radius: 8px;
}

.site-pager a.site-pager-link:hover,
.site-pager a.site-pager-link:focus-visible {
    background: rgba(212, 175, 55, 0.14);
    border-color: var(--site-gold-hi);
}

.site-pager .site-pager-link.is-current {
    color: #1a1206;
    background: linear-gradient(180deg, #ffe9a6 0%, #e2b440 100%);
    border-color: #f6dd92;
}

.site-pager .site-pager-link.is-disabled {
    color: var(--site-muted);
    opacity: 0.5;
}

.site-patch-loading {
    margin: 0;
    text-align: center;
    color: var(--site-muted);
}

.site-patch {
    padding: 26px 28px 28px;
    background: var(--site-panel);
    border: 1px solid var(--site-line);
    border-radius: 14px;
    scroll-margin-top: calc(var(--site-header-h) + 16px);
}

.site-patch-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.site-patch-tag {
    padding: 1px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
    border: 1px solid var(--site-line);
    color: var(--site-muted);
}

.site-patch-tag.is-major {
    color: #1a1206;
    background: linear-gradient(180deg, #ffe9a6 0%, #e2b440 100%);
    border-color: #f6dd92;
}

.site-patch-tag.is-new {
    color: #a8e08a;
    border-color: rgba(120, 190, 90, 0.6);
}

.site-patch-tag.is-tune {
    color: #9fd0f0;
    border-color: rgba(100, 170, 220, 0.6);
}

.site-patch-tag.is-fix {
    color: #f0b48a;
    border-color: rgba(220, 140, 90, 0.6);
}

.site-patch-tag.is-notice {
    color: #ffd98a;
    border-color: rgba(230, 180, 70, 0.7);
}

/* บันทึกปักหมุด — กรอบทองเด่นกว่าบันทึกทั่วไป */
.site-patch.is-pinned {
    border-color: var(--site-gold-hi);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 8px 28px rgba(0, 0, 0, 0.35);
}

.site-patch-pin {
    padding: 1px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    color: #1a1206;
    background: linear-gradient(180deg, #ffe9a6 0%, #e2b440 100%);
    border: 1px solid #f6dd92;
}

.site-patch-date {
    font-size: 14px;
    color: var(--site-muted);
}

.site-patch-title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--site-gold-hi);
}

.site-patch-title a:hover,
.site-patch-title a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.site-patch-lead {
    margin: 0 0 18px;
    color: var(--site-text);
}

.site-patch-figure {
    margin: 0 0 20px;
}

.site-patch-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--site-line);
    background: #0a0806;
}

.site-patch-figure figcaption {
    margin-top: 6px;
    font-size: 13px;
    text-align: center;
    color: var(--site-muted);
}

.site-patch-heading {
    margin: 18px 0 8px;
    font-size: 18px;
    font-weight: 500;
    color: var(--site-gold);
}

.site-patch .site-list {
    margin-bottom: 0;
}

/* ---------- จอแคบ ---------- */
@media (max-width: 900px) {
    .site-features,
    .site-guide {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-news {
        grid-template-columns: 1fr;
    }

    .site-showcase {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    :root {
        --site-header-h: 56px;
    }

    .site-header-inner {
        gap: 10px;
    }

    .site-brand-name {
        font-size: 20px;
    }

    /* ลิงก์หมวดย้ายไปเลื่อนแนวนอนใต้หัวเว็บไม่ได้ — ซ่อน เหลือปุ่มเล่นเกม (ลิงก์เดียวกันมีในฟุตเตอร์) */
    .site-nav a:not(.site-nav-keep),
    .site-nav-menu {
        display: none;
    }

    .site-hero {
        min-height: 0;
        padding: 56px 0 84px;
    }

    .site-facts-grid,
    .site-features,
    .site-guide,
    .site-steps {
        grid-template-columns: 1fr;
    }

    .site-fact + .site-fact {
        border-left: 0;
        border-top: 1px solid var(--site-line);
    }

    .site-section {
        padding-top: 64px;
    }

    .site-showcase {
        padding: 18px;
    }

    .site-patch {
        padding: 18px 16px 20px;
    }

    .site-patch-title {
        font-size: 21px;
    }

    .site-btn--lg {
        width: 100%;
    }
}

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

    .site-btn,
    .site-feature,
    .site-news-card,
    .site-nav-menu > summary,
    .site-nav-menu > summary::after {
        transition: none;
    }
}
