:root {
  --red: #c41e3a;
  --red-dark: #9b1c2e;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --ink: #16202c;
  --muted: #64748b;
  --line: #e4eaf2;
  --bg: #fafafa;
  --card: #ffffff;
  --hot: #ff4d6d;
  --ok: #16a34a;
  --amber: #d97706;
  --grad: linear-gradient(120deg, #c41e3a, #dc2626 50%, #ef4444);
  --shadow: 0 2px 10px rgba(120, 20, 30, .08);
  --shadow-lg: 0 10px 34px rgba(120, 20, 30, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: "Sarabun", "Segoe UI", Tahoma, "Noto Sans Thai", sans-serif; line-height: 1.6; }
h1, h2, h3, .brand, .hero h1, .sd-title, .sd-bar, .ranking-head h1, .page-head h1, .me-name, .server-row .name, .game-name { font-family: "Kanit", "Sarabun", sans-serif; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code { background: var(--red-50); color: var(--red-dark); padding: 2px 6px; border-radius: 5px; word-break: break-all; font-size: 13px; }

/* ---------- Navbar (ขาว สะอาด) ---------- */
.nav { background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { font-weight: 800; font-size: 21px; white-space: nowrap; color: var(--red-dark); }
.brand span { color: var(--muted); font-weight: 600; }
.nav-toggle { display: none; background: transparent; border: 0; color: var(--ink); font-size: 24px; cursor: pointer; margin-left: auto; }
.nav-menu { flex: 1; display: flex; align-items: center; justify-content: space-between; }
.nav-left, .nav-right { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav-left a, .nav-right a { color: #334155; padding: 9px 12px; border-radius: 9px; display: inline-block; font-size: 14.5px; white-space: nowrap; transition: .15s; }
.nav-left a:hover, .nav-right a:hover { background: var(--red-50); color: var(--red-dark); }
.nav-user { color: var(--muted); font-size: 13px; padding: 0 8px; }
.btn-pill { background: var(--red) !important; color: #fff !important; font-weight: 700; padding: 8px 16px !important; border-radius: 999px !important; box-shadow: 0 4px 14px rgba(196, 30, 58, .35); }
.btn-pill:hover { background: var(--red-dark) !important; color: #fff !important; }
.logout-form { margin: 0; }
.logout-form button { background: transparent; border: 1px solid var(--line); color: #475569; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; font-family: inherit; }
.logout-form button:hover { border-color: var(--red); color: var(--red-dark); }

.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; list-style: none; margin: 8px 0 0; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; color: var(--ink) !important; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.dropdown-menu a:hover { background: var(--red-50); color: var(--red-dark) !important; }

@media (max-width: 860px) {
  .nav-inner { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  /* เมนูตกลงมาเต็มความกว้างใต้แถบนำทาง (ไม่รวมกับโลโก้) */
  .nav-menu { display: none; flex-basis: 100%; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0 10px; margin-top: 6px; border-top: 1px solid var(--line); }
  .nav-menu.open { display: flex; }
  .nav-left, .nav-right { flex-direction: column; align-items: stretch; width: 100%; gap: 2px; }
  .nav-left a, .nav-right a, .nav-user { padding: 12px 12px; border-radius: 10px; }
  .dropdown-menu { position: static; box-shadow: none; border: 0; background: var(--red-50); margin: 2px 0 4px; border-radius: 10px; }
  .btn-pill { display: inline-block; margin: 8px 12px; text-align: center; }
  .logout-form { padding: 6px 12px; }
}

main.wrap { padding-top: 20px; padding-bottom: 48px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }

/* ---------- Hero ---------- */
.hero { background: var(--grad); border-radius: 18px; padding: 30px 26px; margin-bottom: 16px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(255, 255, 255, .25), transparent 70%); }
.hero h1 { margin: 0 0 6px; font-size: 28px; position: relative; }
.hero p { margin: 0 0 16px; opacity: .92; position: relative; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
/* Inside the hero block (colored gradient bg) we want the CTA to pop, so flip
   it to white-on-theme. Body-level .btn-vote stays solid green elsewhere. */
.hero .btn-vote { background: #fff; color: var(--red-dark) !important; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }
.hero .btn-vote:hover { background: #f8fafc; }
.hero .btn-add { background: rgba(255, 255, 255, .15); color: #fff !important; border-color: rgba(255, 255, 255, .5); }
.hero .btn-add:hover { background: rgba(255, 255, 255, .28); }

.hero-feat { margin-top: 26px; font-size: 14px; color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); border-radius: 12px; padding: 12px 14px; position: relative; }
.hero-feat b { color: #fff; }
.hero-feat a { color: #fff; text-decoration: underline; font-weight: 700; white-space: nowrap; }

/* ---------- เซิร์ฟมาแรง ---------- */
.hot { margin-bottom: 18px; }
.hot-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.hot-head h2 { margin: 0; font-size: 19px; }
.hot-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.hot-row::-webkit-scrollbar { height: 6px; }
.hot-row::-webkit-scrollbar-thumb { background: var(--red-100); border-radius: 999px; }
.hot-card { flex: 0 0 auto; width: 132px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; box-shadow: var(--shadow); position: relative; transition: .15s; }
.hot-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--red-100); }
.hot-rank { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--hot); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.hot-card img { width: 66px; height: 66px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: #555;  }
.hot-name { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin: 8px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-cnt { display: block; font-size: 12px; font-weight: 800; color: var(--ok); }

/* ---------- Chip bar (แถบเกมแนวนอน) ---------- */
.chipbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 16px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chipbar::-webkit-scrollbar { height: 6px; }
.chipbar::-webkit-scrollbar-thumb { background: var(--red-100); border-radius: 999px; }
.chip { flex: 0 0 auto; background: #fff; border: 1px solid var(--line); color: #334155; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); transition: .15s; }
.chip:hover { border-color: var(--red); color: var(--red-dark); }
.chip.active { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 4px 14px rgba(196, 30, 58, .35); }
.chip span { opacity: .7; font-size: 12px; }
.chip.active span { opacity: .9; }

/* ---------- buttons ---------- */
/* Primary "vote / submit / CTA" button.
   Uses --vote which is coordinated-but-distinct from the theme primary:
     • red/blue/orange theme  → vote button green
     • green theme            → vote button amber  (avoid clashing with primary)
     • purple theme           → vote button amber  (complementary)
   So the CTA always stands out regardless of theme. */
.btn-vote, .btn-primary { display: inline-flex; align-items: center; justify-content: center; background: var(--vote); color: #fff !important; border: 1px solid transparent; cursor: pointer; padding: 9px 18px; border-radius: 10px; font-weight: 700; font-size: 14.5px; line-height: 1.1; font-family: inherit; box-shadow: 0 4px 14px rgba(var(--vote-shadow), .32); transition: .15s; text-align: center; vertical-align: middle; }
.btn-add { vertical-align: middle; }
.btn-vote:hover, .btn-primary:hover { background: var(--vote-dark); color: #fff !important; box-shadow: 0 6px 20px rgba(var(--vote-shadow), .48); }
.btn-vote:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn-vote.big { width: 100%; font-size: 17px; padding: 13px; }
.btn-primary.small { padding: 7px 12px; font-size: 13px; }
.btn-add { display: inline-flex; align-items: center; justify-content: center; line-height: 1.1; background: var(--red-50); color: var(--red-dark) !important; border: 1px solid var(--red-100); padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; transition: .15s; }
.btn-add:hover { background: var(--red-100); }
.btn-danger { background: #e7505a !important; color: #fff !important; border-color: #e7505a !important; }
.btn-danger:hover { background: #d23b46 !important; }

/* ---------- ranking ---------- */
.reset-bar { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--amber); background: #fff7ed; border: 1px solid #fed7aa; border-radius: 999px; padding: 5px 14px; margin-bottom: 14px; }
.ranking h1 { margin: 0; font-size: 22px; }
.ranking-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ranking-head h1 { color: var(--ink); }
.live-label { font-size: 12px; font-weight: 800; color: var(--red-dark); display: flex; align-items: center; gap: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 0 rgba(255, 77, 109, .6); animation: live-pulse 1.4s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, .55); } 70% { box-shadow: 0 0 0 7px rgba(255, 77, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); } }
.rc { font-size: 12px; font-weight: 800; margin-left: 2px; vertical-align: middle; }
.rc.up { color: var(--ok); } .rc.down { color: var(--hot); } .rc.same { color: #94a3b8; }
.rc.new { color: #fff; background: var(--red); font-size: 9.5px; padding: 1px 6px; border-radius: 999px; }

.server-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); transition: .15s; }
.server-row:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.server-row .rank { font-size: 20px; font-weight: 800; min-width: 52px; color: var(--red-dark); text-align: center; }
.rank-logo { flex-shrink: 0; display: block; }
.rank-logo img { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: #555; display: block; }
.server-row.top .rank-logo img { width: 78px; height: 78px; }
@media (max-width: 560px) { .rank-logo img { width: 54px; height: 54px; } .server-row.top .rank-logo img { width: 58px; height: 58px; } }
.server-row.top { border-color: var(--red-100); }
.server-row.top1 { background: linear-gradient(100deg, #fffbeb, #fff 40%); border-color: #fde68a; }
.server-row.top2 { background: linear-gradient(100deg, #f8fafc, #fff 40%); border-color: #e2e8f0; }
.server-row.top3 { background: linear-gradient(100deg, #fff7ed, #fff 40%); border-color: #fed7aa; }
.server-row.top .rank { font-size: 26px; }
.server-row .info { flex: 1; min-width: 0; }
.server-row .name { font-size: 17px; font-weight: 700; color: var(--ink); }
.server-row .name:hover { color: var(--red); }
.server-row .game { font-size: 12.5px; color: var(--muted); }
.server-row .desc { font-size: 13.5px; color: #475569; margin: 6px 0 0; }
.server-row .readmore { font-size: 12px; }
.server-row .votes { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 132px; }
.server-row .votes .num { font-family: 'Oxanium', 'Segoe UI', Tahoma, sans-serif; font-size: 24px; font-weight: 800; color: var(--ok); letter-spacing: .5px; display: inline-block; transition: color .2s; line-height: 1.1; white-space: nowrap; }
.server-row .votes .btn-vote { padding: 8px 22px; }
.server-row .num.bump { color: #0bbf6a; animation: num-bump .8s; }
@keyframes num-bump { 0% { transform: scale(1); } 30% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* มือถือ: การ์ดเซิร์ฟแบบ stack — ชื่อเต็มบรรทัด, เลขโหวต+ปุ่มอยู่แถบล่าง */
@media (max-width: 560px) {
  .server-row { flex-wrap: wrap; padding: 14px; gap: 10px; }
  .server-row .rank { min-width: 40px; font-size: 20px; }
  .server-row.top .rank { font-size: 24px; }
  .server-row .info { flex: 1 1 0; min-width: 0; }
  .server-row .votes { width: 100%; flex-direction: row; align-items: center; justify-content: space-between;
    gap: 10px; min-width: 0; margin-top: 2px; padding-top: 12px; border-top: 1px dashed var(--line); }
  .server-row .votes .num { font-size: 20px; flex: 1; min-width: 0; text-align: left; }
  .server-row .votes .btn-vote { flex: 0 0 auto; padding: 6px 14px; font-size: 13px; }
}
.empty { background: var(--card); border: 1px dashed var(--red-100); border-radius: 14px; padding: 34px; text-align: center; color: var(--muted); }

/* ---------- games grid ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.game-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); transition: .15s; display: block; }
.game-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.game-cover { position: relative; aspect-ratio: 16/9; background: var(--red-50); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-count { position: absolute; right: 8px; bottom: 8px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.game-name { padding: 11px 12px; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.game-card-all .game-cover { background: var(--grad); }
.game-all-cover { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-weight: 800; font-size: 18px; line-height: 1.3; }
.game-card-all .game-count { background: rgba(0,0,0,.25); }

/* แบ่งหน้า */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }
.pager .pg { padding: 8px 13px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.pager .pg:hover { border-color: var(--red); color: var(--red-dark); }
.pager .pg.active { background: var(--red); color: #fff; border-color: var(--red); }
.pager .pg-gap { padding: 8px 4px; color: var(--muted); }

/* ---------- admin ---------- */
.admin-nav { display: flex; gap: 8px; margin: 8px 0 4px; }
.admin-nav a { padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--red-50); color: var(--red-dark); border: 1px solid var(--red-100); }
.admin-nav a.active { background: var(--red); color: #fff; border-color: var(--red); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.admin-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.admin-name { font-weight: 700; font-size: 14px; margin: 8px 0; }
.admin-card input[type=file] { width: 100%; font-size: 12px; margin-bottom: 8px; }

/* ---------- cards / vote / forms ---------- */
.vote-card { max-width: 470px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; text-align: center; box-shadow: var(--shadow); }
.vote-card.center { text-align: center; }
.vote-card h1 { margin: 0 0 4px; font-size: 22px; }
.game-cat { color: var(--muted); margin: 0 0 18px; }
.vote-card label, .card label { display: block; text-align: left; font-size: 13px; color: var(--muted); margin: 14px 0 5px; font-weight: 600; }
.vote-card input, .vote-card select, .vote-card textarea, .card input[type=text], .card input[type=number] { width: 100%; padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 15px; font-family: inherit; }
.vote-card input:focus, .vote-card select:focus, .vote-card textarea:focus, .card input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-100); }
.vote-card textarea { resize: vertical; }
.vote-card input#captcha { text-align: center; letter-spacing: 3px; font-size: 20px; }
.vote-card form .btn-vote.big { margin-top: 20px; }
.id-row { display: flex; gap: 8px; align-items: center; }
.id-row input[type=text] { flex: 1; min-width: 0; }
.lock-id { flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 4px; margin: 0; }
.lock-id input { width: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .row2 { grid-template-columns: 1fr; } }
.readmore { display: inline-block; margin-top: 6px; font-size: 12px; }

/* หัวหน้าโหวต: โลโก้ + ชื่อ + คะแนนรวม */
.vote-head { display: flex; align-items: center; gap: 14px; justify-content: center; text-align: left; margin-bottom: 16px; }
.vote-logo { width: 74px; height: 74px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #555; flex-shrink: 0; padding: 4px; }
.vote-head-text { min-width: 0; }
.vote-head h1 { margin: 0; font-size: 20px; }
.vote-head .game-cat { margin: 2px 0 0; }
@media (max-width: 440px) { .vote-head { flex-direction: column; text-align: center; gap: 10px; } }

/* กล่องคะแนนโหวตรวม — มีกรอบ + ป้ายเล็กบนเส้น (fix) + เลขใหญ่ realtime */
.vote-score { position: relative; border: 2px solid var(--red-100); border-radius: 16px; padding: 16px 18px 14px; margin: 4px 0 18px; text-align: center; background: linear-gradient(180deg, #f0fff6, #fff); }
.vote-score-label { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--card); padding: 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.vote-score-num { display: block; font-family: "Kanit", "Sarabun", sans-serif; font-weight: 800; color: var(--ok); line-height: 1; white-space: nowrap; font-size: clamp(34px, 11vw, 52px); transition: transform .25s; }
.vote-score-num.bump { animation: num-bump .8s; }

.prokud-load { font-size: 14px; color: var(--muted); margin: 6px 0 12px; }
.prokud-load b { color: var(--red-dark); font-size: 18px; }
.btn-vote.ready { animation: vote-ready 1.2s infinite; }
@keyframes vote-ready { 0%,100% { box-shadow: 0 4px 14px rgba(var(--vote-shadow), .35); } 50% { box-shadow: 0 4px 26px rgba(var(--vote-shadow), .65); } }
.prokud-panel { display: flex; margin: 16px 0 4px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.prokud-col { flex: 1; padding: 10px 6px; background: #fff; }
.prokud-col + .prokud-col { border-left: 1px solid var(--line); }
.prokud-head { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.prokud-val { font-size: 22px; font-weight: 800; }
.prokud-val.ok { color: var(--ok); } .prokud-val.send { color: var(--amber); } .prokud-val.type { color: var(--red-dark); }
.prokud-val .cd { font-size: 13px; font-weight: 700; opacity: .75; }
.captcha-box { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.captcha-box svg { display: block; }
#refresh { background: var(--red); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 10px; font-size: 18px; cursor: pointer; }
.total { margin-top: 18px; }
.total b { color: var(--red-dark); font-size: 18px; }
.back { display: inline-block; margin-top: 14px; color: var(--muted); }
.back:hover { color: var(--red); }

.alert { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-weight: 600; }
.alert.hide { display: none; }
.alert.ok { background: #e9f9ef; color: var(--ok); border: 1px solid #b6e6c6; }
.alert.err { background: #fdecef; color: var(--hot); border: 1px solid #f7c4ce; }

/* ---------- หน้าเพิ่มเซิร์ฟ (responsive 2 คอลัมน์) ---------- */
.add-wrap { max-width: 920px; margin: 0 auto; }
.add-title { margin: 0 0 14px; font-size: 24px; }
.add-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.add-submit { grid-column: 1 / -1; text-align: center; }
.add-submit .btn-vote.big { max-width: 360px; margin: 4px auto 0; }
@media (max-width: 720px) { .add-form { grid-template-columns: 1fr; } }
.add-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.add-card h3 { margin: 0 0 4px; font-size: 16px; color: var(--red-dark); }
.add-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 5px; font-weight: 600; }
.add-card input[type=text], .add-card select, .add-card textarea { width: 100%; padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 15px; font-family: inherit; }
.add-card input:focus, .add-card select:focus, .add-card textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-100); }
.add-card textarea { resize: vertical; }
.add-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .add-card .row2 { grid-template-columns: 1fr; } }

/* ---------- แท็ก ---------- */
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tag-input:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-100); }
.tag-input #tagField { flex: 1; min-width: 120px; border: 0 !important; box-shadow: none !important; padding: 4px !important; outline: none; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--red-50); color: var(--red-dark); border: 1px solid var(--red-100); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 13px; font-weight: 600; }
.tag-chip button { background: var(--red-100); border: 0; color: var(--red-dark); width: 18px; height: 18px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.tag-chip button:hover { background: var(--hot); color: #fff; }
.tag-chip.view { padding: 4px 12px; }
.sd-tags { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }

/* ---------- หน้าจัดการ: การ์ดภาพรวม ---------- */
.overview-card { text-align: center; }
.overview-stat { background: var(--red-50); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.overview-num { display: block; font-size: 34px; font-weight: 800; color: var(--red-dark); font-family: "Kanit", "Sarabun", sans-serif; line-height: 1.1; }
.overview-lbl { font-size: 13px; color: var(--muted); }
.overview-actions { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.overview-actions .btn-vote, .overview-actions .btn-add { flex: 1 1 0; min-width: 150px; max-width: 220px; height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; line-height: 1; font-size: 14.5px; box-sizing: border-box; }
.overview-actions .btn-vote, .overview-actions .btn-add, .overview-actions .btn-vote *, .overview-actions .btn-add * { vertical-align: middle; }
.overview-note { margin: 14px 0 0; }

/* ---------- manage / addon ---------- */
.manage { max-width: 740px; margin: 0 auto; }
.manage h1 { font-size: 22px; margin: 0 0 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 16px 0; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 16px; color: var(--red-dark); }
.card .chk { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--ink); font-weight: 500; }
.card button.btn-vote { margin-top: 14px; }
.badge { display: inline-block; font-weight: 700; }
.badge.ok { color: var(--ok); } .badge.err { color: var(--hot); }
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
table.kv td:first-child { color: var(--muted); width: 90px; }
.statgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; text-align: center; }
@media (max-width: 600px) { .statgrid { grid-template-columns: repeat(2, 1fr); } }
.statgrid div { background: var(--red-50); border-radius: 10px; padding: 14px 6px; font-size: 12px; color: var(--muted); }
.statgrid span { display: block; font-size: 22px; font-weight: 800; color: var(--ink); }
.statgrid span.g { color: var(--ok); } .statgrid span.y { color: var(--amber); } .statgrid span.r { color: var(--red-dark); }
.addon-title { font-size: 15px; color: var(--muted); margin: 22px 0 4px; text-transform: uppercase; letter-spacing: .5px; }
.addon-promo { border-color: var(--red); background: linear-gradient(180deg, var(--red-50), #fff); }
.addon-promo h3 { color: var(--red-dark); }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pill { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.on { background: #e9f9ef; color: var(--ok); border: 1px solid #b6e6c6; }
.pill.off { background: #f1f5f9; color: #94a3b8; border: 1px solid var(--line); }
.pill.on.x2 { background: #e9f9ef; color: var(--ok); border: 1px solid #b6e6c6; }
.x2-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-top: 8px; }
.x2-tier { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border: 1.5px solid var(--red-100); background: var(--red-50); border-radius: 12px; cursor: pointer; transition: .15s; font-family: inherit; }
.x2-tier:hover { border-color: var(--red); transform: translateY(-2px); }
.x2-days { font-size: 13px; font-weight: 700; color: var(--ink); }
.x2-price { font-size: 18px; font-weight: 800; color: var(--red-dark); }
.x2-perday { font-size: 11px; color: var(--muted); }
.vip-tier { border-color: #fbbf24; background: linear-gradient(180deg, #fffbeb, #fff); }
.vip-tier .x2-price { color: #b45309; }
.vip-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(100deg, #fffbeb, #fff); border-color: #fde68a; }
.vip-banner b { color: #b45309; }
.vip-card { border-color: #fde68a; background: linear-gradient(180deg, #fffbeb, #fff); }
.vip-perks { margin: 0; padding-left: 20px; line-height: 2; }
.admin-userrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.au-info { min-width: 0; }
.au-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.au-controls label { margin: 0; font-size: 12px; color: var(--muted); }
.au-controls input[type=text], .au-controls input[type=number], .au-controls select { width: auto; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.au-controls input[type=text] { min-width: 180px; }
.me-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.me-head h1 { margin: 0; font-size: 22px; }
.me-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.me-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.me-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ---------- server detail ---------- */
.server-detail, .article-page { max-width: 820px; margin: 0 auto; }
.article-page { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.article-page h1 { margin-top: 0; }
.sd-tabs { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; margin-bottom: 8px; }
.sd-tabs a, .sd-tab-cur { padding: 6px 12px; border-radius: 9px 9px 0 0; background: var(--red-50); color: var(--red-dark); }
.sd-tab-cur { background: var(--red); color: #fff; font-weight: 700; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-bar { background: var(--grad); color: #fff; font-size: 19px; font-weight: 800; padding: 14px 18px; border-radius: 14px 14px 0 0; }
.sd-stats { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.sd-statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sd-stat { text-align: center; padding: 14px 8px; background: var(--red-50); border-radius: 12px; }
.sd-stat-vote { background: #e9f9ef; }
.sd-stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.sd-stat-num { font-size: 32px; font-weight: 800; color: var(--red-dark); line-height: 1.15; font-family: "Kanit", "Sarabun", sans-serif; }
.sd-stat-num.vote { color: var(--ok); display: inline-block; transition: transform .2s; }
.sd-stat-num.bump { animation: num-bump .8s; }
.sd-stat-sub { font-size: 11px; color: var(--muted); }
.sd-votebtn { display: block; width: 100%; text-align: center; margin-top: 14px; font-size: 16px; padding: 13px; }
.sd-body { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin-top: 18px; box-shadow: var(--shadow); }
.sd-titlerow { display: flex; align-items: center; gap: 16px; }
.sd-logo { width: 92px; height: 92px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #555; flex-shrink: 0; padding: 5px; }
.sd-titletext { min-width: 0; }
.sd-title { font-size: 26px; color: var(--red-dark); margin: 0 0 2px; }
@media (max-width: 560px) { .sd-logo { width: 66px; height: 66px; } .sd-title { font-size: 21px; } }
.sd-links { font-size: 13.5px; color: var(--muted); margin: 12px 0; }
.sd-links a { word-break: break-all; }
.sd-section { font-size: 18px; margin: 22px 0 8px; padding-bottom: 8px; border-bottom: 2px solid var(--red-50); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; margin-top: 12px; }
.detail-lead { font-size: 16px; color: #334155; margin: 18px 0; }
.article-body { line-height: 1.9; font-size: 15px; margin: 18px 0; word-wrap: break-word; }
.article-img { max-width: 100%; border-radius: 12px; margin: 12px 0; display: block; box-shadow: var(--shadow); }
.article-body a { word-break: break-all; }
/* สถิติรายอาทิตย์ */
.wk-list { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; }
.wk-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.wk-week { width: 92px; flex-shrink: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-bar { flex: 1; height: 16px; background: var(--red-50); border-radius: 999px; overflow: hidden; }
.wk-bar > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.wk-votes { width: 92px; flex-shrink: 0; text-align: right; font-weight: 800; color: var(--red-dark); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .wk-week { width: 74px; font-size: 12px; } .wk-votes { width: 70px; font-size: 12px; } }

.detail-footer { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.detail-footer .btn-vote.big { display: block; width: 100%; max-width: 340px; }
.detail-footer .back { margin: 0; }
@media (max-width: 560px) { .sd-statgrid { grid-template-columns: 1fr 1fr; } .sd-stat-vote { grid-column: 1 / -1; } .sd-stat-num { font-size: 28px; } }

/* ---------- Live feed ---------- */
.live-item { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.live-item img { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow); background: #555; }
.live-item:hover img { border-color: var(--red); }
.live-count { font-size: 12px; font-weight: 800; color: var(--ok); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; box-shadow: var(--shadow); }
.live-rail { display: none; position: fixed; right: 8px; top: 72px; width: 78px; z-index: 40; flex-direction: column; align-items: center; gap: 8px; }
.live-rail-viewport { width: 100%; height: calc(100vh - 110px); overflow: hidden; -webkit-mask-image: linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent); }
.live-rail-track { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: live-down linear infinite; }
.live-rail-track:hover { animation-play-state: paused; }
@keyframes live-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@media (min-width: 1280px) { .live-rail { display: flex; } }
.live-strip { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.live-strip .live-label { flex-shrink: 0; flex-direction: column; align-items: flex-start; gap: 2px; padding-right: 12px; border-right: 1px solid var(--line); z-index: 1; background: var(--card); }
.live-strip-viewport { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.live-strip-track { display: flex; align-items: center; gap: 16px; width: max-content; animation: live-left linear infinite; }
.live-strip-track:hover { animation-play-state: paused; }
.live-strip .live-item { flex-direction: row; gap: 6px; }
.live-strip .live-item img { width: 38px; height: 38px; border-radius: 9px; }
@keyframes live-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (min-width: 1280px) { .live-strip { display: none; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0; text-align: center; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 2px 0; }

/* Language toggle in nav-right (TH/EN switch) */
.lang-switch { display:flex; align-items:center; }
.lang-switch .lang-btn {
  display:inline-block; padding:6px 12px; border-radius:999px;
  border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.04);
  color:#cbd5ff; font-size:12px; letter-spacing:.5px; line-height:1;
  text-decoration:none; transition:background .15s ease, border-color .15s ease;
}
.lang-switch .lang-btn strong { color:#fff; }
.lang-switch .lang-btn:hover  { background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.35); }

/* =========================================================
   Footer (redesigned) + language switch
   Page bg is light (#fff / soft gray) — these styles work on white.
   ========================================================= */
.site-footer { margin-top:48px; padding:28px 0 18px; border-top:1px solid var(--line); background:linear-gradient(180deg, #fff7f7, #fff); color:#4b5563; }
.site-footer .wrap { max-width:1100px; margin:0 auto; padding:0 16px; }

.site-footer-inner {
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap:16px;
}
.site-footer-brand { text-align:left; }
.site-footer-title { font-weight:800; font-size:16px; color:#0f172a; margin:0; }
.site-footer-tagline { margin:2px 0 0; }

.site-footer-nav { display:flex; gap:14px; flex-wrap:wrap; justify-content:center; }
.site-footer-nav a { color:#334155; text-decoration:none; font-size:13px; padding:6px 10px; border-radius:8px; transition:background .12s; }
.site-footer-nav a:hover { background:rgba(196,30,58,.08); color:#c41e3a; }

.site-footer-lang { display:inline-flex; align-items:center; gap:8px; justify-self:end; padding:5px 10px; border:1px solid #e2e8f0; background:#fff; border-radius:999px; box-shadow:0 1px 2px rgba(15,23,42,.04); }
.site-footer-lang .lang-pill { padding:4px 10px; border-radius:999px; font-size:12px; font-weight:700; color:#64748b; text-decoration:none; transition:all .14s; }
.site-footer-lang .lang-pill.on { background:#c41e3a; color:#fff; box-shadow:0 4px 10px -3px rgba(196,30,58,.45); }
.site-footer-lang .lang-pill:hover:not(.on) { color:#c41e3a; background:rgba(196,30,58,.08); }
.site-footer-lang .lang-sep { color:#cbd5e1; user-select:none; }

.site-footer-copy { margin-top:14px; text-align:center; border-top:1px dashed #e2e8f0; padding-top:14px; }
.site-footer-copy p { margin-top:12px; margin-bottom:0; }

@media (max-width: 760px) {
  .site-footer-inner { grid-template-columns:1fr; text-align:center; }
  .site-footer-brand { text-align:center; }
  .site-footer-lang { justify-self:center; }
  .site-footer-nav { justify-content:center; }
}

/* =========================================================
   Edit-server page polish (logo preview + file pill)
   ========================================================= */
.edit-header { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:16px; }
.edit-header .back-link { color:#c41e3a; text-decoration:none; font-size:13px; padding:6px 10px; border-radius:8px; }
.edit-header .back-link:hover { background:rgba(196,30,58,.08); }

.logo-edit {
  display:flex; gap:18px; align-items:flex-start;
  padding:14px; background:#fff7f7; border:1px solid #e2e8f0;
  border-radius:14px; margin-bottom:14px;
}
.logo-preview {
  flex-shrink:0; width:120px; height:120px;
  background:#6b7280;
  border-radius:12px; border:1px solid #e2e8f0; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.logo-preview img { width:100%; height:100%; object-fit:contain; }
.logo-preview .logo-placeholder { font-size:12px; color:#94a3b8; text-align:center; padding:8px; line-height:1.5; }

.logo-actions { flex:1; min-width:0; }
.file-pill {
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 16px; background:#fff;
  border:1.5px dashed #fecaca; border-radius:10px;
  color:#c41e3a; font-weight:700; font-size:14px;
  cursor:pointer; transition:all .14s;
}
.file-pill:hover { background:#fee2e2; border-color:#c41e3a; }
.file-pill.has-file { background:rgba(34,197,94,.08); border-color:#22c55e; color:#15803d; border-style:solid; }
.file-pill input { display:none; }

@media (max-width: 600px) {
  .logo-edit { flex-direction:column; }
  .logo-preview { width:100%; height:auto; aspect-ratio:1; max-width:200px; margin:0 auto; }
}

/* =========================================================
   Mobile responsive polish (universal)
   ========================================================= */
@media (max-width: 720px) {
  /* Header — let the toggle drawer work, tighten brand spacing */
  .nav-inner { padding:8px 12px; }
  .brand { font-size:17px; }

  /* Hero — smaller padding, single-column buttons */
  .hero { padding:24px 14px; }
  .hero h1 { font-size:22px; line-height:1.3; }
  .hero p  { font-size:14px; }
  .hero-actions { flex-direction:column; gap:8px; }
  .hero-actions a { width:100%; text-align:center; }

  /* Chip bar — horizontal scroll on small screens */
  .chipbar {
    flex-wrap:nowrap; overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding:8px 4px; gap:6px;
  }
  .chipbar::-webkit-scrollbar { display:none; }
  .chip { flex-shrink:0; white-space:nowrap; }

  /* Ranking head + cards */
  .ranking-head h1 { font-size:18px; }
  .ranking-head .live-label { font-size:12px; }

  /* Forms — full-width inputs, comfortable tap targets */
  .add-form { gap:14px; }
  .add-card { padding:14px; }
  .add-card h3 { font-size:16px; }
  .row2 { grid-template-columns:1fr; gap:10px; }
  .add-submit { flex-direction:column; }
  .add-submit > * { width:100%; text-align:center; }
  input[type=text], input[type=email], input[type=password],
  input[type=number], select, textarea {
    font-size:16px; /* prevent iOS auto-zoom */
  }

  /* Game/category grid */
  .game-grid { grid-template-columns:repeat(2, 1fr); gap:10px; }
  .game-card { font-size:13px; }

  /* Manage page overview */
  .overview-card { flex-direction:column; gap:12px; align-items:stretch; }
  .overview-actions { display:flex; flex-direction:column; gap:8px; }
  .overview-actions a { width:100%; text-align:center; }
}

@media (max-width: 420px) {
  .game-grid { grid-template-columns:1fr 1fr; }
  .hero h1 { font-size:19px; }
  .site-footer-nav { gap:8px; font-size:12px; }
  .site-footer-nav a { padding:5px 8px; }
}

/* Universal soft polish — better focus rings, smoother transitions */
:focus-visible { outline:2px solid #c41e3a; outline-offset:2px; border-radius:6px; }
button, .btn-vote, .btn-add, .btn-pill { transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
button:active, .btn-vote:active, .btn-add:active, .btn-pill:active { transform: translateY(1px); }

/* =========================================================
   Homepage SEO body block (under ranking) + FAQ accordions
   ========================================================= */
.seo-block { margin:30px 0; }
.seo-block-inner {
  background:#fff; border:1px solid var(--line); border-radius:18px;
  padding:24px 26px; box-shadow:var(--shadow);
}
.seo-block-inner h2 { margin:0 0 12px; font-size:20px; color:var(--ink); }
.seo-block-inner p { font-size:14px; line-height:1.75; color:#334155; margin:6px 0 14px; }
.seo-block-inner a { color:var(--red-dark); font-weight:700; }

.seo-faq { margin:6px 0; border-top:1px solid var(--line); padding-top:8px; }
.seo-faq summary {
  cursor:pointer; font-weight:700; color:var(--ink); padding:8px 0;
  list-style:none; position:relative; padding-left:24px;
}
.seo-faq summary::-webkit-details-marker { display:none; }
.seo-faq summary::before {
  content:'+'; position:absolute; left:0; top:8px;
  width:18px; height:18px; line-height:16px; text-align:center;
  background:var(--red-50); color:var(--red-dark); border-radius:50%;
  font-weight:800; font-size:14px; transition:.15s transform;
}
.seo-faq[open] summary::before { content:'−'; transform:rotate(0); }
.seo-faq p { margin:4px 0 12px; padding-left:24px; }

@media (max-width:600px) {
  .seo-block-inner { padding:18px 18px; }
  .seo-block-inner h2 { font-size:18px; }
}

/* =========================================================
   Manage page — collapsible "ป้ายอันดับ" card
   ========================================================= */
.badge-collapse { padding:0; overflow:hidden; }
.badge-collapse > .badge-summary {
  list-style:none; cursor:pointer; padding:16px 20px;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
  background:linear-gradient(180deg, var(--red-50), #fff 90%);
  border-radius:14px; transition:.15s background;
  user-select:none;
}
.badge-collapse > .badge-summary::-webkit-details-marker { display:none; }
.badge-collapse > .badge-summary:hover { background:linear-gradient(180deg, var(--red-100), #fff 90%); }
.badge-summary-title { font-weight:700; font-size:16px; color:var(--ink); }
.badge-summary-title .small { font-weight:500; }
.badge-summary-hint { white-space:nowrap; transition:.15s; color:var(--red-dark) !important; }
.badge-collapse[open] > .badge-summary { border-bottom:1px solid var(--line); border-radius:14px 14px 0 0; }
.badge-collapse[open] .badge-summary-hint::after { content:''; }
.badge-collapse[open] .badge-summary-hint {
  /* flip the ▾ arrow visually */
  transform: rotate(0); /* CSS-only fallback */
}
.badge-collapse[open] .badge-summary-hint {
  content: 'ซ่อน ▴';
}
.badge-body { padding:18px 20px 20px; }
@media (max-width:560px) {
  .badge-collapse > .badge-summary { padding:14px 16px; }
  .badge-body { padding:14px 16px 18px; }
  .badge-summary-hint { display:none; }
}

/* =========================================================
   Admin → vote bot table
   ========================================================= */
.admin-bot-table { width:100%; border-collapse:collapse; font-size:14px; }
.admin-bot-table th { background:rgba(0,0,0,.03); padding:10px 8px; text-align:left; font-weight:700; color:#475569; font-size:12.5px; }
.admin-bot-table td { padding:10px 8px; border-top:1px solid var(--line); vertical-align:middle; }
.admin-bot-table tr.on td { background:rgba(22,163,74,.06); }
.admin-bot-table .text-center { text-align:center; }
.admin-bot-table .text-right  { text-align:right; }
.admin-bot-table input.bot-rate { width:90px; padding:7px 9px; border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:14px; }

/* Toggle switch (replaces ugly default checkbox) */
.bot-toggle { position:relative; display:inline-block; width:42px; height:22px; cursor:pointer; }
.bot-toggle input { opacity:0; width:0; height:0; }
.bot-toggle-slider {
  position:absolute; inset:0; background:#cbd5e1; border-radius:999px;
  transition:.2s; cursor:pointer;
}
.bot-toggle-slider::before {
  content:''; position:absolute; left:3px; top:3px; width:16px; height:16px;
  background:#fff; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.bot-toggle input:checked + .bot-toggle-slider { background:#16a34a; }
.bot-toggle input:checked + .bot-toggle-slider::before { transform:translateX(20px); }

@media (max-width:600px) {
  .admin-bot-table th, .admin-bot-table td { padding:8px 5px; font-size:13px; }
  .admin-bot-table input.bot-rate { width:70px; }
}

/* =========================================================
   Admin shared wrapper — all admin pages share the same width
   ========================================================= */
.admin-page { max-width: 1100px; margin: 0 auto; }
.admin-page > .page-head { margin-bottom: 16px; }

/* Bot search bar */
.bot-search-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.bot-search {
  flex: 1; min-width: 220px; max-width: 420px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; background: #fff;
}
.bot-search:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50); }
.bot-summary { white-space: nowrap; }
.bot-summary b, .bot-summary span { font-weight: 700; color: var(--ink); }

@media (max-width: 600px) {
  .bot-search-row { flex-direction: column; align-items: stretch; }
  .bot-search { max-width: 100%; }
}
