/* ==========================================================================
   Class4-RO — ธีมพอร์ทัล RO คลาสสิก (owner เลือก 01/11/2569)
   หน้าต่างทุกบานลอกบุคลิกหน้าต่างในเกม: แถบหัวฟ้าอ่อน ตัวขาว เส้นขอบน้ำเงินเทา
   วางบนพื้นหลังกลางคืนของมอร็อค ให้หน้าเว็บดูเป็น "ส่วนหนึ่งของเกม" ไม่ใช่แลนดิ้งเพจทั่วไป
   ========================================================================== */
:root {
  --night: #0d1726;
  --night-2: #13233a;
  --night-line: #26405f;
  --win-body: #f7f9fc;
  --win-body-2: #eef3f9;
  --win-title-a: #fdfeff;
  --win-title-b: #cfdcee;
  --win-line: #8ea3c4;
  --win-ink: #22324d;
  --win-mute: #5d6f8c;
  --gold: #e3b14a;
  --gold-deep: #a8761c;
  --sand: #f1dfb6;
  --ro-blue: #3d6fb6;
  --ro-blue-deep: #23508f;
  --ok: #2f9e5b;
  --bad: #c2453b;
  --mvp: #b0361f;
  --radius: 3px;
  --shadow: 0 1px 0 #fff inset, 0 6px 18px rgba(3, 9, 20, .45);
  --font-body: "Sarabun", "Tahoma", sans-serif;
  --font-head: "Mitr", "Sarabun", sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.6 var(--font-body);
  color: #dfe7f3;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(227, 177, 74, .16), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, var(--night-2), var(--night) 420px);
  background-color: var(--night);
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin: 0 auto; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  font-size: 12.5px;
  background: rgba(3, 8, 16, .65);
  border-bottom: 1px solid var(--night-line);
}
.topbar .wrap { display: flex; gap: 18px; align-items: center; min-height: 30px; flex-wrap: wrap; }
.topbar .status { display: inline-flex; align-items: center; gap: 6px; }
.topbar .dot { width: 8px; height: 8px; border-radius: 50%; background: #66748a; box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.topbar .dot.on { background: #3fd17a; }
.topbar .dot.off { background: var(--bad); }
.topbar .spacer { flex: 1; }
.topbar a { text-decoration: none; color: #b9c8de; }
.topbar a:hover { color: #fff; }

/* ---------------------------------------------------------------- header + nav */
.site-head { position: sticky; top: 0; z-index: 50; background: linear-gradient(180deg, #172a44, #101e31); border-bottom: 2px solid var(--gold-deep); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { width: 44px; height: 44px; }
.brand b { font: 600 21px/1 var(--font-head); color: var(--sand); letter-spacing: .5px; }
.brand small { display: block; font: 500 10px/1.3 var(--font-body); color: #8fa3c0; letter-spacing: 2px; }

.nav { display: flex; align-items: stretch; gap: 2px; margin-left: auto; }
.nav > li { list-style: none; position: relative; display: flex; align-items: center; }
.nav > li > a, .nav > li > button {
  display: flex; align-items: center; gap: 5px; height: 62px; padding: 0 13px;
  background: none; border: 0; color: #d7e1ef; text-decoration: none; cursor: pointer;
  font: 500 14.5px var(--font-head);
}
.nav > li > a:hover, .nav > li > button:hover, .nav > li.open > button { color: #fff; background: rgba(255,255,255,.06); }
.nav > li > a[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }
.nav .caret { font-size: 9px; opacity: .6; margin-top: 1px; transition: transform .15s; }
.nav li.open .caret { transform: rotate(180deg); }
.nav .play { margin-left: 8px; height: 38px; padding: 0 14px; border-radius: var(--radius);
  background: linear-gradient(180deg, #f3c862, var(--gold)); color: #3a2405; box-shadow: 0 1px 0 #fff6 inset, 0 2px 0 var(--gold-deep); }
.nav .play:hover { background: linear-gradient(180deg, #ffd875, #ebbd55); color: #2a1a03; }

.drop {
  display: none; position: absolute; top: 100%; left: 0; min-width: 270px; padding: 6px 0; margin: 0;
  background: var(--win-body); border: 1px solid var(--win-line); border-top: 3px solid var(--ro-blue);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow);
}
.nav li.open > .drop { display: block; }
.drop li { list-style: none; }
.drop a { display: flex; gap: 10px; align-items: baseline; padding: 8px 16px; color: var(--win-ink); text-decoration: none; font-size: 14px; }
.drop a:hover { background: #e2ebf7; color: #0f2a52; }
.drop a::before { content: "›"; color: var(--ro-blue); font-weight: 700; }
.drop .sep { height: 1px; margin: 5px 12px; background: #d6dfeb; }
.drop small { color: var(--win-mute); font-size: 12px; margin-left: auto; }

.menu-btn { display: none; margin-left: auto; width: 44px; height: 40px; border: 1px solid var(--night-line); border-radius: var(--radius); background: #0c1626; color: #fff; font-size: 20px; }

/* ---------------------------------------------------------------- RO window */
.win { background: var(--win-body); color: var(--win-ink); border: 1px solid var(--win-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.win > h2, .win > .win-title {
  margin: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  font: 500 14.5px/1.4 var(--font-head); color: var(--win-ink);
  background: linear-gradient(180deg, var(--win-title-a), var(--win-title-b));
  border-bottom: 1px solid var(--win-line); border-radius: var(--radius) var(--radius) 0 0;
}
.win > h2 .more, .win-title .more { margin-left: auto; font: 400 12.5px var(--font-body); color: var(--ro-blue-deep); text-decoration: none; }
.win > h2 .more:hover { text-decoration: underline; }
.win-body { padding: 14px 16px; }
.win-body > :first-child { margin-top: 0; }
.win-body > :last-child { margin-bottom: 0; }
.win p { color: #34445f; }
.win a { color: var(--ro-blue-deep); }
.win .mute { color: var(--win-mute); font-size: 13px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid #2d5a9a; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, #5d8fd6, var(--ro-blue)); color: #fff !important; font: 500 14px var(--font-head);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset;
}
.btn:hover { background: linear-gradient(180deg, #6c9ce0, #4579c2); }
.btn:active { transform: translateY(1px); }
.btn.gold { border-color: var(--gold-deep); background: linear-gradient(180deg, #f6cf6e, var(--gold)); color: #3a2405 !important; }
.btn.gold:hover { background: linear-gradient(180deg, #ffd97d, #ecbd56); }
.btn.ghost { background: #fff; color: var(--ro-blue-deep) !important; border-color: var(--win-line); }
.btn small { font: 400 11.5px var(--font-body); opacity: .85; }
.btn.block { display: flex; width: 100%; }
.btn.tall { flex-direction: column; gap: 0; min-height: 52px; line-height: 1.25; }

/* ---------------------------------------------------------------- tables + tags */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 500 12.5px var(--font-head); color: var(--win-mute); background: var(--win-body-2); padding: 6px 10px; border-bottom: 1px solid #d3dce9; white-space: nowrap; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid #e3e9f2; vertical-align: middle; }
.tbl tr:hover td { background: #f0f5fc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tag { display: inline-block; min-width: 58px; text-align: center; padding: 1px 6px; border-radius: 2px; font: 600 11px/1.6 var(--font-body); letter-spacing: .4px; color: #fff; background: #6c7a91; }
.tag.update { background: var(--ro-blue); }
.tag.fix { background: #4e8c62; }
.tag.event { background: #c4741c; }
.tag.notice { background: #8a5bb3; }
.tag.mvp { background: var(--mvp); min-width: 0; }
.tag.boss { background: #8d6a12; min-width: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--win-mute); }
.kv dd { margin: 0; font-weight: 600; color: var(--win-ink); font-variant-numeric: tabular-nums; }

.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.rate { text-align: center; padding: 8px 4px; background: #fff; border: 1px solid #d5deea; border-radius: var(--radius); }
.rate b { display: block; font: 600 22px/1.1 var(--font-head); color: var(--ro-blue-deep); }
.rate span { font-size: 12px; color: var(--win-mute); }

.search { display: flex; gap: 6px; }
.search input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--win-line); border-radius: var(--radius); font: inherit; background: #fff; color: var(--win-ink); }
.search input:focus { outline: 2px solid #9cc0ef; border-color: var(--ro-blue); }

/* ---------------------------------------------------------------- page shell */
.page { padding: 22px 0 60px; }
.crumbs { font-size: 13px; color: #8fa3c0; margin: 0 0 10px; }
.crumbs a { color: #b9c8de; text-decoration: none; }
.page-title { font: 500 28px/1.3 var(--font-head); color: var(--sand); margin: 0 0 4px; }
.page-lead { color: #a9b9d0; margin: 0 0 20px; }

.site-foot { border-top: 1px solid var(--night-line); background: #08101c; color: #8798b1; font-size: 13px; padding: 26px 0; }
.site-foot .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-foot nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-foot a { color: #aebdd3; text-decoration: none; }
.site-foot a:hover { color: #fff; }
.site-foot .spacer { flex: 1; }

/* item description colours come from the client (^RRGGBB) */
.desc { white-space: pre-wrap; font-size: 14px; line-height: 1.65; color: #2b3a54; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; margin: 0; padding: 6px 0 12px;
    background: #0f1c2e; border-bottom: 2px solid var(--gold-deep); max-height: calc(100vh - 62px); overflow-y: auto; }
  .nav.open { display: flex; }
  .nav > li > a, .nav > li > button { height: 46px; width: 100%; padding: 0 var(--gutter); }
  .drop { position: static; min-width: 0; box-shadow: none; border: 0; border-radius: 0; background: #16263d; padding: 0; }
  .drop a { color: #d7e1ef; padding: 10px 28px; }
  .drop a:hover { background: #1d3150; color: #fff; }
  .drop .sep { background: #26405f; }
  .drop small { color: #8fa3c0; }
  .nav .play { margin: 8px var(--gutter) 0; justify-content: center; height: 42px; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .page-title { font-size: 23px; }
  .win-body { padding: 12px; }
  .tbl { font-size: 13.5px; }
  .tbl td, .tbl th { padding: 6px 7px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ==========================================================================
   หน้าแรก
   ========================================================================== */
.banner { position: relative; border-bottom: 1px solid #000; background: #0a1220; }
/* รูปแบนเนอร์มีโลโก้ CLASS4 RO อยู่กลางรูปแล้ว: ดันรูปไปขวาให้โลโก้พ้นตัวหนังสือ และไล่เงาซ้ายให้ทึบพอให้อ่านออก */
.banner img { display: block; width: 100%; height: clamp(190px, 30vw, 340px); object-fit: cover; object-position: 50% 30%; transform: translateX(18%); }
.banner { overflow: hidden; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,14,26,.97) 0%, rgba(8,14,26,.9) 34%, rgba(8,14,26,.35) 58%, rgba(8,14,26,0) 75%), linear-gradient(0deg, rgba(13,23,38,1) 0%, rgba(13,23,38,0) 35%); }
@media (max-width: 700px) { .banner img { transform: none; opacity: .45; } }
.banner .wrap { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.banner h1 { margin: 0; font: 600 clamp(26px, 4.2vw, 44px)/1.15 var(--font-head); color: var(--sand); text-shadow: 0 2px 0 #000; }
.banner h1 span { color: var(--gold); }
.banner p { margin: 8px 0 16px; max-width: 34em; color: #d3dcea; font-size: clamp(14px, 1.6vw, 16.5px); }
.banner .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.home { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 18px; padding: 20px 0 50px; align-items: start; }
.home .col { display: grid; gap: 18px; min-width: 0; }

.ways { display: grid; gap: 8px; }
.way { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; text-decoration: none; background: #fff; border: 1px solid #d5deea; border-radius: var(--radius); }
.way:hover { border-color: var(--ro-blue); background: #f2f7fe; }
.way i { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 17px; background: #e3ecf8; color: var(--ro-blue-deep); }
.way b { font: 500 15px var(--font-head); color: var(--win-ink); }
.way span { font-size: 12.5px; color: var(--win-mute); }

.dl { display: grid; gap: 8px; margin: 12px 0; }
.steps { margin: 0; padding-left: 20px; font-size: 13.5px; color: #34445f; }
.steps li { margin: 5px 0; }
.steps b { color: var(--win-ink); }
.warn { color: var(--bad); }

.board td.when { color: var(--win-mute); font-size: 13px; white-space: nowrap; width: 1%; }
.board td.kind { width: 1%; }
.board td.title { font-weight: 500; min-width: 180px; }

.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quick a { display: block; padding: 12px; text-decoration: none; background: #fff; border: 1px solid #d5deea; border-left: 3px solid var(--ro-blue); border-radius: var(--radius); }
.quick a:hover { background: #f2f7fe; border-left-color: var(--gold); }
.quick b { display: block; font: 500 15px var(--font-head); color: var(--win-ink); }
.quick span { font-size: 12.5px; color: var(--win-mute); }

.mvp-row td:first-child { width: 46px; }
.mvp-row img { width: 40px; height: 40px; object-fit: contain; display: block; }

@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr); }
}
