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

:root {
  --primary: #1e3a8a;
  --primary-strong: #172554;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
}

body {
  height: 100vh;
  overflow: hidden;
  background: var(--primary-strong);
  color: var(--ink);
  font-family: 'Sarabun', 'Noto Sans Thai', system-ui, sans-serif;
}

.ad-slider { position: fixed; inset: 0; z-index: 0; }
.ad-slider .slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity .6s ease;
}
.ad-slider .slide.active { opacity: 1; }
.ad-slider .slide .slide-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-fallback { position: absolute; inset: 0; background: var(--primary-strong); }

.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(2, 6, 23, .34);
}

.topbar {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  width: min(1120px, calc(100% - 32px));
  min-height: 84px;
  gap: 14px;
  padding: 14px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(2, 6, 23, .22);
}

.tb-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.tb-text { min-width: 0; }
.tb-title {
  overflow: hidden;
  font-family: 'Bai Jamjuree', 'Noto Sans Thai', sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-sub {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-left: auto;
  padding: 12px 20px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: .9375rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease;
}
.tb-btn:hover { background: var(--primary-strong); }
.tb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(30, 58, 138, .3); }

.slide-controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}
.dot {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  place-items: center;
}
.dot::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
}
.dot.active::before { width: 28px; background: #fff; }
.dot:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (max-width: 600px) {
  .topbar {
    top: auto;
    bottom: max(24px, env(safe-area-inset-bottom));
    min-height: 0;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px;
  }
  .tb-logo { width: 46px; height: 46px; }
  .tb-text { width: calc(100% - 60px); }
  .tb-title { font-size: 1rem; white-space: normal; }
  .tb-sub { display: -webkit-box; margin-top: 4px; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .tb-btn { width: 100%; margin-left: 0; }
  .slide-controls { top: 8px; bottom: auto; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
