/* ============================================================
   BANGSAEN42 LIVE — design tokens & base
   ============================================================ */
:root {
  --bg: #06080a;
  --bg-soft: #0a0e12;
  --panel: #0e1318;
  --panel-2: #121920;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f6f4;
  --muted: #8d9aa5;
  --muted-2: #64717c;
  --yellow: #f2e400;
  --yellow-soft: rgba(242, 228, 0, 0.14);
  --teal: #5ce1b9;
  --teal-soft: rgba(92, 225, 185, 0.12);
  --red: #ff5f5f;
  --red-soft: rgba(255, 95, 95, 0.12);
  --amber: #ffb340;
  --amber-soft: rgba(255, 179, 64, 0.13);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(242, 228, 0, 0.07), transparent 60%),
    radial-gradient(700px 500px at 90% 0%, rgba(92, 225, 185, 0.05), transparent 55%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(6, 8, 10, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--yellow);
  color: #090b0c;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.03em;
  box-shadow: 0 0 0 1px rgba(242, 228, 0, 0.25), 0 6px 18px -6px rgba(242, 228, 0, 0.5);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.brand-text b {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-text i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted-2);
  text-transform: uppercase;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.conn i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: background 0.3s, box-shadow 0.3s;
}

.conn.on i {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(92, 225, 185, 0.15);
}

.conn.off i {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 179, 64, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn.solid {
  background: var(--yellow);
  color: #0a0c0d;
  border-color: transparent;
}

.btn.solid:hover {
  background: #fff43a;
}

/* ------------------------------------------------------------ shell */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 16px 56px;
}

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008)), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
}

.card-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-body {
  padding: 14px 18px 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(6, 8, 10, 0.72);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
}

.pill.live .dot {
  animation: pulse-dot 1.8s ease-out infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(242, 228, 0, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(242, 228, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(242, 228, 0, 0);
  }
}

.muted {
  color: var(--muted);
}

/* ------------------------------------------------------------ misc */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: #f3f6f4;
  color: #0a0c0d;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 900;
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.7);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 560px) {
  .shell {
    padding: 12px 12px 48px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .brand-text i {
    display: none;
  }

  #shareLabel {
    display: none;
  }

  .btn {
    padding: 9px 11px;
  }
}
