/* ========== Reset & Base ========== */
*{ margin:0; padding:0; box-sizing:border-box; }
html,body{ height:100%; }
:root{
  --bg:#0b0b0b;
  --panel:#141414;
  --panel-2:#1b1b1b;
  --line:rgba(255,255,255,.08);
  --text:#cfcfcf;
  --muted:#9b9b9b;
  --accent:#ffc400;
  --accent-2:#ff9a00;
  --danger:#b40000;
  --danger-2:#e60000;
  --nav-height:72px; /* ความสูงเมนู */

  /* Marquee */
  --marquee-gap: 400px;       /* ระยะห่างระหว่างชุดข้อความ */
  --marquee-duration: 30s;   /* ความเร็วการวิ่ง */
}
body{
  background-color:#111;
  color:#ccc;
  font-family:"Kanit",system-ui,-apple-system,Segoe UI,Roboto,Arial,"Noto Sans Thai",sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding-top: var(--nav-height); /* กันข่าววิ่งทับเมนู */
  -webkit-touch-callout: none; /* กันเมนูแตะค้าง iOS */
}
img { -webkit-user-drag: none; }

/* ========== HERO + TOP NAV ========== */
.hero{ position:relative; background:#000; min-height:40px; }
.hero__fade{
  position:absolute; left:0; right:0; bottom:0; height:40%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(11,11,11,.75) 60%, rgba(11,11,11,1) 100%);
  pointer-events:none;
}

