/* ============================================================
 * style.css — พื้นฐานทั้งเว็บ (Reset / ตัวแปร / Typography / Utility)
 * RAGNAROK RELAX HICLASS
 * ============================================================ */

/* ---------- [1] Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Kanit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--txt);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: none; border-top: 1px solid var(--line); margin: 1rem 0; }

/* ---------- [2] ตัวแปรธีม (Ragnarok Night x Gold) ---------- */
:root {
    --bg: #070b18;
    --bg-2: #0b1226;
    --panel: rgba(16, 23, 52, .72);
    --panel-solid: #111a3a;
    --panel-2: #16204a;
    --line: rgba(255, 255, 255, .09);
    --line-2: rgba(255, 255, 255, .18);

    --txt: #e9edff;
    --txt-2: #aab4e2;
    --muted: #7d87b8;

    --gold: #f7c948;
    --gold-2: #ffe9a3;
    --pink: #ff7eb6;
    --cyan: #5ad1ff;
    --violet: #9d7bff;
    --green: #3ddc84;
    --red: #ff5d73;
    --orange: #ffb020;

    --grad-main: linear-gradient(135deg, #f7c948 0%, #ff9f43 100%);
    --grad-cool: linear-gradient(135deg, #5ad1ff 0%, #9d7bff 100%);
    --grad-pink: linear-gradient(135deg, #ff7eb6 0%, #9d7bff 100%);

    --font: 'Kanit', system-ui, sans-serif;
    --font-en: 'Impact', 'Haettenschweiler', 'Anton', 'Kanit', sans-serif; // ฟอนต์โชว์สไตล์เกม (Impact)

    --rad: 16px;
    --rad-sm: 10px;
    --rad-lg: 26px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --shadow-glow: 0 0 34px rgba(247, 201, 72, .25);
    --header-h: 72px;
    --topbar-h: 40px;
    --container: 1200px;
    --ease: cubic-bezier(.22, .68, .32, 1);
}

/* ---------- [3] Typography ---------- */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; color: #fff; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }
b, strong { font-weight: 600; }
small { font-size: .85rem; }
::selection { background: var(--gold); color: #14203f; }

/* ---------- [4] Scrollbar ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold), #b9772a); border-radius: 8px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-2); }
* { scrollbar-width: thin; scrollbar-color: var(--gold) var(--bg-2); }

/* ---------- [5] Layout Utilities ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { position: relative; padding: 76px 0; }
.section-sm { padding: 48px 0; }
.section-alt { background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)); }

.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.section-head.left { margin-inline: 0; text-align: left; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .82rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--gold); background: rgba(247, 201, 72, .1);
    border: 1px solid rgba(247, 201, 72, .35);
    padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
}
.section-title { position: relative; display: inline-block; font-family: var(--font-en); font-weight: 400; }
.section-title::after {
    content: ''; position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
    width: 74px; height: 4px; border-radius: 4px; background: var(--grad-main);
}
.section-head.left .section-title::after { left: 0; transform: none; }
.section-sub { margin-top: 22px; color: var(--txt-2); font-weight: 300; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; gap: 14px; }
.flex-center { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.muted { color: var(--muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 26px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 26px; }
.full { width: 100%; }
.relative { position: relative; }

.hide-xs { display: initial; }
.hide-sm { display: initial; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } .hide-sm { display: none !important; } }
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .hide-xs { display: none !important; }
    .section { padding: 54px 0; }
    body { font-size: 15px; }
}

/* ---------- [6] Anchor / จุดหมายลิงก์ข้ามหน้า ---------- */
:target, [id] { scroll-margin-top: calc(var(--header-h) + var(--topbar-h) + 16px); }

/* ---------- [7] พื้นหลังเว็บ (เคลื่อนไหวเบา ๆ) ---------- */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(1000px 600px at 85% -10%, rgba(157, 123, 255, .16), transparent 60%),
        radial-gradient(900px 550px at -10% 30%, rgba(90, 209, 255, .12), transparent 60%),
        radial-gradient(700px 500px at 50% 110%, rgba(247, 201, 72, .10), transparent 60%),
        var(--bg);
}
body::after { /* ลายกริดจาง ๆ */
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
}
