/* ==========================================================================
   RO MDSeed[PC Classic] — Prontera Daylight UI System
   Light, airy, modern Ragnarok Online Web Portal & GM Admin Backoffice
   ========================================================================== */

:root {
  /* Palette — Prontera Morning Sky */
  --bg: #f3f8fe;
  --bg-accent: #e8f2fd;
  --surface: #ffffff;
  --surface-soft: #f0f6fd;
  --surface-gold: #fffaf0;
  --surface-rose: #fff5f8;
  --surface-emerald: #effcf6;

  /* Ink & Contrast */
  --ink: #172540;
  --ink-secondary: #394d72;
  --muted: #5a6e91;
  --border: #d8e5f5;
  --border-strong: #bfd5f0;
  --border-gold: #ebd19a;

  /* Brand Accents */
  --primary: #2574e8;
  --primary-dark: #1a58ba;
  --primary-soft: #e7f1ff;

  --gold: #c98612;
  --gold-bright: #e09c1f;
  --gold-soft: #fef5e0;

  --cyan: #0b8ec9;
  --cyan-soft: #e5f6fe;

  --rose: #e04d76;
  --rose-soft: #fdebf1;

  --emerald: #139664;
  --emerald-soft: #e5f9f0;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(23, 37, 64, 0.05);
  --shadow-md: 0 10px 28px -8px rgba(23, 37, 64, 0.10), 0 2px 6px rgba(23, 37, 64, 0.04);
  --shadow-lg: 0 24px 56px -14px rgba(23, 37, 64, 0.18), 0 6px 16px rgba(23, 37, 64, 0.06);

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Z-index Scale */
  --z-nav: 30;
  --z-dock: 40;
  --z-backdrop: 60;
  --z-popover: 70;
  --z-modal: 80;
  --z-toast: 95;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% -5%, rgba(114, 182, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 45% at 88% 8%, rgba(255, 214, 130, 0.20), transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(244, 178, 202, 0.14), transparent 60%);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Kanit", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Kanit", "Noto Sans Thai", sans-serif;
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.28;
}

p {
  text-wrap: pretty;
}

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

img {
  max-width: 100%;
}

svg.lucide {
  width: 17px;
  height: 17px;
  stroke-width: 2;
  flex-shrink: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ─── Sticky Airy Navbar ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px max(20px, calc((100vw - 1240px) / 2));
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 14px rgba(23, 37, 64, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Kanit", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand img {
  height: 34px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(37, 116, 232, 0.18));
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1440px) {
  .brand-tag {
    display: none;
  }
}

.nav-links a,
.nav-pop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-links a svg,
.nav-pop-btn svg {
  width: 15px;
  height: 15px;
}

.nav-links a:hover,
.nav-pop-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid #bce8d6;
  background: var(--emerald-soft);
  color: #0e6f49;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.live-chip:hover {
  transform: translateY(-1px);
  border-color: var(--emerald);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.on {
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(19, 150, 100, 0.2);
}

.dot.off {
  background: var(--rose);
  box-shadow: 0 0 0 3px rgba(224, 77, 118, 0.2);
}

/* ─── Realm Announcement Bar ────────────────────────────────────────────── */
.realm-ticker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px max(20px, calc((100vw - 1240px) / 2));
  background: linear-gradient(90deg, #e7f2ff 0%, #f5f9ff 50%, #fff7e6 100%);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-secondary);
  font-weight: 500;
}

.ticker-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--primary-dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.ticker-action:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(37, 116, 232, 0.14);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn.lg {
  padding: 12px 20px;
  font-size: 14.5px;
  border-radius: 13px;
}

