:root {
  --bg: #0a0e14;
  --panel: #111821;
  --panel-2: #161f2a;
  --line: #1f2b38;
  --line-2: #2a3a4a;
  --text: #e6edf3;
  --muted: #8494a7;
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-bg: rgba(45, 212, 191, 0.12);
  --win: #facc15;
  --lose: #f87171;
  --gold: #fbbf24;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(45, 212, 191, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ico { font-size: 13px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 26px;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.brand-logo { width: 28px; height: 28px; color: var(--accent); }
.nav {
  display: flex; gap: 4px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(45,212,191,.35); }
.login-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line-2);
}
.login-btn:hover { border-color: var(--accent); }

/* หัวเว็บ / ฟุตเตอร์ / รูปจาก wiki — ใช้ร่วมกันทั้ง 2 เว็บ */
[hidden] { display: none !important; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; display: block; }
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding: 22px 16px 30px; font-size: 11px; color: var(--muted); text-align: center; }
.site-foot a, .wiki-credit a { color: var(--accent-2); }
.wiki-credit { text-align: center; margin-top: 14px; }
.wimg { display: block; width: 100%; height: 100%; object-fit: contain; }
.wimg.fb { display: grid; place-items: center; font-style: normal; }

/* ---------- Page ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 18px 26px 40px; }

.announce {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 18px;
  background: linear-gradient(90deg, rgba(45,212,191,.10), rgba(45,212,191,.04));
  border: 1px solid rgba(45,212,191,.3); border-radius: 12px; font-weight: 600;
}
.announce-ico {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-bg);
}

.layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}

/* Empty state */
.empty { padding: 50px 0; text-align: center; color: var(--muted); }
.empty .empty-ico {
  width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 20px;
}
.empty p { color: var(--text); font-weight: 600; }
.empty small { display: block; margin-top: 4px; font-size: 11px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .account { position: static; }
  .nav { display: none; }
  .match-head { flex-wrap: wrap; }
  .match-info { width: 100%; }
}
@media (max-width: 560px) {
  .page { padding: 12px; }
  .topbar { padding: 10px 12px; }
  .match-thumb { width: 90px; height: 76px; }
  .craft-grid { grid-template-columns: 1fr; }
}

/* ไอคอนเส้น (js/icons.js) — ใช้แทนอีโมจิ */
.ic { display: inline-block; width: 1em; height: 1em; vertical-align: -.14em; flex: none; stroke-width: 2; }
.nav-item .ico { display: inline-grid; place-items: center; font-size: 16px; line-height: 1; }
.nav-item .ico .ic { width: 16px; height: 16px; stroke-width: 2.1; }
