/* ==========================================================================
   Thara RO - modern layout  (โหลดหลัง bootstrap / eddga-studio_api.css เสมอ)
   โทนเดิม: พื้นดำ + ภาพตลาดกลางคืน + สีทอง/ส้ม  จัดเลย์เอาต์ใหม่แบบ responsive
   ========================================================================== */
:root {
	--bg: #0a0a0f;
	--bg-2: #101018;
	--surface: rgba(255, 255, 255, .045);
	--surface-2: rgba(255, 255, 255, .08);
	--line: rgba(255, 255, 255, .10);
	--text: #ece8df;
	--muted: #a29d92;
	--gold: #ffb12b;
	--gold-2: #fff34e;
	--hot: #ff6f18;
	--ok: #34d27b;
	--bad: #ff5d5d;
	--radius: 16px;
	--shadow: 0 10px 30px rgba(0, 0, 0, .45);
	--font: "Prompt", "Tahoma", sans-serif;
}

html { scroll-behavior: smooth; }
body {
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	margin: 0;
	overflow-x: hidden;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--gold); }
a:hover, a:focus { color: var(--gold-2); }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 8px; z-index: 10000; }
.skip-link:focus { left: 8px; color: #000; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.site-container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header / Nav ---------- */
.site-header {
	position: sticky; top: 0; z-index: 1000;
	background: rgba(10, 10, 15, .72);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
	transition: background .25s, box-shadow .25s;
}
.site-header.is-scrolled { background: rgba(10, 10, 15, .94); box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.site-brand img { display: block; height: 52px; width: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; align-items: center; gap: 2px; }
.site-nav > ul > li { position: relative; }
.nav-link {
	display: flex; align-items: center; gap: 9px;
	padding: 8px 14px; border-radius: 10px;
	background: none; border: 0; cursor: pointer;
	color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 400; text-align: left;
	transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link:focus, .has-sub.is-open > .nav-link { background: var(--surface-2); color: var(--gold-2); text-decoration: none; }
.nav-link > .fas:first-child { color: var(--gold); width: 16px; text-align: center; }

@media (min-width: 992px) and (max-width: 1239px) {
	.site-nav .nav-link { padding: 8px 9px; gap: 6px; font-size: 13px; }
	.site-nav > ul > li.nav-cta { margin: 0 4px; }
	.nav-cta .nav-link { padding-left: 16px; padding-right: 16px; font-size: 14px; }
}
/* ปุ่มสมัครสมาชิกกลางเมนู: เด่นกว่าปุ่มอื่น */
.site-nav > ul > li.nav-cta { margin: 0 10px; }
.nav-cta .nav-link {
	position: relative; justify-content: center; gap: 10px;
	padding: 12px 26px; border-radius: 0 0 16px 16px;
	margin-top: -10px; margin-bottom: -18px; padding-top: 22px; padding-bottom: 14px;
	background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 100%);
	color: #2a1c00; font-weight: 700; font-size: 16px;
	box-shadow: 0 10px 24px rgba(255, 190, 40, .35), inset 0 -3px 0 rgba(0, 0, 0, .15);
	transition: transform .2s, box-shadow .2s, filter .2s;
}
.nav-cta .nav-link > .fas:first-child { color: #2a1c00; font-size: 18px; }
.nav-cta .nav-link__text small { color: rgba(42, 28, 0, .7); font-weight: 500; }
.nav-cta .nav-link:hover, .nav-cta .nav-link:focus { background: linear-gradient(180deg, #fff1a8 0%, var(--gold-2) 100%); color: #2a1c00; transform: translateY(2px); filter: brightness(1.05); box-shadow: 0 14px 30px rgba(255, 190, 40, .5), inset 0 -3px 0 rgba(0, 0, 0, .15); }
.nav-link__text { display: block; line-height: 1.15; white-space: nowrap; }
.nav-link__text small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 300; }
.nav-link__caret { font-size: 9px; color: var(--muted); transition: transform .2s; }
.has-sub.is-open .nav-link__caret { transform: rotate(180deg); }

.site-nav .sub {
	position: absolute; left: 0; top: calc(100% + 6px); min-width: 220px;
	background: #14141d; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
	box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .18s, transform .18s, visibility .18s;
}
.site-nav .sub a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.site-nav .sub a:hover { background: var(--surface-2); color: var(--gold-2); text-decoration: none; }
.site-nav .sub a .fa-angle-right { color: var(--gold); margin-right: 4px; }
@media (hover: hover) and (min-width: 992px) {
	.has-sub:hover > .sub { opacity: 1; visibility: visible; transform: none; }
	.has-sub:hover .nav-link__caret { transform: rotate(180deg); }
}
.has-sub.is-open > .sub { opacity: 1; visibility: visible; transform: none; }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; }
.nav-toggle span { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 991px) {
	.nav-toggle { display: block; }
	.site-nav {
		position: absolute; left: 0; right: 0; top: 100%;
		background: rgba(10, 10, 15, .98); border-bottom: 1px solid var(--line);
		max-height: 0; overflow: hidden; transition: max-height .3s ease;
	}
	.site-nav.is-open { max-height: 80vh; overflow-y: auto; }
	.site-nav > ul { flex-direction: column; align-items: stretch; padding: 10px 14px 16px; gap: 0; }
	.nav-link { width: 100%; padding: 12px; }
	.site-nav > ul > li.nav-cta { order: -1; margin: 0 0 8px; }
	.nav-cta .nav-link { margin: 0; padding: 14px 12px; border-radius: 12px; font-size: 16px; box-shadow: 0 6px 16px rgba(255, 190, 40, .3); }
	.nav-link__caret { margin-left: auto; }
	.site-nav .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 30px; display: none; }
	.has-sub.is-open > .sub { display: block; }
}

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; overflow: hidden; margin-top: -64px; padding-top: 64px; }
.hero__bg {
	position: absolute; inset: 0;
	background: url(../../images/bg_body.jpg) center top / cover no-repeat;
}
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 10, 15, .15) 0%, rgba(10, 10, 15, .55) 60%, var(--bg) 100%); }
.hero__inner { position: relative; z-index: 1; }
.hero--full { min-height: 700px; }
.hero--full .hero__inner { padding-top: 120px; padding-bottom: 120px; }
.hero--compact { min-height: 460px; }
.hero--compact .hero__inner { padding-top: 104px; padding-bottom: 86px; }
.hero__logo { position: relative; width: min(720px, 92vw); height: auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .7)) drop-shadow(0 16px 20px rgba(0, 0, 0, .6)) drop-shadow(0 0 30px rgba(0, 0, 0, .35)); }
.hero__logo { display: block; }
.hero__inner > a:first-child { position: relative; display: inline-block; animation: floaty 6s ease-in-out infinite; }
.hero__inner > a:first-child::after { content: ""; position: absolute; z-index: -1; left: 10%; right: 10%; bottom: -22px; height: 34px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, .25) 45%, transparent 72%); filter: blur(7px); animation: groundshadow 6s ease-in-out infinite; }
@keyframes groundshadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.93); opacity: .8; } }
.hero--compact .hero__logo { width: min(620px, 90vw); }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero__tag { margin: 12px auto 22px; max-width: 640px; font-size: 18px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.btn-cta {
	box-sizing: border-box;
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 22px; border-radius: 999px;
	font-family: var(--font); font-weight: 500; font-size: 15px;
	color: #fff; background: var(--surface-2); border: 1px solid var(--line);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	transition: transform .15s, background .2s, box-shadow .2s;
}
.btn-cta:hover { transform: translateY(-2px); color: #fff; background: rgba(255, 255, 255, .16); text-decoration: none; }
.btn-cta--primary { color: #1b1200; background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--hot)); border: 0; box-shadow: 0 8px 22px rgba(255, 140, 20, .35); }
.btn-cta--primary:hover { color: #1b1200; background: linear-gradient(135deg, #fff77a, #ffbf4a 55%, #ff8433); box-shadow: 0 10px 28px rgba(255, 140, 20, .5); }
.btn-cta--ghost { background: transparent; }
.btn-cta--small { padding: 8px 16px; font-size: 13px; }

/* ---------- Main ---------- */
.site-main { position: relative; z-index: 2; padding-bottom: 60px; }
.section { margin-top: 34px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__title { margin: 0; font-size: 22px; font-weight: 600; color: #fff; }
.section__title .fas { color: var(--gold); margin-right: 8px; }
.section__title small { color: var(--muted); font-size: 13px; font-weight: 300; margin-left: 8px; }

.panel-dark { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-dark__body { padding: 20px; }

/* ---------- Status cards (หน้าแรก) ---------- */
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: -78px; position: relative; z-index: 3; }
.status-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: rgba(16, 16, 24, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: var(--shadow); }
.status-card__icon { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: var(--gold); background: rgba(255, 177, 43, .12); }
.status-card__label { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.status-card__value { font-size: 22px; font-weight: 600; color: #fff; line-height: 1.2; }
.box-status-online, .box-status-offline { display: inline-flex; align-items: center; gap: 7px; font-size: 18px; font-weight: 600; }
.box-status-online { color: var(--ok); }
.box-status-offline { color: var(--bad); }
.box-status-online::before, .box-status-offline::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255, 255, 255, .06); }
.box-status-online::before { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 210, 123, .55); } 100% { box-shadow: 0 0 0 10px rgba(52, 210, 123, 0); } }

/* ---------- Home grid ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; margin-top: 26px; align-items: stretch; }
.slider-frame { position: relative; width: 100%; aspect-ratio: 865 / 360; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #000; }
.slider-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.login-card { background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.login-card h3 { margin: 0 0 14px; font-size: 18px; font-weight: 600; color: #fff; }
.login-card h3 .fas { color: var(--gold); margin-right: 6px; }
.login-card label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
.login-card .form-login {
	box-sizing: border-box; display: block;
	width: 100%; height: 44px; padding: 0 14px; margin-bottom: 14px;
	color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 10px;
	font-family: var(--font); font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.login-card .form-login:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 177, 43, .2); }
.login-card .btn-row { display: flex; gap: 10px; }
.login-card .btn-row .btn-cta { flex: 1; justify-content: center; padding: 11px 10px; cursor: pointer; }
.login-card .btn-register-link { display: flex; justify-content: center; margin-top: 10px; width: 100%; }

.alert-box { padding: 10px 14px; margin-bottom: 14px; border-radius: 10px; font-size: 13px; border: 1px solid transparent; }
.alert-box--info { background: rgba(120, 170, 255, .1); border-color: rgba(120, 170, 255, .25); color: #c8dcff; }
.alert-box--ok { background: rgba(52, 210, 123, .1); border-color: rgba(52, 210, 123, .3); color: #a9f1c9; }
.alert-box--bad { background: rgba(255, 93, 93, .1); border-color: rgba(255, 93, 93, .3); color: #ffb4b4; }

.member-card ul { list-style: none; margin: 0 0 12px; padding: 0; }
.member-card li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.member-card li .fas, .member-card li .fab { color: var(--gold); width: 20px; }
.member-card .k { display: flex; align-items: center; color: var(--muted); }
.member-card .v { color: #fff; font-weight: 600; }
.member-actions { display: grid; gap: 8px; }
.member-actions a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.member-actions a:hover { background: var(--surface-2); color: var(--gold-2); text-decoration: none; }
.member-actions a .fas { color: var(--gold); width: 18px; text-align: center; }

/* ---------- Quick tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
	padding: 22px 12px; text-align: center; color: #fff; border-radius: var(--radius);
	background: linear-gradient(160deg, rgba(255, 177, 43, .14), rgba(255, 255, 255, .03));
	border: 1px solid var(--line); transition: transform .18s, border-color .18s, background .18s;
}
.tile:hover { transform: translateY(-4px); border-color: var(--gold); color: #fff; text-decoration: none; background: linear-gradient(160deg, rgba(255, 177, 43, .26), rgba(255, 255, 255, .05)); }
.tile .fas { font-size: 28px; color: var(--gold); }
.tile strong { font-size: 16px; font-weight: 500; }
.tile small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.news-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.news-card:hover { transform: translateY(-4px); border-color: rgba(255, 177, 43, .5); }
.news-card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
.news-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .news-card__img img { transform: scale(1.06); }
.news-card__tag { position: absolute; left: 12px; top: 12px; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.news-card__tag--update { background: #e0482f; }
.news-card__tag--news { background: #2f86e0; }
.news-card__tag--event { background: #26a269; }
.news-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-card__title { margin: 0; font-size: 17px; font-weight: 600; color: #fff; }
.news-card__text { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.news-card__time { font-size: 12px; color: var(--muted); }
.news-card__time .far { margin-right: 4px; }
.news-card .btn-cta { align-self: flex-start; margin-top: 8px; }

/* ---------- Ranking + castle ---------- */
.two-col { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 22px; align-items: start; }
.rank-tabs { display: flex; gap: 6px; padding: 6px; margin: 0; list-style: none; background: rgba(0, 0, 0, .3); border-radius: 12px; }
.rank-tabs li { flex: 1; }
.rank-tabs a { display: block; text-align: center; padding: 8px 4px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.rank-tabs a:hover { color: #fff; text-decoration: none; }
.rank-tabs .active a { background: linear-gradient(135deg, var(--gold), var(--hot)); color: #1b1200; }
.rank-tab-content { padding-top: 12px; }
.rank-tab-content .tab-pane { display: none; }
.rank-tab-content .tab-pane.active { display: block; }
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th { padding: 8px; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; text-align: center; border-bottom: 1px solid var(--line); }
.rank-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 14px; color: var(--text); }
.rank-table tr:nth-child(-n+4) .rank-no { color: #1b1200; background: var(--gold); font-weight: 700; }
.rank-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); font-size: 13px; }
.rank-name { font-weight: 500; color: #fff; }
.rank-point { color: var(--gold-2); font-weight: 600; }
.empty-note { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 14px; }

.castle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.castle-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.castle-card img { width: 48px; height: 48px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); image-rendering: auto; }
.castle-card__castle { font-size: 12px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.castle-card__guild { font-size: 17px; font-weight: 600; color: #fff; line-height: 1.2; }
.castle-card__master { font-size: 13px; color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 2; margin-top: 30px; background: #07070b; border-top: 1px solid var(--line); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding-top: 40px; padding-bottom: 30px; }
.site-footer h4 { margin: 0 0 12px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 500; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: var(--text); font-size: 14px; }
.footer-links a:hover { color: var(--gold-2); }
.site-footer__logo { display: block; margin-bottom: 8px; }
.site-footer__copy { text-align: center; padding: 16px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.site-footer__copy a { color: var(--gold); }

.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 999; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; color: #1b1200; background: linear-gradient(135deg, var(--gold-2), var(--hot)); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transform: translateY(12px); transition: .25s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.js .reveal { opacity: 1; transform: none; transition: none; }
	.hero__logo, .box-status-online::before, .hero__inner > a:first-child, .hero__inner > a:first-child::before, .hero__inner > a:first-child::after { animation: none; }
	html { scroll-behavior: auto; }
}

/* ---------- Dashboard modal (หน้าแรก) ---------- */
.modal-content { background: #14141d; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-title { font-family: var(--font); color: #fff; }
.modal-header .close { color: #fff; opacity: .7; text-shadow: none; }
.modal .form-control { color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); height: 44px; border-radius: 10px; }
.modal .form-control[disabled] { opacity: .6; }
.modal label-modal { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.modal .list-group-item { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.modal .table { color: var(--text); }
.modal .table > thead > tr > th, .modal .table > tbody > tr > td { border-color: var(--line); }
.badge-cash { color: var(--gold-2); font-weight: 600; }
.badge-old { color: var(--muted); }
.badge-log { color: #8fd0ff; font-weight: 600; }
.btn-save { color: #1b1200; background: linear-gradient(135deg, var(--gold-2), var(--gold)); border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 600; }
.btn-save:hover { color: #1b1200; filter: brightness(1.08); }
.modal-lg { width: auto; max-width: 900px; margin: 30px auto; }

/* ---------- เนื้อหาของหน้าย่อย (ใช้ markup เดิมจาก semantic/bootstrap) ---------- */
.content-card { margin-top: -30px; position: relative; z-index: 3; }
.content-card .ui.message, .content-card > .ui.segment { background: #fffdf8; color: #2a2a2a; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .5); padding: 22px; }
.ui.piled.segment:before, .ui.piled.segment:after, .ui.piled.segments:before, .ui.piled.segments:after { display: none !important; }
.content-card .ui.message a:not(.btn):not(.button):not(.item) { color: #b25a00; }
.content-card .ui.message a:not(.btn):not(.button):not(.item):hover { color: #ff6f18; }
.content-card .breadcrumb { background: transparent; padding-left: 0; }
.content-card .table-responsive-auto, .content-card .table { max-width: 100%; }
.content-card img { max-width: 100%; height: auto; }
.content-card .well { background: #fff; border: 1px solid #eee; border-radius: 12px; box-shadow: none; }
.content-card .main-header { margin-bottom: 18px; }
.content-card .ui.form .field > label, .content-card label { color: #333; }
@media (max-width: 767px) {
	.content-card .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.content-card { margin-top: -20px; }
	.content-card .ui.message { padding: 14px; }
	.modal-lg { margin: 10px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.home-top { grid-template-columns: minmax(0, 1fr) 300px; }
	.two-col { grid-template-columns: 340px minmax(0, 1fr); }
	.tiles { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 991px) {
	.status-grid { grid-template-columns: repeat(2, 1fr); margin-top: -64px; }
	.home-top, .two-col { grid-template-columns: 1fr; }
	.news-grid { grid-template-columns: repeat(2, 1fr); }
	.tiles { grid-template-columns: repeat(2, 1fr); }
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 575px) {
	.hero--full { min-height: 540px; }
	.hero--full .hero__inner { padding-top: 70px; padding-bottom: 110px; }
	.hero__tag { font-size: 15px; }
	.status-card { padding: 12px; }
	.status-card__icon { width: 38px; height: 38px; font-size: 16px; }
	.status-card__value { font-size: 18px; }
	.news-grid, .castle-grid { grid-template-columns: 1fr; }
	.site-footer__grid { grid-template-columns: 1fr; }
	.btn-cta { padding: 11px 18px; }
	.section__title { font-size: 19px; }
}

/* ---------- Mini slider ---------- */
.mini-slider { position: relative; width: 100%; aspect-ratio: 858 / 340; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #000; }
.mini-slider__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.mini-slider__slide.is-active { opacity: 1; z-index: 1; }
.mini-slider__slide img, .mini-slider__slide a { display: block; width: 100%; height: 100%; object-fit: cover; }
.mini-slider__prev, .mini-slider__next { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s; }
.mini-slider:hover .mini-slider__prev, .mini-slider:hover .mini-slider__next, .mini-slider__prev:focus, .mini-slider__next:focus { opacity: 1; }
.mini-slider__prev { left: 12px; } .mini-slider__next { right: 12px; }
.mini-slider__dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.mini-slider__dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255, 255, 255, .45); }
.mini-slider__dot.is-active { background: var(--gold); width: 22px; border-radius: 6px; }

/* ยกเลิกกฎเดิมที่บังคับให้ทั้งหน้ากว้าง 1200px บนจอเล็ก (อยู่ใน eddga-studio_api.css) */
@media (max-width: 1170px) { body, html { width: auto !important; } }
body::-webkit-scrollbar { width: 10px; height: 10px; background-color: var(--bg); }
body::-webkit-scrollbar-track { background-color: var(--bg); }
body::-webkit-scrollbar-thumb { background: #3a3a46; border-radius: 6px; }

/* =====================================================================
   ปุ่มแนวใสวาว 3 มิติ (glossy / jelly / glass) — ไว้ท้ายไฟล์เพื่อทับสไตล์เดิม
   ===================================================================== */
:root {
	--gloss: linear-gradient(180deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .16) 100%);
	--glint: radial-gradient(circle at 16% 30%, #fff 0 1.3px, transparent 2.6px),
	         radial-gradient(circle at 84% 24%, rgba(255, 255, 255, .9) 0 1px, transparent 2.2px),
	         radial-gradient(circle at 72% 78%, rgba(255, 255, 255, .7) 0 .9px, transparent 2px);
}

/* ฐานร่วม: เลเยอร์เงาสะท้อนด้านบน + แสงกวาด */
.btn-cta, .nav-cta .nav-link, .btn-save, .btn.btn-download, .btn.btn-register, .btn.btn-vote,
.btn.btn-share, .btn.btn-close, .btn.btn-default, .rank-tabs a, .tile, .member-actions a, .nav-toggle {
	position: relative; overflow: hidden; isolation: isolate;
	transition: transform .15s ease, box-shadow .15s ease, filter .2s ease, background .2s ease;
}
.btn-cta::before, .nav-cta .nav-link::before, .btn-save::before, .btn.btn-download::before, .btn.btn-register::before,
.btn.btn-vote::before, .btn.btn-share::before, .btn.btn-close::before, .btn.btn-default::before,
.rank-tabs a::before, .tile::before, .member-actions a::before, .nav-toggle::before {
	content: ""; position: absolute; z-index: -1; left: 3px; right: 3px; top: 2px; height: 48%;
	border-radius: inherit; background: var(--gloss); opacity: .75; pointer-events: none;
}
.btn-cta::after, .nav-cta .nav-link::after, .btn-save::after, .btn.btn-download::after, .btn.btn-register::after,
.btn.btn-vote::after, .btn.btn-share::after, .btn.btn-close::after, .btn.btn-default::after,
.rank-tabs a::after, .tile::after, .member-actions a::after {
	content: ""; position: absolute; z-index: -1; top: -30%; bottom: -30%; left: -70%; width: 38%;
	background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .7) 50%, transparent 100%);
	transform: skewX(-22deg); transition: left .7s ease; pointer-events: none;
}
.btn-cta:hover::after, .nav-cta .nav-link:hover::after, .btn-save:hover::after, .btn.btn-download:hover::after,
.btn.btn-register:hover::after, .btn.btn-vote:hover::after, .btn.btn-share:hover::after, .btn.btn-close:hover::after,
.btn.btn-default:hover::after, .rank-tabs a:hover::after, .tile:hover::after, .member-actions a:hover::after { left: 135%; }

/* กดแล้วจมลง */
.btn-cta:active, .nav-cta .nav-link:active, .btn-save:active, .btn.btn-download:active, .btn.btn-register:active,
.btn.btn-vote:active, .btn.btn-share:active, .btn.btn-close:active, .btn.btn-default:active, .rank-tabs a:active {
	transform: translateY(3px) !important;
}

/* --- ทอง (หลัก) : สมัครสมาชิก / บันทึก / แท็บกลางเมนู / ปุ่มหลักใน hero --- */
.btn-cta--primary, .btn-save, .btn.btn-register, .nav-cta .nav-link, .rank-tabs .active a {
	color: #3a2100; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); font-weight: 700;
	background: var(--glint), linear-gradient(180deg, #fff9b0 0%, #ffd83c 42%, #ffa21c 58%, #ff7d12 100%);
	border: 1px solid #ffe9a0;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -3px 0 rgba(150, 70, 0, .35),
		0 4px 0 #b25a00, 0 10px 18px rgba(0, 0, 0, .45), 0 0 22px rgba(255, 170, 30, .35);
}
.btn-cta--primary:hover, .btn-save:hover, .btn.btn-register:hover, .nav-cta .nav-link:hover, .rank-tabs .active a:hover {
	color: #3a2100; filter: brightness(1.08) saturate(1.08); transform: translateY(-2px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -3px 0 rgba(150, 70, 0, .35),
		0 6px 0 #b25a00, 0 14px 24px rgba(0, 0, 0, .45), 0 0 30px rgba(255, 190, 40, .6);
}
.btn-cta--primary::after, .nav-cta .nav-link::after { animation: sheen 5s ease-in-out infinite; }
@keyframes sheen { 0%, 62% { left: -70%; } 82%, 100% { left: 135%; } }
.nav-cta .nav-link { border-top: 0; }
.nav-cta .nav-link > .fas:first-child, .btn-save .fas { color: #3a2100; }
.nav-cta .nav-link:hover { transform: translateY(2px); }
.rank-tabs .active a { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -2px 0 rgba(150, 70, 0, .35), 0 3px 0 #b25a00, 0 6px 12px rgba(0, 0, 0, .4); }

/* --- แก้ว (ปุ่มรอง) : ปุ่มธรรมดา / ghost / default --- */
.btn-cta, .btn.btn-default, .rank-tabs a, .member-actions a, .nav-toggle {
	color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
	background: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .07) 50%, rgba(110, 150, 255, .16) 100%);
	border: 1px solid rgba(255, 255, 255, .34);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(0, 0, 0, .28),
		0 3px 0 rgba(0, 0, 0, .55), 0 8px 16px rgba(0, 0, 0, .4);
}
.btn-cta:hover, .btn.btn-default:hover, .member-actions a:hover, .nav-toggle:hover {
	color: #fff; transform: translateY(-2px);
	background: linear-gradient(180deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .12) 50%, rgba(130, 170, 255, .26) 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(0, 0, 0, .28),
		0 5px 0 rgba(0, 0, 0, .55), 0 12px 22px rgba(0, 0, 0, .45), 0 0 18px rgba(160, 190, 255, .3);
}
.btn-cta--primary { background: var(--glint), linear-gradient(180deg, #fff9b0 0%, #ffd83c 42%, #ffa21c 58%, #ff7d12 100%); }
.btn-cta--ghost { background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02)); }
.rank-tabs a { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(0, 0, 0, .5); color: #d9d4c8; }
.rank-tabs a:hover { color: #fff; }
.rank-tabs .active a { background: var(--glint), linear-gradient(180deg, #fff9b0 0%, #ffd83c 42%, #ffa21c 58%, #ff7d12 100%); }
.member-actions a { text-shadow: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(0, 0, 0, .5); }
.nav-toggle span { box-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

/* --- สีเฉพาะปุ่ม (เยลลี่) --- */
.btn.btn-vote { color: #fff; text-shadow: 0 1px 2px rgba(0, 40, 10, .6); border: 1px solid #b6ffc8;
	background: var(--glint), linear-gradient(180deg, #9bffb4 0%, #32d65e 45%, #17a840 55%, #0f8a30 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -3px 0 rgba(0, 70, 20, .4), 0 4px 0 #0a5a1f, 0 10px 18px rgba(0, 0, 0, .45), 0 0 20px rgba(50, 214, 94, .3); }
.btn.btn-share { color: #fff; text-shadow: 0 1px 2px rgba(0, 20, 80, .6); border: 1px solid #b9d8ff;
	background: var(--glint), linear-gradient(180deg, #a9d2ff 0%, #4a86f7 45%, #2a5fd8 55%, #1f4fc4 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -3px 0 rgba(0, 30, 110, .4), 0 4px 0 #153a8f, 0 10px 18px rgba(0, 0, 0, .45), 0 0 20px rgba(74, 134, 247, .35); }
.btn.btn-close { color: #fff; text-shadow: 0 1px 2px rgba(80, 0, 0, .6); border: 1px solid #ffc3c3;
	background: var(--glint), linear-gradient(180deg, #ffa8a8 0%, #ea3a3a 45%, #c01c1c 55%, #a81414 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 -3px 0 rgba(100, 0, 0, .4), 0 4px 0 #701010, 0 10px 18px rgba(0, 0, 0, .45), 0 0 18px rgba(234, 58, 58, .3); }
.btn.btn-download { color: #fff; text-shadow: 0 1px 2px rgba(0, 30, 70, .6); border: 1px solid #bff0ff;
	background: var(--glint), linear-gradient(180deg, #a6efff 0%, #34b6f0 45%, #1a85d0 55%, #1568b8 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -3px 0 rgba(0, 50, 100, .4), 0 4px 0 #0e4580, 0 10px 18px rgba(0, 0, 0, .45), 0 0 20px rgba(52, 182, 240, .3); }
.btn.btn-vote:hover, .btn.btn-share:hover, .btn.btn-close:hover, .btn.btn-download:hover { color: #fff; filter: brightness(1.1) saturate(1.1); transform: translateY(-2px); }
.btn.btn-vote:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -3px 0 rgba(0, 70, 20, .4), 0 6px 0 #0a5a1f, 0 14px 24px rgba(0, 0, 0, .45), 0 0 30px rgba(50, 214, 94, .55); }
.btn.btn-share:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -3px 0 rgba(0, 30, 110, .4), 0 6px 0 #153a8f, 0 14px 24px rgba(0, 0, 0, .45), 0 0 30px rgba(74, 134, 247, .55); }
.btn.btn-close:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -3px 0 rgba(100, 0, 0, .4), 0 6px 0 #701010, 0 14px 24px rgba(0, 0, 0, .45), 0 0 28px rgba(234, 58, 58, .5); }
.btn.btn-download:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -3px 0 rgba(0, 50, 100, .4), 0 6px 0 #0e4580, 0 14px 24px rgba(0, 0, 0, .45), 0 0 30px rgba(52, 182, 240, .55); }
.btn.btn-vote, .btn.btn-share, .btn.btn-close, .btn.btn-download, .btn.btn-register, .btn-save { margin-bottom: 4px; }

/* --- ไทล์เมนูลัด: การ์ดแก้วนูน --- */
.tile::before { height: 34%; opacity: .22; left: 2px; right: 2px; }
.tile::after { opacity: .5; }
.tile { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 0 rgba(0, 0, 0, .55), 0 12px 22px rgba(0, 0, 0, .4); }
.tile:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .3), 0 7px 0 rgba(0, 0, 0, .55), 0 18px 30px rgba(0, 0, 0, .45), 0 0 24px rgba(255, 177, 43, .35); }
.tile .fas { filter: drop-shadow(0 2px 4px rgba(255, 150, 0, .55)); }

/* --- เมนูบนสุด (ลิงก์ธรรมดา): ยกนูนเป็นแก้วเมื่อชี้ --- */
.site-nav > ul > li:not(.nav-cta) > .nav-link:hover, .site-nav > ul > li:not(.nav-cta) > .nav-link:focus, .has-sub.is-open > .nav-link {
	background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .05));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 3px 0 rgba(0, 0, 0, .45), 0 6px 12px rgba(0, 0, 0, .35);
	transform: translateY(-1px);
}
.site-nav .sub a:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(0, 0, 0, .4); }

/* --- ปุ่มกลับขึ้นบน: ลูกแก้วทอง --- */
.to-top {
	background: radial-gradient(circle at 34% 24%, #fffbd0 0 8%, #ffd83c 30%, #ff9a1a 70%, #d4650a 100%);
	box-shadow: inset 0 -4px 6px rgba(120, 50, 0, .45), inset 0 2px 3px rgba(255, 255, 255, .8), 0 4px 0 #9a4a00, 0 10px 18px rgba(0, 0, 0, .5), 0 0 20px rgba(255, 170, 30, .4);
}

@media (prefers-reduced-motion: reduce) {
	.btn-cta--primary::after, .nav-cta .nav-link::after { animation: none; }
	.btn-cta::after, .tile::after, .nav-cta .nav-link::after { transition: none; }
}

/* Modal fix: .site-main creates a stacking context (z-index:2) that trapped the modal under the header and the backdrop. */
body.modal-open .site-main { z-index: auto; }
body.modal-open .site-header { z-index: 1; }
.modal { z-index: 1060; }
.modal-backdrop { z-index: 1050; }

/* Light sheen sweeping across the logo (clipped to the logo's own shape) */
.hero__inner > a:first-child::before {
	content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
	-webkit-mask: url("../../images/icon/logo_refine.png") center / 100% 100% no-repeat;
	mask: url("../../images/icon/logo_refine.png") center / 100% 100% no-repeat;
	background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .15) 44%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, .15) 56%, transparent 62%);
	background-size: 250% 100%; background-position: 100% 0; background-repeat: no-repeat;
	animation: logosheen 4s ease-in-out infinite;
}
@keyframes logosheen { 0% { background-position: 100% 0; } 55%, 100% { background-position: 0% 0; } }

/* Hero tagline */
.hero__tag { max-width: 860px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero__tag-th { font-size: 17px; color: #f1e6cf; letter-spacing: .02em; text-shadow: 0 2px 10px rgba(0, 0, 0, .9); }
.hero__tag-en { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: 100%; }
.hero__tag-en::before, .hero__tag-en::after { content: ""; flex: 0 0 64px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold-2, #ffc542)); box-shadow: 0 0 10px rgba(255, 190, 60, .7); }
.hero__tag-en::after { background: linear-gradient(270deg, transparent, var(--gold-2, #ffc542)); }
.hero__tag-txt { font-size: 32px; white-space: nowrap; text-shadow: none; font-weight: 800; line-height: 1.15; letter-spacing: .06em; text-transform: uppercase; text-align: center;
	background: linear-gradient(180deg, #fffef2 0%, #fff0a8 42%, #ffcf3a 70%, #f5a313 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
	filter: drop-shadow(0 2px 0 #6b3a05) drop-shadow(0 3px 2px rgba(0, 0, 0, .6)) drop-shadow(0 0 12px rgba(255, 170, 40, .35)); }
.hero__tag-txt b { text-shadow: none; font-weight: 900; white-space: nowrap; background: linear-gradient(180deg, #ffffff 0%, #dcffc9 35%, #86f35f 70%, #43c63c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hero__tag-gem { display: none; }
@media (max-width: 767px) {
	.hero__tag-th { font-size: 14px; }
	.hero__tag-txt { font-size: 19px; letter-spacing: .03em; white-space: normal; text-wrap: balance; }
	.hero__tag-en::before, .hero__tag-en::after { display: none; }
}

/* Slider fills the full height of the member column (matches its bottom edge) */
.home-top .mini-slider { height: 100%; }
.home-top .member-card { align-self: stretch; }
@media (max-width: 900px) { .home-top .mini-slider { height: auto; } }

/* Ambient embers / fireflies layer (assets/js/fx.js) */
.fx-canvas { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
@media print { .fx-canvas { display: none; } }
@media (max-width: 767px) {
	.hero--compact { min-height: 360px; }
	.hero--compact .hero__inner { padding-top: 80px; padding-bottom: 40px; }
}