.btn.gold {
  background: linear-gradient(180deg, #f6c252 0%, #df991b 100%);
  border-color: #d08a10;
  color: #241600;
  font-weight: 700;
  box-shadow: 0 6px 18px -4px rgba(212, 148, 30, 0.42);
}

.btn.gold:hover:not(:disabled) {
  border-color: #b57308;
  box-shadow: 0 10px 22px -4px rgba(212, 148, 30, 0.52);
}

.btn.primary,
.btn.cyan {
  background: linear-gradient(180deg, #3b89f6 0%, #2068d8 100%);
  border-color: #1b5bc2;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 18px -4px rgba(37, 116, 232, 0.36);
}

.btn.primary:hover:not(:disabled),
.btn.cyan:hover:not(:disabled) {
  border-color: #164ca6;
  box-shadow: 0 10px 22px -4px rgba(37, 116, 232, 0.48);
}

.btn.ruby {
  background: linear-gradient(180deg, #f0658c 0%, #d83f6a 100%);
  border-color: #c7325c;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 16px -4px rgba(224, 77, 118, 0.34);
}

.btn.emerald {
  background: linear-gradient(180deg, #24b97f 0%, #12915f 100%);
  border-color: #0e7b50;
  color: #ffffff;
  font-weight: 700;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--border-strong);
  color: var(--primary-dark);
}

.btn.ghost:hover:not(:disabled) {
  background: var(--primary-soft);
}

.btn.fb {
  background: linear-gradient(180deg, #2578f4 0%, #1659c9 100%);
  border-color: #124bb0;
  color: #ffffff;
  font-weight: 700;
}

/* ─── Pills / Badges ────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  white-space: nowrap;
}

.pill.gold {
  background: var(--gold-soft);
  border-color: var(--border-gold);
  color: #8f5c04;
}

.pill.blue,
.pill.cyan {
  background: var(--primary-soft);
  border-color: #bdd6fb;
  color: var(--primary-dark);
}

.pill.green {
  background: var(--emerald-soft);
  border-color: #b4e9d3;
  color: #0d724b;
}

.pill.ruby {
  background: var(--rose-soft);
  border-color: #f6c2d2;
  color: #b52b54;
}

/* ─── Hero Section — Sunlit Prontera Showcase ───────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 36px max(20px, calc((100vw - 1240px) / 2)) 48px;
}

.hero-stage {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 250, 255, 0.86) 48%, rgba(240, 248, 255, 0.28) 100%),
    url("/images/portal-hero-prontera.jpg") center right / cover no-repeat;
  min-height: 490px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: center;
  padding: 44px 44px 36px;
}

#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(23, 37, 64, 0.14));
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-gold);
  color: #8f5c04;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 700;
  color: var(--ink);
}

.hero .lead {
  margin: 0 0 24px;
  font-size: 15.5px;
  color: var(--ink-secondary);
  line-height: 1.75;
  max-width: 58ch;
}

.hero .lead b {
  color: var(--ink);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

/* Right floating sunlit glass status widget in Hero */
.hero-aside {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: end;
}

.hero-glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: 0 16px 36px -12px rgba(23, 37, 64, 0.18);
}

.hero-glass-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.hero-glass-head h3 {
  margin: 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.stat-box[onclick] {
  cursor: pointer;
}

.stat-box[onclick]:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--surface);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.stat-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border);
}

.stat-box .val {
  font-family: "Kanit", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat-box .lbl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.hero-quick-pops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-quick-pops .btn {
  flex: 1;
  min-width: 120px;
}

/* ─── Main Container & Section Headers ──────────────────────────────────── */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.sec {
  margin-bottom: 52px;
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.sec-title-wrap {
  display: flex;
  align-items: center;
  gap: 13px;
}

.sec-ico {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border: 1px solid #c6defd;
  color: var(--primary);
  flex-shrink: 0;
}

.sec-ico.gold {
  background: var(--gold-soft);
  border-color: var(--border-gold);
  color: var(--gold);
}

.sec-ico.rose {
  background: var(--rose-soft);
  border-color: #f7c5d5;
  color: var(--rose);
}

.sec-ico.emerald {
  background: var(--emerald-soft);
  border-color: #b7ebd6;
  color: var(--emerald);
}

.sec-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
}

.sec-head p {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* ─── Cards & Grids ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

/* ─── Member Dashboard Banner ───────────────────────────────────────────── */
.member-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 26px;
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, #ffffff 0%, #eef6ff 60%, #fff9eb 100%);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}

.member-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}

.member-char-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.member-char-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ─── Feature Highlights Strip ──────────────────────────────────────────── */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 44px;
}

.feat-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.feat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.feat-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.feat-card:nth-child(2) .feat-ico { background: var(--gold-soft); color: var(--gold); }
.feat-card:nth-child(3) .feat-ico { background: var(--rose-soft); color: var(--rose); }
.feat-card:nth-child(4) .feat-ico { background: var(--emerald-soft); color: var(--emerald); }

.feat-card h4 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 700;
}

