.password-change-card { width: min(100%, 500px); }
/* ============================================
   สมบัติสี่จักรพรรดิ — Stylesheet (ปรับธีมสีทองหรูหรา + มือถือ)
   ============================================ */

:root {
  --color-primary: #d7b56d;
  --color-primary-dark: #a98236;
  --color-success: #2fbf8f;
  --color-danger: #e56a6f;
  --color-warning: #f3b63f;
  --color-bg: radial-gradient(circle at 20% 0%, rgba(215,181,109,.12), transparent 25%), radial-gradient(circle at 90% 15%, rgba(113,78,38,.18), transparent 28%), linear-gradient(145deg, #08090e 0%, #11121b 52%, #1b1713 100%);
  --color-surface: rgba(20, 20, 25, .94);
  --color-border: rgba(255,255,255,.08);
  --color-text: #f8fbff;
  --color-text-muted: #a8b8cf;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 36px rgba(0, 0, 0, .24);
  --shadow-lg: 0 26px 62px rgba(0, 0, 0, .36);
  --glow-gold: 0 0 18px rgba(243, 182, 63, .28);
  --glow-blue: 0 0 18px rgba(96, 165, 250, .2);
  --glow-green: 0 0 18px rgba(47, 191, 143, .2);
}

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

body.app-body {
  font-family: 'Prompt', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.app-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 82% 0%, rgba(255, 216, 118, .09), transparent 28%), radial-gradient(circle at 0% 100%, rgba(87, 112, 255, .08), transparent 30%), radial-gradient(circle at 60% 55%, rgba(125,31,50,.08), transparent 32%);
  z-index: -1;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 720px; }
.site-main { flex: 1; }

/* ---------- HEADER ---------- */
.site-header {
  background: linear-gradient(90deg, rgba(10,17,31,.96), rgba(35,14,27,.94), rgba(10,17,31,.96));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(243, 182, 63, .35);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 74px; }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--color-text); }