.top-nav{
  position:fixed; left:0; right:0; top:0; z-index:999;
  display:flex; justify-content:center; align-items:center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  height: var(--nav-height);
}
.top-nav ul{
  list-style:none; display:flex; gap:60px; padding:10px 18px; align-items:center;
}
.top-nav li a{
  text-decoration:none; color:#EBB33A; font-weight:900; font-size:23px; display:block; text-align:center;
  position:relative; padding:4px 20px; transition:transform .15s ease;
}
.top-nav li a:hover{ transform:translateY(-1px); }
.top-nav li a::after{
  content:""; position:absolute; left:50%; bottom:-6px; width:0; height:2px;
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
  transform:translateX(-50%); transition:width .2s ease;
}
.top-nav li a:hover::after{ width:80%; }
.top-nav li a span{ display:block; font-size:12px; font-weight:400; color:#D78E24; }

/* ========== Marquee (สูงขึ้น + เริ่มจากขวาสุดจริง ๆ) ========== */
.news-marquee{
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  background:
    linear-gradient(90deg, rgba(11,11,11,1) 0%, rgba(11,11,11,0) 8%, rgba(11,11,11,0) 92%, rgba(11,11,11,1) 100%),
    #1c1c1c;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);

  /* ทำให้ช่องข่าวสูงขึ้นและจัดกลางแนวตั้ง */
  min-height: 40px;          /* ปรับได้ตามชอบ */
  padding: 8px 16px;
  display: flex;
  align-items: center;

  font-size: 15px;
  color: #f0c040;
  z-index: 2;
}

/* รองรับทั้งกรณีมี .marquee-track หรือ <span> เดี่ยว ๆ */
.news-marquee .marquee-track,
.news-marquee > span{
  display: inline-flex;
  gap: var(--marquee-gap);
  white-space: nowrap;

  /* เคลื่อนจากขวาสุดจริง ๆ → พ้นซ้าย */
  animation: marquee-slide var(--marquee-duration) linear infinite;
  will-change: margin-left;
}

/* หยุดวิ่งขณะ hover */
.news-marquee:hover .marquee-track,
.news-marquee:hover > span{
  animation-play-state: paused;
}

/* เริ่ม margin-left:100% (ชิดขวาสุด) → ไป -100% (พ้นซ้าย) */
@keyframes marquee-slide{
  0%   { margin-left: 100%; }
  100% { margin-left: -100%; }
}

/* ========== Main Layout ========== */
.container{
  display:flex; gap:24px; max-width:1450px; margin:18px auto; padding:0 12px;
  align-items:flex-start;
}

/* Panels */
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:6px;
  box-shadow:0 10px 24px rgba(0,0,0,.35);
}
.panel--inner{
  background:var(--panel-2);
  border:1px solid var(--line);
  border-radius:6px;
  padding:10px;
}
.panel__title{
  padding:10px 32px; font-size:14px; letter-spacing:.4px; text-transform:uppercase;
  background:linear-gradient(180deg,#2a2a2a,#1d1d1d);
  border-bottom:1px solid var(--line); color:#fff;
}
.panel__title--danger{ background:linear-gradient(180deg,#ff3b3b,#b30000); color:#ffefb0; }

.muted{ color:var(--muted); }
.center{ text-align:center; }

/* ========== Sidebar ========== */
.sidebar{ width:250px; display:flex; flex-direction:column; gap:25px; }

/* DOWNLOAD */
.download-box{ padding:12px; }
.btn{
  display:block; width:100%; padding:10px 12px; border:none; border-radius:4px;
  font-weight:800; cursor:pointer; text-align:center; text-decoration:none;
}
.btn--download {
  margin-top: 20px;
  background: linear-gradient(180deg,#ffe06a,var(--accent));
  color: #000;
  box-shadow: 0 4px 0 #b37f00;
  padding: 25px 20px;
  font-size: 22px;
  border-radius: 4px;
}
.btn--download:hover{ filter:brightness(1.05); }

/* LOGIN */
.login-box .login__fields{ padding:12px; }
.login-box input{
  width:100%; margin:6px 0; padding:10px 12px;
  background:#0f0f0f; border:1px solid var(--line); border-radius:4px; color:#eee;
}
.btn--accent{ background:linear-gradient(180deg,#ffe06a,var(--accent)); color:#000; }
.btn--danger{ background:linear-gradient(180deg,#ff5959,#d80f0f); color:#fff; margin-top:6px; }
.helper{ display:inline-block; margin:0 12px 12px; font-size:12px; color:#bbb; text-decoration:none; }
.helper:hover{ color:#fff; }

/* MENU LIST */
.menu-buttons{ padding:10px; }
.menu-buttons .btn--list{
  background:#2a2a2a; color:#ffb100; border:1px solid var(--line); margin:18px 0;
}
.menu-buttons .btn--list:hover{ background:#333; }

/* HIGHLIGHT */
.highlight video{ width:100%; border-radius:4px; }

/* GM CONTACT */
.gm-contact{ padding:12px; font-size:17px; }
.gm-contact .time{ font-weight:700; margin-bottom:18px; }

/* ========== Content (Center) ========== */
.content{ flex:1; padding:20px; border-radius:8px; }
.content-banner{ text-align:center; margin-bottom:16px; }
.content-banner img{ width:100%; max-width:800px; height:auto; border-radius:8px; border:1px solid var(--line); }

.news-head{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.tag{
  display:inline-block; padding:4px 8px; border-radius:3px; font-size:12px; font-weight:800;
  color:#000; background:linear-gradient(180deg,#ffe06a,var(--accent));
}
.news-title{ font-weight:800; color:#fff; }

.recent-news h2{ margin:16px 0 10px; color:#ffc800; font-size:16px; letter-spacing:.3px; }
.news-tabs{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.news-tabs button{
  background:#2b2b2b; color:#ccc; padding:8px 14px; border:none; border-radius:999px; cursor:pointer;
  border:1px solid var(--line); transition:background .12s ease, color .12s ease, transform .12s ease;
}
.news-tabs button:hover{ color:#fff; transform:translateY(-1px); }
.news-tabs button.is-active{ background:linear-gradient(90deg,var(--accent),var(--accent-2)); color:#000; }

/* รายการข่าวแบบแถว */
.news-list{ margin-bottom:16px; }
.news-row{
  display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center;
  padding:8px 10px; border-bottom:1px solid var(--line); color:#ddd; text-decoration:none;
}
.news-row:hover{ background:#202020; }
.row-title{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.row-time{ font-size:12px; color:#aaa; }

/* การ์ดข่าว */
.news-card{
  display:flex; gap:15px; background:#212121; padding:12px; margin-bottom:12px; border-radius:6px;
  border:1px solid var(--line);
}
.news-card img{ width:170px; height:120px; border-radius:4px; object-fit:cover; }
.news-card-content h4{ color:#fff; margin-bottom:5px; }

/* ========== Leaderboard (ขวา) ========== */
.leaderboard {
  margin: 12px;
  min-height: 615px; /* ปรับตามความยาวที่ต้องการ */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.lb-wrap{ padding:8px; }
.lb-table{
  width:100%; border-collapse: collapse; font-size:13px;
}
.lb-table thead th{
  text-align:left; color:#fff; background:#1f1f1f; padding:6px; font-size:12px;
  border-bottom:1px solid var(--line);
}
.lb-table tbody td{
  padding:6px; border-bottom:1px solid var(--line); color:#ddd; font-size:12px;
}
.lb-table tbody tr:hover{ background:#202020; }
.lb-status{ margin-top:6px; font-size:12px; color:var(--muted); text-align:center; }

/* ========== Rightbar ========== */
/* Rightbar */
.rightbar {
  width: 320px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;              /* เพิ่มระยะห่างระหว่างกล่อง */
}
.rightbar .panel__title{ margin:0; }
.activity{ margin:12px; }
.character-section{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin:12px; }
.character-list{ list-style:none; flex:1; }
.character-list li{
  font-size:15px; margin:6px 0; cursor:pointer; color:#ccc; display:flex; align-items:center; transition:color .2s ease;
  padding:6px 0; border-bottom:1px dashed var(--line);
}
.character-list li:hover{ color:#fff; }
.character-list li.is-active{ background:#2b2b2b; color:#fff; border-radius:6px; padding-left:6px; }
.character-list .arrow{ color:#ffc800; margin-right:8px; display:inline-block; transition:transform .15s ease; }
.character-list li.is-active .arrow{ transform:rotate(90deg); }

.character-image img {
  width:230px;
  height:auto;
  object-fit:contain;
  border-radius:6px;
  border: none !important;
}

/* กล่องคำอธิบายใต้รูป */
.character-meta{
  margin: 8px 12px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.character-meta h4{ color:#fff; margin-bottom:6px; font-size:15px; letter-spacing:.2px; }
.character-meta p{ color: var(--text); font-size: 13px; line-height: 1.5; margin-bottom:8px; }
.char-tags{ list-style:none; display:flex; flex-wrap:wrap; gap:6px; }
.char-tags li{
  font-size:12px; color:#000; padding:4px 8px; border-radius:999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

/* ปุ่มโซเชียล */
.btn--discord {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  font-weight: 800;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(90deg, #5865F2, #4752C4);
  text-decoration: none;
  transition: background .2s ease, transform .15s ease;
}
.btn--discord:hover {
  background: linear-gradient(90deg, #4752C4, #2C2F33);
  transform: translateY(-2px);
}
.btn--facebook {
  display:block;
  width:100%;
  padding:12px;
  text-align:center;
  font-weight:800;
  border-radius:6px;
  color:#fff;
  background: linear-gradient(90deg, #1877F2, #145DBF);
  text-decoration:none;
  transition: background .2s ease, transform .15s ease;
}
.btn--facebook:hover {
  background: linear-gradient(90deg, #145DBF, #0E4BA3);
  transform: translateY(-2px);
}

/* ========== Footer ========== */
.footer{
  background:#000; color:#666; text-align:center; padding:20px 0; margin-top:40px; font-size:13px; border-top:1px solid var(--line);
}
.footer span{ color:#ffc800; }

/* ========== Responsive ========== */
@media (max-width: 992px){
  .rightbar{ width:280px; }
  .character-image img{ width:180px; }
}
@media (max-width: 768px){
  .container{ flex-direction:column; }
  .sidebar, .rightbar, .content{ width:100%; }
  :root{ --nav-height: 60px; }
  .top-nav ul{ gap:20px; flex-wrap:wrap; }

  /* Leaderboard: ย่อ */
  .lb-table { font-size:12px; }
  .lb-table thead th, .lb-table tbody td { padding:5px; }
}
@media (max-width: 480px){
  :root{ --nav-height: 56px; }
  .news-card{ flex-direction:column; align-items:center; text-align:center; }
  .news-card img{ width:100%; height:auto; }
}

/* ลดแอนิเมชัน */
@media (prefers-reduced-motion: reduce){
  .news-marquee .marquee-track,
  .news-marquee > span{
    animation: none;
    margin-left: 0;
  }
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}

/* เพิ่มระยะห่างระหว่างข้อความในกล่อง GM Contact */
.gm-contact p {
  margin-bottom: 21px;   /* ระยะห่างแต่ละบรรทัด */
  line-height: 2.0;      /* ระยะห่างในบรรทัด */
}