.feat-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ─── Server Info Cards ─────────────────────────────────────────────────── */
.info-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-secondary);
  font-size: 13.5px;
  line-height: 1.85;
}

.info-list li b {
  color: var(--ink);
}

.info-card-title {
  margin: 0 0 12px;
  font-size: 16.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.info-card-title svg {
  color: var(--primary);
}

.highlight-gold {
  color: var(--gold);
  font-weight: 700;
}

.highlight-blue {
  color: var(--primary);
  font-weight: 700;
}

/* ─── Art Feature Banners (Classes / Top-Up) ────────────────────────────── */
.art-banner {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  min-height: 220px;
  margin-bottom: 20px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: flex-end;
  background: var(--surface);
}

.art-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.art-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 249, 255, 0.82) 48%, rgba(255, 255, 255, 0.14) 100%);
}

.art-banner-content {
  position: relative;
  z-index: 2;
  padding: 28px 32px;
  max-width: 560px;
}

.art-banner-content h3 {
  margin: 10px 0 6px;
  font-size: clamp(20px, 2.3vw, 25px);
  color: var(--ink);
}

.art-banner-content p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

/* ─── News Cards ────────────────────────────────────────────────────────── */
.news-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.news-art {
  width: 100%;
  height: 175px;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.news-title {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--ink);
}

.news-preview {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

/* ─── Classic Classes Grid ──────────────────────────────────────────────── */
.class-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.class-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.class-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.class-ico {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(23, 37, 64, 0.08);
}

.class-card h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
}

.class-card p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.class-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
}

/* ─── Gallery ───────────────────────────────────────────────────────────── */
.gallery-item {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  aspect-ratio: 16 / 10;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, transparent, rgba(23, 37, 64, 0.78));
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

/* ─── Tabs & Tables ─────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 116, 232, 0.28);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

thead th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-soft);
  color: var(--ink-secondary);
  font-weight: 700;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

thead th:first-child { border-radius: 10px 0 0 10px; }
thead th:last-child { border-radius: 0 10px 10px 0; }

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf3fb;
  color: var(--ink);
  vertical-align: middle;
}

tbody tr:hover {
  background: #f8fbff;
}

.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
}

.rank-1 { background: #fef0c7; color: #9a6000; border: 1px solid #f4c95d; }
.rank-2 { background: #eef3f9; color: #475569; border: 1px solid #cbd5e1; }
.rank-3 { background: #fdebd8; color: #9a4a12; border: 1px solid #ebb586; }

/* ─── Top-Up Package Cards ──────────────────────────────────────────────── */
.pkg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 14px;
  border-radius: var(--r-lg);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.pkg-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.pkg-card.selected {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #fffdf7 0%, #fff6e0 100%);
  box-shadow: 0 12px 26px -8px rgba(212, 148, 30, 0.32);
}

.package-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 10px;
}

.pkg-card.selected .package-icon {
  background: var(--gold-soft);
  color: var(--gold);
}