.brand-mark {
  width: 64px; height: 64px; border-radius: 0;
  background: transparent;
  color: #1d1506;
  display: grid; place-items: center; font-weight: 800;
  box-shadow: none;
  position: relative;
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: rgba(243, 182, 63, .22);
  filter: blur(12px);
  z-index: 0;
}
.brand-mark-premium { transform: none; }
.brand-logo { width: 64px; height: 64px; object-fit: contain; display: block; position: relative; z-index: 1; }
.brand-lockup { display: flex; flex-direction: column; justify-content: center; line-height: 1; gap: 5px; transform: translateY(1px); }
.brand-text { font-size: 18px; font-weight: 800; color: #f7d477; letter-spacing: .01em; background: linear-gradient(180deg, #fff2b0 0%, #f7d477 42%, #b8791d 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 1px 1px rgba(0,0,0,.7)) drop-shadow(0 0 8px rgba(243,182,63,.22)); }
.brand-text strong { color: #ffd978; text-shadow: 0 0 16px rgba(255,217,120,.35); }
.brand-text-premium { font-size: 19px; }
.brand-text-premium { text-shadow: 0 0 16px rgba(255, 217, 120, .24); }
.brand-subtitle { color: #d9b85f; font-size: 9px; letter-spacing: .2em; font-weight: 700; text-shadow: 0 1px 5px rgba(243,182,63,.25); }
.lottery-keypad-grid .keypad-num.is-pressed {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
  transform: translateY(2px) scale(.96);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .18), 0 2px 0 #1e40af;
}

.main-nav { display: flex; flex: 1 1 auto; min-width: 0; justify-content: center; gap: 3px; margin-left: 4px; }
.nav-link {
  padding: 8px 9px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--color-text-muted);
  font-size: 14px; transition: .2s; white-space: nowrap;
}
.nav-link:hover { background: rgba(212, 175, 55, 0.1); color: var(--color-primary); }
.nav-link:hover i { text-shadow: 0 0 10px rgba(243, 182, 63, .7); }
.nav-link-admin { color: #f87171; font-weight: 500; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; color: var(--color-text-muted); }

.points-chip {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 4px 14px; border-radius: 999px;
  background: linear-gradient(135deg, #d4af37, #aa820a); color: #121218;
  font-weight: bold;
}
.points-chip-label { font-size: 10px; opacity: .85; line-height: 1.2; }
.points-chip-value { font-size: 15px; font-weight: 700; line-height: 1.2; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: .2s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, #ead39d, #a98236); color: #17130c; font-weight: bold; box-shadow: 0 6px 18px rgba(215, 181, 109, .18); }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.025); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-success { background: var(--color-success); color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-disabled { background: #2a2a3c; color: #6b7280; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- FLASH ---------- */
.flash-area { padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, rgba(33,39,61,.94), rgba(28,10,24,.96)), radial-gradient(circle at 78% 20%, rgba(243,182,63,.3), transparent 42%);
  color: #fff; padding: 64px 0; border-bottom: 3px solid var(--color-primary);
  position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.hero::after { content: "✦  ✧  ✦"; position: absolute; right: 7%; bottom: 18px; color: rgba(243, 182, 63, .26); font-size: 30px; letter-spacing: 18px; transform: rotate(-8deg); }
.hero::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 223, 128, .16), transparent 62%);
  filter: blur(20px);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}
.hero-text { max-width: 560px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--color-primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.hero-title { font-size: 40px; font-weight: 600; line-height: 1.3; margin-bottom: 12px; color: #fff; text-shadow: 0 0 24px rgba(255,255,255,.08); }
.hero-title::first-line { color: #f7d477; }
.hero-subtitle { font-size: 17px; opacity: .9; margin-bottom: 24px; color: var(--color-text-muted); }
.home-hero-fallback { margin: 0; border-radius: 0; }
.home-hero-fallback .hero-inner { padding: 40px 20px; }

/* ---------- SECTION ---------- */
.catalog-section, .page-section, .admin-section { padding: 40px 0 64px; }
.section-head, .page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.section-head-text { display: flex; flex-direction: column; gap: 4px; }
.section-title, .page-title { font-size: 24px; font-weight: 600; color: #fff; text-shadow: 0 0 18px rgba(255,255,255,.08); }
.section-title i, .page-title i, .panel-title i { color: var(--color-primary); margin-right: 6px; }
.section-desc { color: var(--color-text-muted); margin: 0; line-height: 1.55; }

/* ---------- SEARCH INPUT ---------- */
.search-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input {
  width: min(320px, 100%);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
}
.search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14); }

/* ---------- REWARD GRID ---------- */
.reward-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.reward-card {
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; transition: .25s;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
}
.reward-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--color-primary); }
.reward-card { background: linear-gradient(180deg, #14243a 0%, #101b2d 100%); }
.reward-thumb { position: relative; height: 200px; background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(255,255,255,0.02)); }
.reward-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.reward-image-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--color-text-muted); background: rgba(255,255,255,0.02); }
.reward-tag {
  position: absolute; right: 12px; top: 12px;
  font-size: 12px; font-weight: 700; border-radius: 999px; padding: 6px 10px; 
  backdrop-filter: blur(4px);
}
.reward-tag-low { background: rgba(255, 193, 7, 0.15); color: #f7d76a; border: 1px solid rgba(255, 193, 7, 0.25); }
.reward-tag-out { background: rgba(220, 38, 38, 0.14); color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.2); }
.reward-body { padding: 18px 16px 8px; flex: 1; }
.reward-name {
  font-size: 20px; color: #fff; margin-bottom: 10px; min-height: 52px;
}
.reward-desc { color: var(--color-text-muted); font-size: 14px; min-height: 46px; }
.reward-footer {
  padding: 0 16px 18px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.reward-price { display: flex; align-items: baseline; gap: 6px; }
.reward-price-value { font-size: 28px; font-weight: 700; color: var(--color-primary); }
.reward-price-unit { color: var(--color-text-muted); font-size: 12px; text-transform: lowercase; }
.empty-state {
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 28px 16px; text-align: center;
}
.empty-state-text { color: var(--color-text-muted); margin: 0; }

/* ---------- AUTH ---------- */
.auth-section {
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.auth-card {
  width: min(460px, 100%);
  background: rgba(30,30,40,0.95);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.auth-head { margin-bottom: 16px; }
.auth-title { font-size: 28px; margin: 0; }
.auth-subtitle { color: var(--color-text-muted); margin-top: 5px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { color: #f5f7fb; font-weight: 600; line-height: 1.35; }
.form-required { color: #fca5a5; }
.form-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(168,184,207,.3);
  background: #17233a;
  color: var(--color-text);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit; line-height: 1.35;
}
.form-input::placeholder { color: #91a2bb; opacity: 1; }
.form-input option { background: #17233a; color: #f8fbff; }
select.form-input { color-scheme: dark; cursor: pointer; }
.form-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12); }
.password-input-wrap { position: relative; }
.password-input { padding-right: 42px; }
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
}
.password-toggle:hover { color: var(--color-primary); }
.form-hint { color: var(--color-text-muted); font-size: 12px; }
.auth-foot { margin-top: 12px; text-align: center; }
.auth-foot-text { color: var(--color-text-muted); margin: 0; }
.auth-link { color: var(--color-primary); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ---------- FORM & PANEL ---------- */
.panel {
  background: linear-gradient(180deg, rgba(23,35,58,.94), rgba(15,24,41,.96));
  border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 22px;
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.panel:hover { border-color: rgba(243,182,63,.22); box-shadow: var(--shadow), var(--glow-gold); }
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.04), transparent 45%);
}
.panel-title { font-size: 20px; line-height: 1.35; margin-bottom: 16px; color: #fff; text-shadow: 0 0 14px rgba(255,255,255,.1); }
.admin-collapsible-panel { padding: 16px; }
.admin-collapsible-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.admin-collapsible-summary::-webkit-details-marker { display: none; }
.admin-collapsible-summary .panel-title { margin: 0; }
.admin-collapsible-summary > span { display: inline-flex; align-items: center; gap: 7px; color: var(--color-primary); font-size: 12px; white-space: nowrap; }
.admin-collapsible-summary > span i { transition: transform .2s ease; }
.admin-collapsible-panel[open] .admin-collapsible-summary { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.admin-collapsible-panel[open] .admin-collapsible-summary > span i { transform: rotate(180deg); }
.table-wrap { overflow-x: auto; width: 100%; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; color: var(--color-text); }
.data-table th {
  text-align: left; padding: 10px 12px; background: #252536;
  font-weight: 500; color: var(--color-primary); white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.code-chip {
  background: rgba(212, 175, 55, 0.07);
  color: var(--color-primary);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 4px 8px;
  display: inline-block;
}
.points-summary {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(168,130,9,0.1));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px; padding: 10px 16px;
}
.points-summary-label { font-size: 12px; color: var(--color-text-muted); }
.points-summary-value { font-size: 28px; font-weight: 700; color: var(--color-primary); }
.text-positive { color: #86efac; }

.credit-chip { background: rgba(47, 191, 143, .14); border: 1px solid rgba(47, 191, 143, .35); color: #a9f0d5; }
.vip-mini-badge { padding: 6px 9px; border-radius: 999px; background: rgba(243, 182, 63, .12); border: 1px solid rgba(243, 182, 63, .3); color: #f7d477; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.nav-toggle { display: none; }

@media (max-width: 1440px) and (min-width: 921px) {
  .header-inner { height: auto; min-height: 74px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 6px 12px; }
  .brand { order: 1; flex-shrink: 0; }
  .brand-text-premium { font-size: 17px; }
  .brand-subtitle { font-size: 8px; letter-spacing: .16em; }
  .header-actions { order: 2; gap: 8px; flex-shrink: 0; }
  .points-chip { padding-left: 10px; padding-right: 10px; }
  .user-name { font-size: 13px; }
  .header-actions .btn-sm { padding-left: 10px; padding-right: 10px; font-size: 13px; }
  .main-nav { order: 3; flex-basis: 100%; width: 100%; margin: 2px 0 0; padding-top: 6px; border-top: 1px solid var(--color-border); gap: 2px; }
  .nav-link { padding: 6px 8px; font-size: 13px; }
}

@media (max-width: 920px) {
  .header-inner { height: auto; min-height: 68px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 12px; }
  .nav-toggle {
    display: inline-grid; place-items: center; margin-left: auto; width: 42px; height: 42px;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface);
    color: var(--color-text); font-size: 18px;
  }
  .main-nav { order: 4; display: none; width: 100%; margin: 0; padding-top: 10px; border-top: 1px solid var(--color-border); flex-direction: column; }
  .main-nav.is-open { display: flex; }
  .nav-link { padding: 11px 12px; }
  .header-actions { margin-left: 0; order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .user-name { margin-left: auto; }
  .hero-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .brand-text { font-size: 16px; }
  .points-chip { padding: 5px 10px; }
  .points-chip-value { font-size: 13px; }
  .user-name { display: none; }
  .page-section, .admin-section, .catalog-section { padding-top: 24px; padding-bottom: 40px; }
  .page-head, .section-head { align-items: stretch; gap: 14px; }
  .page-title, .section-title { font-size: 22px; }
  .points-summary { align-items: flex-start; width: 100%; }
  .points-summary-value { font-size: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .panel { padding: 16px; border-radius: 13px; }
  .table-wrap { margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); }
  .data-table { min-width: 580px; }
  .btn { min-height: 42px; }
  .btn-sm, .btn-xs { min-height: 36px; }
  .auth-card { padding: 16px 14px; }
  .admin-member-search { display: block; margin-bottom: 10px; }
  .admin-member-search-row { gap: 5px; }
  .admin-member-search-row .form-input { max-width: none; min-width: 0; }
  .admin-member-search-row .btn { min-height: 34px; padding: 6px 8px; }
  .member-table-wrap { margin-left: -12px; margin-right: -12px; width: calc(100% + 24px); }
  .member-table-wrap .data-table { min-width: 560px; font-size: 10px; }
  .member-table-wrap .data-table th,
  .member-table-wrap .data-table td { padding: 5px; }
  .member-table-wrap .admin-credit-column { min-width: 150px; }
  .member-table-wrap .admin-credit-form { gap: 5px; padding: 6px; border-radius: 8px; }
  .member-table-wrap .admin-credit-label { font-size: 9px; }
  .member-table-wrap .admin-credit-actions { gap: 4px; }
  .member-table-wrap .admin-credit-btn { min-height: 28px; padding: 4px 6px; font-size: 10px; border-radius: 7px; }
  .member-table-wrap .admin-credit-btn i { font-size: 9px; }
}
.text-negative { color: #fca5a5; }
.status {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: capitalize;
}
.status-pending { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-completed, .status-win { background: rgba(34, 197, 94, 0.12); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.18); }
.status-cancelled, .status-lose { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.18); }

/* ---------- DASHBOARD ---------- */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px;
}
.dashboard-card {
  background: var(--color-surface); border-radius: 16px; padding: 20px; border: 1px solid var(--color-border);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.dashboard-card:hover { transform: translateY(-3px); border-color: rgba(243,182,63,.28); box-shadow: var(--shadow), var(--glow-gold); }
.dashboard-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--color-primary);
}
.dashboard-card.accent-gold::before { background: #f5c95b; }
.dashboard-card.accent-green::before { background: #4ade80; }
.dashboard-card.accent-blue::before { background: #60a5fa; }
.dashboard-card.accent-red::before { background: #f87171; }
.dashboard-card strong {
  display: block; font-size: clamp(1.6rem, 2vw, 2.2rem); color: #fff; margin-top: 10px; text-shadow: 0 0 16px rgba(255,255,255,.13);
}
.lottery-result-card { min-height: 250px; }
.lottery-result-heading { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.lottery-result-heading .dashboard-label { min-width: 0; overflow-wrap: anywhere; }
.lottery-result-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid rgba(243,182,63,.45); border-radius: 10px; color: #172337; background: linear-gradient(145deg, #f3c969, #b8791d); }
.lottery-result-icon img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.lottery-result-icon i { font-size: 20px; }
.dashboard-label {
  color: var(--color-text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
}
.partner-dashboard-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.partner-sidebar { position: sticky; top: 92px; padding: 14px; border: 1px solid rgba(243,182,63,.24); border-radius: 16px; background: linear-gradient(180deg, rgba(23,35,58,.98), rgba(12,22,39,.98)); box-shadow: var(--shadow); }
.partner-profile-card { display: flex; align-items: center; gap: 10px; padding: 10px 8px 14px; border-bottom: 1px solid var(--color-border); }
.partner-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #172337; background: linear-gradient(135deg, #f3c969, #c88927); box-shadow: 0 6px 16px rgba(243,182,63,.2); }
.partner-profile-card strong, .partner-profile-card small { display: block; }
.partner-profile-card strong { color: #fff; font-size: 13px; overflow-wrap: anywhere; }
.partner-profile-card small { margin-top: 2px; color: var(--color-text-muted); font-size: 10px; letter-spacing: .08em; }
.partner-sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; }
.partner-sidebar-nav a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; color: var(--color-text-muted); font-size: 12px; text-decoration: none; transition: .2s ease; }
.partner-sidebar-nav a:hover, .partner-sidebar-nav a.is-active { color: #fff; background: rgba(243,182,63,.12); }
.partner-sidebar-nav a.is-active { border-left: 2px solid var(--color-primary); }
.partner-sidebar-nav i { width: 16px; color: var(--color-primary); text-align: center; }
.partner-sidebar-nav span { margin-left: auto; color: var(--color-primary); font-size: 11px; }
.partner-subnav { display: grid; gap: 2px; margin: -2px 0 6px 25px; padding-left: 8px; border-left: 1px solid rgba(243,182,63,.25); }
.partner-subnav a { padding: 5px 6px; color: var(--color-text-muted); font-size: 10px; text-decoration: none; }
.partner-subnav a:hover { color: #fff; background: rgba(243,182,63,.1); }
.partner-invite-card { padding: 10px; border: 1px solid rgba(47,191,143,.28); border-radius: 10px; background: rgba(47,191,143,.08); }
.partner-invite-card small, .partner-invite-card code { display: block; }
.partner-invite-card small { color: var(--color-text-muted); font-size: 10px; }
.partner-invite-card code { margin-top: 4px; color: #a9f0d5; font-size: 14px; letter-spacing: .08em; }
.partner-dashboard-main { min-width: 0; }
.partner-dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.partner-dashboard-head .page-title { margin-bottom: 4px; }
.partner-balance { min-width: 170px; padding: 10px 14px; border: 1px solid rgba(47,191,143,.3); border-radius: 12px; background: linear-gradient(135deg, rgba(47,191,143,.16), rgba(15,35,42,.65)); text-align: right; }
.partner-balance span, .partner-balance strong { display: block; }
.partner-balance span { color: var(--color-text-muted); font-size: 11px; }
.partner-balance strong { margin-top: 3px; color: #a9f0d5; font-size: 22px; }
.partner-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.partner-stat-card { position: relative; overflow: hidden; padding: 14px; border: 1px solid var(--color-border); border-radius: 12px; background: rgba(23,35,58,.82); box-shadow: var(--shadow); }
.partner-stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--color-primary); }
.partner-stat-card.accent-gold::before { background: #f5c95b; }
.partner-stat-card.accent-green::before { background: #4ade80; }
.partner-stat-card.accent-blue::before { background: #60a5fa; }
.partner-stat-card.accent-red::before { background: #f87171; }
.partner-stat-card span, .partner-stat-card small { display: block; color: var(--color-text-muted); font-size: 11px; }
.partner-stat-card strong { display: block; margin: 5px 0 2px; color: #fff; font-size: 21px; overflow-wrap: anywhere; }
.partner-stat-card small { font-size: 10px; }
.partner-content-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr); gap: 16px; margin-bottom: 16px; }
.partner-content-grid .panel, .partner-members-panel { margin-bottom: 0; }
.partner-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.partner-panel-heading .panel-title { margin-bottom: 4px; }
.partner-panel-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #172337; background: linear-gradient(135deg, #f3c969, #c88927); }
.partner-muted-icon { padding-top: 8px; color: var(--color-primary); }
.partner-topup-panel { border-color: rgba(47,191,143,.3); }
.partner-topup-form { display: grid; gap: 11px; margin-top: 14px; }
.partner-member-select { min-height: 46px; font-weight: 500; }
.partner-form-row { display: grid; grid-template-columns: .8fr 1.2fr; gap: 11px; }
.partner-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; padding: 12px; border: 1px solid rgba(148, 163, 184, .16); border-radius: 9px; background: rgba(15, 23, 42, .28); }
.partner-filter-grid .btn { min-height: 42px; }
.partner-topup-form .btn { min-height: 42px; }
.partner-count-chip { padding: 5px 9px; border: 1px solid rgba(243,182,63,.3); border-radius: 999px; color: #f7d477; background: rgba(243,182,63,.1); font-size: 11px; }
.partner-members-panel .table-wrap { overflow-x: auto; }
.partner-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.partner-setting-row:last-child { border-bottom: 0; }
.partner-setting-row strong, .partner-setting-row small { display: block; }
.partner-setting-row strong { color: #fff; }
.partner-setting-row small { margin-top: 3px; color: var(--color-text-muted); font-size: 11px; }
.partner-toggle { display: inline-flex; align-items: center; gap: 7px; color: #a9f0d5; font-size: 12px; white-space: nowrap; cursor: pointer; }
.partner-toggle input { width: 17px; height: 17px; accent-color: var(--color-success); }
.partner-rate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.partner-rate-grid > div { padding: 10px; border: 1px solid var(--color-border); border-radius: 9px; background: rgba(255,255,255,.025); }
.partner-rate-grid span, .partner-rate-grid strong { display: block; }
.partner-rate-grid span { color: var(--color-text-muted); font-size: 11px; }
.partner-rate-grid strong { margin-top: 3px; color: #f7d477; font-size: 16px; }
.partner-inline-rate-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; margin: 12px 0; }
.admin-banner-page { padding-top: 28px; padding-bottom: 44px; }
.admin-banner-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.admin-banner-head .page-title { margin: 0; font-size: 24px; }
.admin-banner-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-banner-form { padding: 18px; margin-bottom: 24px; border: 1px solid var(--color-border); border-radius: 12px; background: linear-gradient(180deg, rgba(23,35,58,.94), rgba(15,24,41,.96)); }
.admin-banner-form .form-control { min-height: 42px; background: #17233a; border-color: rgba(168,184,207,.3); color: #f8fbff; }
.admin-banner-form .form-control::file-selector-button { background: #d7b56d; border: 0; color: #17130c; }
.admin-banner-table-wrap { overflow-x: auto; }
.admin-banner-table { min-width: 560px; margin-bottom: 0; }
.admin-banner-table img { width: 100px; height: 50px; object-fit: cover; border-radius: 6px; }

@media (max-width: 640px) {
  .admin-banner-page { padding: 18px 12px 30px; }
  .admin-banner-head { align-items: flex-start; display: block; margin-bottom: 12px; }
  .admin-banner-head .page-title { font-size: 19px; line-height: 1.3; }
  .admin-banner-actions { justify-content: flex-start; margin-top: 10px; }
  .admin-banner-actions .btn { min-height: 34px; padding: 6px 9px; font-size: 11px; }
  .admin-banner-form { padding: 12px; margin-bottom: 16px; border-radius: 10px; }
  .admin-banner-form .row { --bs-gutter-y: .65rem; }
  .admin-banner-form .form-label { font-size: 12px; }
  .admin-banner-form .form-control { min-height: 38px; font-size: 14px; }
  .admin-banner-form .btn { min-height: 38px; padding: 7px 12px; }
  .admin-banner-table { min-width: 520px; font-size: 12px; }
  .admin-banner-table th, .admin-banner-table td { padding: 7px 6px; }
  .admin-banner-table img { width: 76px; height: 40px; }
}
.dashboard-layout {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; margin-bottom: 24px;
}
.room-list, .activity-list, .mini-list { display: flex; flex-direction: column; gap: 12px; }
.room-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--color-border); text-decoration: none; color: inherit;
  transition: 0.2s ease;
}
.room-item:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.room-item-icon {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; overflow: hidden;
  background: rgba(212, 175, 55, 0.12); color: var(--color-primary); border: 1px solid rgba(212, 175, 55, 0.2);
}
.room-item-icon img { width: 100%; height: 100%; object-fit: cover; }
.room-item-meta { flex: 1; display: flex; flex-direction: column; }
.room-item-meta strong { font-size: 16px; }
.room-item-meta span { color: var(--color-text-muted); font-size: 13px; }
.room-item-action {
  background: rgba(212, 175, 55, 0.12); color: var(--color-primary); border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700;
}
.activity-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--color-border);
}
.activity-item strong { display: block; color: #fff; font-size: 14px; }
.activity-item small { color: var(--color-text-muted); }
.activity-tag {
  min-width: 76px; text-align: center; padding: 6px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.activity-tag.plus { background: rgba(34, 197, 94, 0.12); color: #86efac; }
.activity-tag.minus { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.mini-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-border);
}
.mini-row:last-child { border-bottom: none; }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 10px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.footer-text { margin: 0; font-size: 11px; line-height: 1.25; color: var(--color-text-muted); }

.lottery-full-btn {
  background: linear-gradient(115deg, #c88927, #f3c969 48%, #c88927) !important;
  color: #172337 !important;
  border: 1px solid rgba(255, 220, 126, .65);
  letter-spacing: .02em;
}
.lottery-full-btn:hover { box-shadow: 0 10px 28px rgba(243, 182, 63, .24) !important; }
.lottery-action-row { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px; align-items: stretch; margin-bottom: 1.5rem; }
.wallet-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 12px 18px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.2); transition: transform .2s, box-shadow .2s; }
.wallet-action:hover { color: #fff; transform: translateY(-2px); }
.wallet-action-deposit { background: linear-gradient(135deg, #159a68, #2fbf8f); box-shadow: 0 8px 22px rgba(47,191,143,.24); }
.wallet-action-withdraw { background: linear-gradient(135deg, #b94250, #e56a6f); box-shadow: 0 8px 22px rgba(229,106,111,.24); }
.wallet-action i { font-size: 1.15rem; }
.wallet-deposit-panel { border-color: rgba(47,191,143,.28); }
.wallet-withdraw-panel { border-color: rgba(229,106,111,.28); }
.deposit-bank-card { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; padding: 16px; border: 1px solid color-mix(in srgb, var(--deposit-bank-color, #2fbf8f) 70%, white); border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--deposit-bank-color, #2fbf8f) 20%, transparent), rgba(10,28,38,.7)); color: #d8ffef; }
.deposit-page-container { max-width: 920px; }
.deposit-page .page-head { margin-bottom: 16px; }
.deposit-page .panel { margin-bottom: 14px; }
.deposit-bank-label { color: color-mix(in srgb, var(--deposit-bank-color, #2fbf8f) 75%, white); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.deposit-bank-card strong { color: #fff; font-size: 1.1rem; }
.deposit-bank-card > span:last-child { color: #b7d6c8; font-size: .85rem; }
.deposit-account-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.deposit-account-row code { color: #fff1b5; font-size: 1.35rem; letter-spacing: .08em; text-shadow: 0 0 12px rgba(243,182,63,.45); }
.hero-slider { border: 1px solid rgba(243, 182, 63, .3); }
.hero-slider::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(8, 18, 32, .48), transparent 65%); }
.voyage-strip { border-top: 1px solid rgba(243, 182, 63, .18); border-bottom: 1px solid var(--color-border); background: #0e192a; }
.voyage-strip-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.voyage-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.voyage-item > i { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; color: var(--color-primary); background: rgba(243, 182, 63, .1); border: 1px solid rgba(243, 182, 63, .22); border-radius: 8px; font-size: 12px; }
.voyage-item span { display: flex; flex-direction: column; min-width: 0; }
.voyage-item strong { color: #f5f7fb; font-size: 11px; font-weight: 500; }
.voyage-item small { color: var(--color-text-muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-subtitle { color: var(--color-text-muted); margin: 6px 0 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card:hover { border-color: rgba(243,182,63,.3); box-shadow: var(--shadow), var(--glow-gold); }
.stat-label { display: block; color: var(--color-text-muted); font-size: 13px; }
.stat-value { display: block; color: var(--color-primary); font-size: 30px; font-weight: 700; margin-top: 6px; }
.stat-card-alert { border-color: rgba(229, 106, 111, .45); }
.stat-card-alert .stat-value { color: #f49a9d; }
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.admin-form .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-section { font-size: 13px; }
.admin-section > .container > .page-head { align-items: flex-start !important; margin-bottom: 16px; }
.admin-section > .container > .page-head > div:first-child { padding-top: 4px; }
.admin-section .page-title { font-size: 22px; }
.admin-section .page-subtitle { font-size: 13px; }
.admin-section .panel { padding: 16px; margin-bottom: 16px; }
.admin-section .panel-title { font-size: 17px; margin-bottom: 12px; }
.admin-section .btn { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.admin-section .form-label { font-size: 12px; }
.admin-section .form-input { padding: 7px 9px; font-size: 12px; border-radius: 8px; }
.admin-section .admin-form { gap: 11px; }
.admin-section .admin-form .form-row { gap: 11px; }
.admin-section .data-table { font-size: 12px; }
.admin-section .data-table th { padding: 7px 8px; }
.admin-section .data-table td { padding: 8px; }
.admin-section .stat-card { padding: 13px; }
.admin-section .stat-label { font-size: 11px; }
.admin-section .stat-value { font-size: 24px; margin-top: 3px; }
.admin-quick-actions { min-width: min(100%, 310px); }
.admin-quick-actions summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  justify-content: space-between; padding: 10px 14px; border: 1px solid rgba(243,182,63,.35);
  border-radius: 10px; color: #f7d477; background: rgba(243,182,63,.08); font-weight: 600;
}
.admin-quick-actions summary::-webkit-details-marker { display: none; }
.admin-quick-actions summary::after { content: "⌄"; font-size: 18px; transition: transform .2s ease; }
.admin-quick-actions[open] summary::after { transform: rotate(180deg); }
.admin-quick-actions summary span { margin-left: auto; color: var(--color-text-muted); font-size: 12px; font-weight: 400; }
.admin-quick-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.admin-quick-actions-grid .btn { padding: 8px 10px; font-size: 12px; justify-content: flex-start; }
.blocked-page-head { align-items: flex-end; }
.blocked-numbers-page .eyebrow { color: var(--color-primary); }
.blocked-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; height: 100%; }
.blocked-panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; background: var(--color-surface-soft); border-bottom: 1px solid var(--color-border); color: var(--color-text); font-weight: 600; }
.blocked-panel-head i { color: var(--color-primary); }
.blocked-panel-body { padding: 20px; }
.blocked-panel .form-label { color: var(--color-text); }
.blocked-panel .text-muted { color: var(--color-text-muted) !important; }
.blocked-table-wrap { overflow-x: auto; }
.blocked-table { min-width: 520px; }
.blocked-type-badge { display: inline-block; background: rgba(243, 182, 63, .12); border: 1px solid rgba(243, 182, 63, .3); color: #f8d98a; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.blocked-number { color: #f49a9d; font-size: 1.15rem; letter-spacing: .08em; }
.blocked-rate { color: var(--color-primary); }
.room-admin-header { background: linear-gradient(110deg, #1a2b43, #263c57); color: #f7d477; border-bottom: 1px solid rgba(243, 182, 63, .3); }
.nav-link-partner { color: #a9f0d5; }
.nav-link-contact { color: #a9f0d5; }
.contact-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 14px 16px; border: 1px solid rgba(47,191,143,.35); border-radius: 12px; background: rgba(47,191,143,.1); color: #a9f0d5; text-decoration: none; }
.contact-preview span { color: var(--color-text-muted); font-size: 12px; }
.role-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(243,182,63,.14); border: 1px solid rgba(243,182,63,.32); color: #f7d477; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.role-badge-member { background: rgba(96,165,250,.14); border-color: rgba(96,165,250,.32); color: #bfdbfe; }
.role-badge-partner { background: rgba(47,191,143,.14); border-color: rgba(47,191,143,.32); color: #a9f0d5; }
.role-badge-admin { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.34); color: #fecaca; }
.table-subtext { display: block; color: var(--color-text-muted); font-size: 11px; margin-top: 3px; }
.partner-inline-form { display: flex; align-items: center; gap: 6px; min-width: 250px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0; }
.admin-credit-column { display: grid; gap: 6px; min-width: min(100%, 330px); }
.admin-credit-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid rgba(243,182,63,.24); border-radius: 12px; background: linear-gradient(135deg, rgba(243,182,63,.08), rgba(30,41,59,.35)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.admin-credit-input-wrap { display: flex; flex-direction: column; gap: 4px; }
.admin-credit-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-primary); }
.admin-credit-input { min-width: 0; }
.admin-credit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-credit-btn {
  flex: 1 1 110px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
}
.admin-credit-btn i { font-size: 11px; }
.admin-credit-btn:hover { transform: translateY(-1px); }
.admin-member-search { display: flex; align-items: flex-end; gap: 8px; margin: -2px 0 12px; }
.admin-member-search .admin-credit-label { margin-bottom: 5px; }
.admin-member-search-row { display: flex; align-items: center; gap: 6px; flex: 1; }
.admin-member-search-row .form-input { max-width: 280px; }
.member-table-wrap { overflow-x: auto; }
.form-input-sm { padding: 7px 8px; font-size: 12px; min-width: 76px; }
.vip-tier-list { display: flex; flex-direction: column; gap: 12px; }
.vip-tier-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--color-border); border-radius: 12px; background: rgba(255,255,255,.025); }
.vip-tier-badge { flex: 0 0 auto; min-width: 76px; padding: 7px 8px; text-align: center; border-radius: 999px; background: rgba(243,182,63,.14); border: 1px solid rgba(243,182,63,.3); color: #f7d477; font-size: 11px; font-weight: 700; }
.vip-tier-row strong, .vip-tier-row small, .vip-tier-row p { display: block; }
.vip-tier-row strong { color: #fff; }
.vip-tier-row small, .vip-tier-row p { color: var(--color-text-muted); font-size: 12px; margin: 3px 0 0; }
.notification-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 4px; padding: 0 4px; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 10px; }
.notification-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.notification-item { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); }
.notification-item.is-unread { border-color: rgba(243,182,63,.45); background: linear-gradient(110deg, rgba(243,182,63,.09), var(--color-surface)); }
.notification-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: rgba(243,182,63,.13); color: var(--color-primary); }

/* ---------- TREASURE CHEST DEMO ---------- */
.nav-link-treasure { color: #f7d477; }
.treasure-page { min-height: calc(100vh - 160px); padding: 42px 0 70px; }
.treasure-shell { max-width: 1040px; }
.treasure-intro { text-align: center; margin: 8px auto 24px; }
.treasure-intro .eyebrow { color: #f7d477; }
.treasure-title { margin: 8px 0 4px; font-size: clamp(2rem, 5vw, 3.5rem); color: #fff1b5; text-shadow: 0 0 22px rgba(243,182,63,.5); }
.treasure-subtitle { color: var(--color-text-muted); font-size: 1.05rem; }
.treasure-note { display: inline-flex; gap: 7px; align-items: center; margin-top: 12px; color: #a9f0d5; font-size: .78rem; }
.treasure-stage { position: relative; isolation: isolate; min-height: 510px; padding: 78px 24px 30px; overflow: hidden; border: 1px solid rgba(243,182,63,.3); border-radius: 24px; background: radial-gradient(circle at 50% 30%, rgba(243,182,63,.16), transparent 28%), linear-gradient(145deg, #182c49 0%, #0c162a 54%, #080e1c 100%); box-shadow: 0 24px 70px rgba(0,0,0,.4), inset 0 0 50px rgba(96,165,250,.06); }
.treasure-stage::before, .treasure-stage::after { content: ''; position: absolute; z-index: -1; width: 260px; height: 260px; border-radius: 50%; filter: blur(45px); opacity: .23; pointer-events: none; }
.treasure-stage::before { top: -100px; left: 12%; background: #e8ad35; }
.treasure-stage::after { right: 10%; bottom: -130px; background: #4779c9; }
.treasure-stars { position: absolute; inset: 0; opacity: .6; pointer-events: none; background-image: radial-gradient(circle, rgba(255,236,166,.8) 0 1px, transparent 1.5px), radial-gradient(circle, rgba(130,190,255,.5) 0 1px, transparent 1.5px); background-size: 83px 97px, 127px 113px; animation: treasure-drift 14s linear infinite; }
.chest-grid { position: relative; display: grid; grid-template-columns: repeat(3, minmax(150px, 220px)); justify-content: center; gap: clamp(20px, 6vw, 72px); }
.treasure-chest { position: relative; isolation: isolate; min-height: 230px; padding: 40px 20px 24px; border: 0; background: transparent; color: #fff; cursor: pointer; transition: transform .35s ease, opacity .35s ease, filter .35s ease; }
.treasure-chest:hover, .treasure-chest.is-selected { transform: translateY(-12px) scale(1.04); }
.treasure-chest.is-dimmed { opacity: .25; filter: grayscale(.5); transform: scale(.9); }
.chest-aura { position: absolute; inset: 25px 5px 15px; z-index: -1; border-radius: 50%; background: rgba(243,182,63,.15); filter: blur(22px); animation: chest-pulse 2.3s ease-in-out infinite; }
.chest-lid, .chest-body { position: absolute; left: 50%; transform: translateX(-50%); display: block; color: #ffe59a; border: 2px solid #b7791d; background: linear-gradient(145deg, #a85f24, #5b2814 58%, #2d1720); box-shadow: inset 0 2px 5px rgba(255,231,159,.28), inset 0 -10px 16px rgba(20,5,5,.3), 0 12px 22px rgba(0,0,0,.48); }
.chest-lid { top: 54px; width: 156px; height: 68px; border-radius: 72px 72px 10px 10px; transform: translateX(-50%) perspective(180px) rotateX(0deg); transform-origin: bottom; transition: transform .7s cubic-bezier(.2,.8,.2,1); z-index: 2; overflow: hidden; }
.chest-body { top: 112px; width: 160px; height: 102px; border-radius: 7px 7px 24px 24px; overflow: hidden; }
.lid-wood, .body-wood { position: absolute; inset: 5px; border-radius: inherit; opacity: .9; background: repeating-linear-gradient(165deg, rgba(255,191,91,.14) 0 3px, transparent 3px 14px), linear-gradient(90deg, #713317, #a85c24 45%, #542015); }
.body-wood { inset: 7px 5px 5px; border-radius: 3px 3px 18px 18px; background: repeating-linear-gradient(0deg, rgba(255,190,83,.14) 0 2px, transparent 2px 12px), linear-gradient(90deg, #612612, #963f1d 45%, #481715); }
.lid-band, .body-band { position: absolute; top: 0; bottom: 0; width: 12px; background: linear-gradient(90deg, #75430e, #f5cf67 40%, #aa6b19 70%, #5a300b); box-shadow: 0 0 8px rgba(250,207,102,.35); }
.lid-band-left, .body-band-left { left: 21px; }
.lid-band-right, .body-band-right { right: 21px; }
.body-band { top: -2px; bottom: -2px; width: 13px; }
.chest-lock { position: absolute; z-index: 3; top: 38px; left: 50%; display: grid; place-items: center; width: 30px; height: 35px; transform: translateX(-50%); border: 2px solid #f5cf67; border-radius: 5px 5px 9px 9px; background: linear-gradient(145deg, #f7d978, #a96713); color: #54240f; box-shadow: 0 0 12px rgba(255,214,91,.5); }
.chest-lock i { font-size: 12px; }
.chest-shine { position: absolute; inset: 12px 35px auto; height: 16px; border-radius: 50%; background: rgba(255,238,174,.28); filter: blur(5px); }
.chest-floor-shadow { position: absolute; left: 50%; top: 202px; width: 190px; height: 24px; transform: translateX(-50%); border-radius: 50%; background: rgba(0,0,0,.5); filter: blur(9px); }
.treasure-chest.is-open .chest-lid { transform: translateX(-50%) perspective(180px) rotateX(-112deg); }
.treasure-chest.is-open .chest-aura { animation: chest-burst .8s ease-out forwards; }
.chest-number { position: absolute; bottom: 0; left: 0; right: 0; color: rgba(255,255,255,.42); font-size: .72rem; letter-spacing: .25em; }
.treasure-hint { position: relative; margin: 26px 0 0; text-align: center; color: #f8d98a; font-size: .95rem; }
.treasure-result { position: relative; max-width: 380px; margin: 20px auto 0; padding: 20px; text-align: center; border: 1px solid rgba(255,225,135,.55); border-radius: 18px; background: rgba(7,14,28,.72); box-shadow: 0 0 35px rgba(243,182,63,.28); animation: result-rise .55s ease both; }
.result-icon { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 8px; border-radius: 50%; font-size: 31px; color: #fff2b1; background: rgba(243,182,63,.18); box-shadow: 0 0 24px rgba(243,182,63,.45); }
.result-gold { color: #fff0a8; background: rgba(243,182,63,.22); }
.result-violet { color: #e8c8ff; background: rgba(177,109,255,.2); box-shadow: 0 0 24px rgba(177,109,255,.42); }
.result-blue { color: #b9ddff; background: rgba(96,165,250,.2); box-shadow: 0 0 24px rgba(96,165,250,.42); }
.result-green { color: #b8ffe3; background: rgba(47,191,143,.2); box-shadow: 0 0 24px rgba(47,191,143,.42); }
.result-tier { font-size: .72rem; font-weight: 700; letter-spacing: .2em; }
.treasure-result h2 { margin: 3px 0 14px; color: #fff; font-size: 1.35rem; text-shadow: 0 0 14px rgba(255,255,255,.22); }
.treasure-history-panel { margin-top: 22px; }
.treasure-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.treasure-history-head .panel-title { margin-bottom: 12px; }
.treasure-demo-label { color: #a9f0d5; font-size: .68rem; letter-spacing: .16em; }
.treasure-history { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.history-prize { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; border: 1px solid var(--color-border); border-radius: 11px; background: rgba(255,255,255,.025); }
.history-prize span { font-size: .68rem; letter-spacing: .13em; }
.history-prize strong { color: #f8fbff; font-size: .9rem; }
.history-prize-new { animation: result-rise .45s ease both; border-color: rgba(243,182,63,.4); box-shadow: var(--glow-gold); }
.tier-special { color: #72e0b5; text-shadow: 0 0 10px rgba(47,191,143,.45); }
.tier-rare { color: #7fc8ff; text-shadow: 0 0 10px rgba(96,165,250,.55); }
.tier-epic { color: #d2a0ff; text-shadow: 0 0 10px rgba(177,109,255,.65); }
.tier-legendary { color: #ffe082; text-shadow: 0 0 12px rgba(243,182,63,.75); }
@keyframes chest-pulse { 50% { transform: scale(1.15); opacity: .75; } }
@keyframes chest-burst { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }
@keyframes treasure-drift { to { background-position: 83px 97px, -127px 113px; } }
@keyframes result-rise { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 640px) {
  .deposit-page { padding-top: 18px; padding-bottom: 28px; }
  .deposit-page .page-head { margin-bottom: 12px; gap: 8px; }
  .deposit-page .panel { margin-bottom: 12px; }
  .deposit-page .deposit-bank-card { margin-bottom: 12px; padding: 14px; }
  .treasure-page { padding-top: 24px; }
  .treasure-stage { min-height: 590px; padding: 40px 12px 24px; }
  .chest-grid { grid-template-columns: 1fr; gap: 0; }
  .treasure-chest { min-height: 145px; padding: 0; }
  .chest-lid { top: 18px; width: 112px; height: 44px; }
  .chest-body { top: 58px; width: 118px; height: 72px; }
  .chest-body i { font-size: 30px; }
  .chest-number { bottom: 0; }
}
.notification-item strong, .notification-item p, .notification-item small { display: block; }
.notification-item p { margin: 3px 0; color: var(--color-text-muted); }
.notification-item small { color: #71839c; font-size: 11px; }
.check-row { display: flex; gap: 9px; align-items: center; color: var(--color-text-muted); }

@media (max-width: 920px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .lottery-action-row { grid-template-columns: 1fr; gap: 10px; }
  .lottery-full-btn { order: -1; }
  .stat-grid { grid-template-columns: 1fr; }
  .admin-form .form-row { grid-template-columns: 1fr; }
  .blocked-page-head { align-items: stretch; flex-direction: column; gap: 14px; }
  .blocked-page-head .btn { width: 100%; }
  .blocked-panel-body { padding: 16px; }
  .voyage-strip-inner { grid-template-columns: 1fr; gap: 6px; padding-top: 7px; padding-bottom: 7px; }
  .voyage-item { padding: 2px 0; }
}

/* ---------- RESPONSIVE MOBILE FIXES (มือถือแสดงผลสวยงาม) ---------- */
@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 12px 0;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-lockup { min-width: 0; }
  .brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  
  .main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-left: 0;
  }

  .header-actions {
    margin-left: 0;
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-title { font-size: 26px; }
  .hero { padding: 36px 0; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 16px; }

  /* จัดการตารางไม่ให้ล้นหน้าจอมือถือ */
  .table-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }

  .panel { padding: 16px 12px; }
  .reward-footer { align-items: flex-start; }
  .reward-price-value { font-size: 24px; }
}

@media (max-width: 920px) {
  .main-nav { display: none; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; }
  .main-nav.is-open {
    display: flex;
    max-height: calc(100dvh - 78px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 10px;
  }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .partner-dashboard-shell { grid-template-columns: 1fr; gap: 14px; }
  .partner-sidebar { position: static; }
  .partner-sidebar-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partner-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partner-content-grid { grid-template-columns: 1fr; }
  .admin-section .page-head { gap: 10px; margin-bottom: 14px; }
  .admin-section .panel { padding: 12px; }
  .admin-section .data-table { font-size: 11px; }
  .admin-section .data-table th, .admin-section .data-table td { padding: 6px; }
  .admin-section .btn { padding: 6px 8px; font-size: 11px; }
}

@media (max-width: 520px) {
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-card { padding: 16px; }
  .room-item { align-items: flex-start; padding: 12px; }
  .room-item-action { margin-left: auto; }
  .activity-item { align-items: flex-start; }
  .activity-tag { min-width: 62px; }
}

/* Final compact pass for phones: keep the lottery catalog scannable. */
@media (max-width: 640px) {
  .container { padding-left: 12px; padding-right: 12px; }
  .site-header { position: sticky; }
  .header-inner { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .brand-mark { width: 48px; height: 48px; border-radius: 0; }
  .brand-mark img { width: 48px !important; height: 48px !important; }
  .brand-text, .brand-text-premium { font-size: 16px; }
  .brand-subtitle { display: none; }
  .nav-toggle { width: 38px; height: 38px; }
  .header-actions { gap: 6px; overflow: hidden; flex-wrap: nowrap; justify-content: flex-start; }
  .header-actions .btn-sm { min-height: 34px; padding: 6px 10px; font-size: 12px; }
  .points-chip { padding: 4px 8px; border-radius: 10px; }
  .points-chip-label { font-size: 9px; }
  .points-chip-value { font-size: 12px; }
  .vip-mini-badge { display: none; }
  .hero-slider-section { margin: 8px 0; }
  .hero-slider { border-radius: 10px; }
  .slider-wrapper { aspect-ratio: 16 / 9; height: auto; }
  .hero { padding: 24px 0; }
  .hero-inner { gap: 12px; }
  .hero-title { font-size: 24px; line-height: 1.22; }
  .hero-subtitle { font-size: 13px; margin-bottom: 14px; }
  .form-input,
  .form-input-sm,
  .admin-credit-input,
  .item-amount-input {
    font-size: 16px;
  }
  .hero-badge { padding: 5px 9px; margin-bottom: 10px; font-size: 10px; }
  .catalog-section, .page-section, .admin-section { padding-top: 18px; padding-bottom: 28px; }
  .section-head { margin-bottom: 14px; gap: 8px; }
  .section-title, .page-title { font-size: 19px; }
  .section-desc, .page-subtitle { font-size: 13px; line-height: 1.45; }
  .panel { padding: 12px; border-radius: 11px; margin-bottom: 12px; }
  .panel-title { font-size: 16px; margin-bottom: 8px; }
  .dashboard-card { padding: 12px; border-radius: 11px; }
  .dashboard-card strong { font-size: 1.35rem; margin-top: 5px; }
  .partner-dashboard-shell { gap: 10px; }
  .partner-sidebar { padding: 10px; border-radius: 12px; }
  .partner-profile-card { padding: 6px 4px 10px; }
  .partner-sidebar-nav { gap: 3px; padding: 9px 0; }
  .partner-sidebar-nav a { padding: 8px 7px; font-size: 11px; }
  .partner-invite-card { padding: 8px; }
  .partner-dashboard-head { display: block; margin-bottom: 12px; }
  .partner-dashboard-head .page-title { font-size: 20px; }
  .partner-balance { min-width: 0; margin-top: 10px; text-align: left; }
  .partner-balance strong { font-size: 19px; }
  .partner-stat-grid { gap: 7px; margin-bottom: 10px; }
  .partner-stat-card { padding: 10px; border-radius: 10px; }
  .partner-stat-card strong { font-size: 17px; }
  .partner-content-grid { gap: 10px; margin-bottom: 10px; }
  .partner-form-row { grid-template-columns: 1fr; gap: 9px; }
  .partner-filter-grid { grid-template-columns: 1fr 1fr; }
  .partner-members-panel .data-table { min-width: 520px; font-size: 11px; }
  .partner-members-panel .data-table th, .partner-members-panel .data-table td { padding: 7px 6px; }
  .partner-members-panel .table-wrap { overflow-x: visible; }
  .partner-members-panel .data-table { display: block; min-width: 0 !important; width: 100%; font-size: 11px; line-height: 1.25; }
  .partner-members-panel .data-table thead { display: none; }
  .partner-members-panel .data-table tbody { display: grid; gap: 8px; }
  .partner-members-panel .data-table tr { display: grid; grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr)) auto; gap: 5px; align-items: end; padding: 8px 6px; border: 1px solid rgba(148,163,184,.18); border-radius: 8px; background: rgba(15,23,42,.28); }
  .partner-members-panel .data-table td { display: block; width: auto !important; padding: 2px !important; border: 0; overflow-wrap: anywhere; }
  .partner-members-panel .data-table td:nth-child(1) { grid-column: 1 / -1; padding-bottom: 4px !important; border-bottom: 1px solid rgba(148,163,184,.14); }
  .partner-members-panel .data-table td:nth-child(2) { display: none; }
  .partner-members-panel .data-table td:nth-child(3)::before { content: 'เครดิต'; display: block; color: var(--color-text-muted); font-size: 9px; }
  .partner-members-panel .data-table td:nth-child(4)::before { content: 'ขั้นต่ำ'; display: block; color: var(--color-text-muted); font-size: 9px; }
  .partner-members-panel .data-table td:nth-child(5)::before { content: 'สูงสุด/รายการ'; display: block; color: var(--color-text-muted); font-size: 9px; }
  .partner-members-panel .data-table td:nth-child(6)::before { content: 'สูงสุด/เลข'; display: block; color: var(--color-text-muted); font-size: 9px; }
  .partner-members-panel .data-table td:nth-child(7)::before { content: 'บันทึก'; display: block; color: transparent; font-size: 9px; }
  .partner-members-panel .data-table .form-input-sm { width: 100%; min-width: 0; padding: 4px 2px; font-size: 11px; }
  .partner-members-panel .data-table .btn-xs { padding: 5px 4px; font-size: 9px; white-space: normal; }
  .lottery-action-row { gap: 7px; margin-bottom: 1rem; }
  .wallet-action, .lottery-full-btn { min-height: 42px; padding: 8px 10px; border-radius: 9px; font-size: 13px; }
  .voyage-strip-inner { gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  .voyage-item > i { width: 28px; height: 28px; }
  .voyage-item strong { font-size: 11px; }
  .voyage-item small { font-size: 9px; }
}

@media (max-width: 520px) {
  .rooms-page { padding-top: 16px; padding-bottom: 30px; }
  .rooms-heading h1 { font-size: 1.3rem; }
  .rooms-heading p { font-size: .8rem; margin-bottom: 0; }
  .lottery-category-section { margin-bottom: 12px; }
  .room-card { min-height: 250px; }
  .room-card .room-visual { height: 76px; }
  .room-card .card-body { padding: 10px !important; padding-top: 58px !important; }
  .room-card .room-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 9px; }
  .room-card h4 { font-size: .92rem; }
  .room-card p { font-size: .78rem !important; line-height: 1.35; margin-bottom: .45rem !important; }
  .room-card .room-countdown { padding: .42rem .55rem !important; margin-bottom: .45rem !important; }
  .room-card .room-countdown-value { font-size: .9rem !important; }
  .room-card .room-action { min-height: 34px; padding: 5px 8px !important; font-size: .78rem; }
}

/* Partner portal keeps the desktop canvas on small screens. */
@media (max-width: 920px) {
  .partner-page { min-width: 1100px; }
  .partner-dashboard-shell { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
  .partner-sidebar { position: sticky; top: 92px; padding: 14px; }
  .partner-sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; }
  .partner-sidebar-nav a { padding: 9px 10px; font-size: 12px; }
  .partner-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .partner-content-grid { grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr); gap: 16px; }
  .partner-form-row { grid-template-columns: .8fr 1.2fr; gap: 11px; }
  .partner-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .partner-members-panel .table-wrap { overflow-x: auto; }
  .partner-members-panel .data-table { display: table; min-width: 600px !important; width: 100%; table-layout: auto; font-size: 14px; line-height: 1.45; }
  .partner-members-panel .data-table thead { display: table-header-group; }
  .partner-members-panel .data-table tbody { display: table-row-group; }
  .partner-members-panel .data-table tr { display: table-row; padding: 0; border: 0; background: transparent; }
  .partner-members-panel .data-table th, .partner-members-panel .data-table td { display: table-cell; width: auto !important; padding: 12px; border-bottom: 1px solid var(--color-border); }
  .partner-members-panel .data-table td:nth-child(2) { display: table-cell; }
  .partner-members-panel .data-table td::before { content: none !important; }
  .partner-members-panel .data-table .form-input-sm { width: 100%; min-width: 80px; padding: 6px 8px; font-size: 14px; }
  .partner-members-panel .data-table .btn-xs { padding: 6px 8px; font-size: 11px; white-space: nowrap; }
}

/* เมนู "บัญชีของฉัน" (รวมตั้งค่าการเล่น/เปลี่ยนรหัสผ่าน/กฎกติกา/ติดต่อเรา) และลิงก์ท้ายเว็บ */
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu .nav-menu-caret { font-size: .65rem; margin-left: 5px; transition: transform .2s; }
.nav-menu[open] .nav-menu-caret { transform: rotate(180deg); }
.nav-menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; z-index: 1500; display: grid; padding: 6px;
  background: var(--color-surface, #101a2c); border: 1px solid var(--color-border, rgba(255,255,255,.12)); border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.nav-menu-list a { padding: 9px 12px; border-radius: 7px; color: var(--color-text, #e7edf7); text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav-menu-list a:hover { background: rgba(212, 175, 55, .12); color: var(--color-primary, #f3b63f); }
@media (max-width: 900px) {
  .nav-menu-list { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; background: transparent; }
}
.footer-links a { color: var(--color-text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--color-primary, #f3b63f); text-decoration: underline; }