.pkg-card .price {
  font-family: "Kanit", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.pkg-card .cash {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.qr-frame {
  display: inline-block;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 2px solid var(--border-gold);
  box-shadow: var(--shadow-md);
}

/* ─── Forms & Inputs ────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 116, 232, 0.14);
}

.field input[readonly] {
  background: var(--surface-soft);
  color: var(--ink-secondary);
  font-weight: 600;
}

/* ─── Centered Popovers & Modals ────────────────────────────────────────── */
.popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(23, 37, 64, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
}

.popover-backdrop.open {
  display: block;
}

.popover-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-popover);
  width: 480px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 32px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--primary);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.18s ease-out;
}

.popover-card.open {
  display: flex;
}

.popover-card.gold-top {
  border-top-color: var(--gold-bright);
}

.popover-card.rose-top {
  border-top-color: var(--rose);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.pop-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.pop-head h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.pop-head h3 svg {
  color: var(--primary);
}

.pop-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pop-close:hover {
  background: var(--rose-soft);
  border-color: #f4b7ca;
  color: var(--rose);
}

.pop-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.pop-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.svc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 13px;
}

.kbd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kbd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.kbd-item kbd {
  min-width: 48px;
  text-align: center;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-dark);
}

.stat-bar-row {
  margin-bottom: 10px;
}

.stat-bar-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 4px;
  color: var(--ink-secondary);
}

.stat-bar-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary), #54a8ff);
}

/* ─── Modal (Auth / Lightbox) ───────────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(23, 37, 64, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-bg.hidden {
  display: none;
}

.modal-card {
  width: 430px;
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-top: 3px solid var(--gold-bright);
  border-radius: var(--r-xl);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.auth-tab {
  padding: 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.lightbox-img {
  max-width: 90vw;
  max-height: 76dvh;
  border-radius: var(--r-lg);
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-lg);
}

/* ─── Floating Quick Dock ───────────────────────────────────────────────── */
.float-dock {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.float-btn:not(.gold) span {
  display: none;
}

.float-btn:hover {
  transform: translateY(-1px);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.float-btn.gold {
  padding: 7px 13px;
  background: linear-gradient(180deg, #f6c252 0%, #df991b 100%);
  color: #241600;
}

/* ─── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  top: 76px;
  z-index: var(--z-toast);
  padding: 12px 18px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-left: 4px solid var(--gold-bright);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.18s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer {
  margin-top: 40px;
  padding: 28px 20px 88px;
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--primary);
  font-weight: 700;
}

.footer a:hover {
  text-decoration: underline;
}

/* ─── Admin Backoffice Specific Styles ──────────────────────────────────── */
.admin-hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  margin: 24px 0 22px;
  padding: 28px 32px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 249, 255, 0.86) 54%, rgba(255, 255, 255, 0.25) 100%),
    url("/images/admin-gm-banner.jpg") center right / cover no-repeat;
}

.admin-hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-hero h1 {
  margin: 4px 0 4px;
  font-size: clamp(22px, 3vw, 30px);
}

.admin-hero p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.kpi-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.kpi-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-sm);
}

.kpi-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-ico.gold { background: var(--gold-soft); color: var(--gold); }
.kpi-ico.blue { background: var(--primary-soft); color: var(--primary); }
.kpi-ico.rose { background: var(--rose-soft); color: var(--rose); }
.kpi-ico.emerald { background: var(--emerald-soft); color: var(--emerald); }

.kpi-val {
  font-family: "Kanit", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.admin-nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.admin-news-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.preset-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip-btn {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.chip-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.search-box {
  position: relative;
  min-width: 220px;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.search-box input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-stage {
    grid-template-columns: 1fr;
    padding: 32px 26px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(244, 249, 255, 0.88) 70%, rgba(244, 249, 255, 0.72) 100%),
      url("/images/portal-hero-prontera.jpg") center / cover no-repeat;
  }
  .feature-strip,
  .grid-4,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }
  .realm-ticker {
    flex-wrap: wrap;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5,
  .feature-strip,
  .kpi-grid,
  .kbd-grid {
    grid-template-columns: 1fr;
  }
  .float-dock span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
