:root {
  --blue: #5A3A24;
  --indigo: #6610f2;
  --purple: #6f42c1;
  --pink: #e83e8c;
  --red: #dc3545;
  --orange: #fd7e14;
  --yellow: #ffc107;
  --green: #28a745;
  --teal: #20c997;
  --cyan: #17a2b8;
  --white: #fff;
  --gray: #6c757d;
  --gray-dark: #343a40;
  --primary: #5A3A24;
  --secondary: #6c757d;
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --light: #f8f9fa;
  --dark: #343a40;
  --side: #2a1b10;
  --side-soft: #3d2818;
  --blue-logo: #5A3A24;
  --green-2: #34c759;
  --red-soft: #e57373;
  --grey-card: #ebe4dc;
  --grey-bg: #f3eee8;
  --pink-bg: #f8d7da;
  --pink-text: #721c24;
  --yellow-bar: #fff3cd;
  --yellow-text: #856404;
  --announce: #efe4d6;
  --announce-border: #c4a882;
  --orange-btn: #8b5a2b;
  --font-family-sans-serif: "Prompt", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --font: "Prompt", sans-serif;
  --qb-bg: #d4edda;
  --qb-border: #7cb87c;
  --qb-yellow: #ffc107;
  --play-col: 640px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 13.824px;
  font-weight: 400;
  line-height: 1.45;
  color: #3d2e24;
  text-align: left;
  background-color: #fff;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  background: var(--grey-bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

#app {
  min-height: 100vh;
}

/* ========== LOGIN — storm + lightning ========== */
.login-shell {
  --login-gold: #d4af37;
  --login-gold-soft: #f0d78c;
  --login-ink: #0b0e14;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  overflow: hidden;
  scroll-margin-top: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(212, 175, 55, 0.14), transparent 55%),
    radial-gradient(900px 500px at 80% 100%, rgba(30, 60, 120, 0.35), transparent 50%),
    linear-gradient(180deg, #07090f 0%, #121826 42%, #0a0d14 100%);
  color: #e8e6e1;
}

.login-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.login-clouds {
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(ellipse 40% 28% at 20% 18%, rgba(70, 80, 100, 0.45), transparent 70%),
    radial-gradient(ellipse 45% 30% at 75% 12%, rgba(55, 65, 90, 0.5), transparent 70%),
    radial-gradient(ellipse 50% 35% at 50% 0%, rgba(40, 48, 70, 0.55), transparent 65%);
  animation: login-cloud-drift 28s ease-in-out infinite alternate;
}

.login-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.login-flash-a {
  background:
    radial-gradient(ellipse 55% 40% at 18% 8%, rgba(255, 252, 235, 0.7), transparent 55%),
    linear-gradient(180deg, rgba(255, 248, 220, 0.22), transparent 45%);
  animation: login-sky-flash 8s ease-in-out infinite;
}

.login-flash-b {
  background:
    radial-gradient(ellipse 50% 38% at 78% 6%, rgba(255, 250, 230, 0.65), transparent 55%),
    linear-gradient(180deg, rgba(230, 240, 255, 0.18), transparent 40%);
  animation: login-sky-flash 8s ease-in-out 2.7s infinite;
}

.login-glow {
  position: absolute;
  left: 50%;
  top: 8%;
  width: min(560px, 85vw);
  height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.2), transparent 70%);
  filter: blur(10px);
  animation: login-glow-pulse 5s ease-in-out infinite;
}

/* ฟ้าผ่า — เส้นผ่าลงจากฟ้า + กิ่งแยก + แสงกระทบพื้น */
.login-strike {
  position: absolute;
  top: -4%;
  height: 78vh;
  width: min(160px, 26vw);
  opacity: 0;
  pointer-events: none;
  transform-origin: top center;
}

.login-strike.strike-a {
  left: 8%;
  animation: login-strike-seq 8s linear infinite;
}

.login-strike.strike-b {
  right: 10%;
  width: min(140px, 22vw);
  height: 72vh;
  animation: login-strike-seq 8s linear 2.7s infinite;
}

.login-strike.strike-c {
  left: 42%;
  width: min(120px, 18vw);
  height: 68vh;
  animation: login-strike-seq 8s linear 5.2s infinite;
}

.login-bolt-svg {
  display: block;
  width: 100%;
  height: calc(100% - 28px);
  overflow: visible;
}

.login-bolt-svg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
}

.login-bolt-svg .bolt-glow {
  stroke: rgba(255, 236, 170, 0.95);
  stroke-width: 7;
  filter: blur(2.5px) drop-shadow(0 0 10px rgba(255, 240, 180, 0.95));
}

.login-bolt-svg .bolt-core {
  stroke: #fffdf5;
  stroke-width: 2.4;
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 14px rgba(212, 175, 55, 1));
}

.login-bolt-svg .bolt-branch {
  stroke: #fff8dc;
  stroke-width: 1.6;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  filter: drop-shadow(0 0 6px rgba(255, 230, 150, 0.9));
}

.login-strike.strike-a .bolt-glow,
.login-strike.strike-a .bolt-core {
  animation: login-bolt-draw 8s linear infinite;
}

.login-strike.strike-a .bolt-branch {
  animation: login-branch-draw 8s linear infinite;
}

.login-strike.strike-b .bolt-glow,
.login-strike.strike-b .bolt-core {
  animation: login-bolt-draw 8s linear 2.7s infinite;
}

.login-strike.strike-b .bolt-branch {
  animation: login-branch-draw 8s linear 2.7s infinite;
}

.login-strike.strike-c .bolt-glow,
.login-strike.strike-c .bolt-core {
  animation: login-bolt-draw 8s linear 5.2s infinite;
}

.login-strike.strike-c .bolt-branch {
  animation: login-branch-draw 8s linear 5.2s infinite;
}

.login-impact {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 230, 150, 0.9) 35%, transparent 70%);
  box-shadow:
    0 0 20px 8px rgba(255, 240, 200, 0.75),
    0 0 48px 16px rgba(212, 175, 55, 0.35);
  opacity: 0;
  transform: scale(0.4);
}

.login-strike.strike-a .login-impact {
  animation: login-impact-burst 8s linear infinite;
}

.login-strike.strike-b .login-impact {
  left: 62%;
  animation: login-impact-burst 8s linear 2.7s infinite;
}

.login-strike.strike-c .login-impact {
  left: 40%;
  animation: login-impact-burst 8s linear 5.2s infinite;
}

@keyframes login-cloud-drift {
  from { transform: translate3d(-1.5%, 0, 0) scale(1.02); }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.05); }
}

@keyframes login-sky-flash {
  0%, 6%, 14%, 100% { opacity: 0; }
  7% { opacity: 0.95; }
  8% { opacity: 0.12; }
  9% { opacity: 0.7; }
  11% { opacity: 0.2; }
  12.5% { opacity: 0; }
}

/* โชว์ทั้งชุดฟ้าผ่าช่วงสั้นๆ */
@keyframes login-strike-seq {
  0%, 5.5%, 13%, 100% { opacity: 0; }
  6%, 12% { opacity: 1; }
}

/* เส้นผ่าลากจากบนลงล่าง */
@keyframes login-bolt-draw {
  0%, 5.5% { stroke-dashoffset: 520; opacity: 0; }
  6% { opacity: 1; stroke-dashoffset: 520; }
  8.2% { stroke-dashoffset: 0; opacity: 1; }
  9% { opacity: 0.35; }
  10% { opacity: 1; }
  11.5% { opacity: 0.85; stroke-dashoffset: 0; }
  13%, 100% { opacity: 0; stroke-dashoffset: 0; }
}

@keyframes login-branch-draw {
  0%, 6.4% { stroke-dashoffset: 120; opacity: 0; }
  6.8% { opacity: 1; stroke-dashoffset: 120; }
  8.4% { stroke-dashoffset: 0; opacity: 1; }
  9.2% { opacity: 0.3; }
  10.2% { opacity: 0.95; }
  12%, 100% { opacity: 0; stroke-dashoffset: 0; }
}

@keyframes login-impact-burst {
  0%, 7.8%, 13%, 100% { opacity: 0; transform: scale(0.3); }
  8.2% { opacity: 1; transform: scale(1.35); }
  9% { opacity: 0.55; transform: scale(1.8); }
  10.5% { opacity: 0.9; transform: scale(1.15); }
  12% { opacity: 0; transform: scale(2.2); }
}

@keyframes login-glow-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-stage {
  position: relative;
  z-index: 1;
  width: min(420px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: login-rise 0.85s ease-out both;
}

.login-brand {
  text-align: center;
  line-height: 0;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 24px rgba(212, 175, 55, 0.25));
}

.login-logo-img {
  display: block;
  width: min(280px, 78vw);
  height: auto;
  margin: 0 auto;
}

.login-card {
  width: 100%;
  background: linear-gradient(165deg, rgba(22, 26, 36, 0.88), rgba(12, 14, 20, 0.92));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  padding: 26px 24px 22px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 20px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.login-sub {
  text-align: center;
  margin: 0 0 8px;
  font-family: "Cinzel", "Prompt", serif;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--login-gold-soft);
}

.login-sub span {
  color: #fff;
  font-weight: 700;
}

.login-card h2 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  color: #f5f2ea;
}

.login-seo-line {
  margin: -8px 0 14px;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(240, 215, 140, 0.85);
}

.login-seo-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(232, 230, 225, 0.65);
}

.login-seo-hint a {
  color: var(--login-gold-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-seo-hint a:hover {
  color: #fff;
}

/* —— SEO articles under login (crawlable in index.html) —— */
.seo-landing {
  position: relative;
  z-index: 2;
  background:
    linear-gradient(180deg, #0a0d14 0%, #121826 40%, #0b0e14 100%);
  color: #e8e6e1;
  border-top: 1px solid rgba(212, 175, 55, 0.28);
  padding: 48px 16px 64px;
}

.seo-landing[hidden] {
  display: none !important;
}

.seo-wrap {
  width: min(820px, 94vw);
  margin: 0 auto;
}

.seo-kicker {
  margin: 0 0 8px;
  font-family: "Cinzel", "Prompt", serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #d4af37;
}

.seo-hero-text h1 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  line-height: 1.35;
  font-weight: 700;
  color: #f5f2ea;
}

.seo-lead {
  margin: 0 0 28px;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(232, 230, 225, 0.88);
}

.seo-article {
  margin: 0 0 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.seo-article h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #f0d78c;
}

.seo-article p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(232, 230, 225, 0.86);
}

.seo-list {
  margin: 12px 0 0;
  padding-left: 1.2rem;
  line-height: 1.7;
  color: rgba(232, 230, 225, 0.86);
}

.seo-cta-text {
  margin-top: 12px !important;
}

.seo-foot {
  margin-top: 8px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(232, 230, 225, 0.55);
}

.seo-foot p {
  margin: 0;
}

.login-shell .field {
  margin-bottom: 14px;
}

.login-shell .field label {
  display: block;
  font-size: 0.86rem;
  color: rgba(232, 230, 225, 0.72);
  margin-bottom: 6px;
}

.login-shell .field input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  padding: 0 14px;
  outline: none;
  background: rgba(8, 10, 16, 0.65);
  color: #f5f2ea;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-shell .field input:focus {
  border-color: var(--login-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.login-shell .btn-login {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0c56a 0%, #c9a227 45%, #a6851a 100%);
  color: #1a1408;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(201, 162, 39, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.login-shell .btn-login:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.login-shell .btn-login:active {
  transform: translateY(0);
}

.login-shell .demo-note {
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: rgba(232, 230, 225, 0.45);
  text-align: center;
  line-height: 1.45;
}

.login-shell .error {
  color: #ff8a80;
  font-size: 0.9rem;
  margin: 0 0 10px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .login-clouds,
  .login-flash,
  .login-strike,
  .login-bolt-svg path,
  .login-impact,
  .login-glow,
  .login-stage {
    animation: none !important;
  }
  .login-strike.strike-a {
    opacity: 0.35;
  }
  .login-strike.strike-a .bolt-glow,
  .login-strike.strike-a .bolt-core,
  .login-strike.strike-a .bolt-branch {
    stroke-dashoffset: 0;
    opacity: 0.7;
  }
}

@media (max-width: 520px) {
  .login-logo-img {
    width: min(220px, 72vw);
  }
  .login-card {
    padding: 22px 18px 18px;
  }
}

/* ========== SHELL ========== */
.app-shell {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
}

.content-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--grey-bg);
}

/* Sidebar */
.sidebar {
  background: var(--side);
  color: #fff;
  padding: 12px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.logo {
  padding: 4px 6px 2px;
  line-height: 0;
}

.logo img {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  margin: 0 auto;
}

.side-time {
  color: #ffeb3b;
  font-size: 0.82rem;
  padding: 0 6px;
  font-weight: 500;
}

.side-user {
  padding: 6px 8px;
  font-size: 0.92rem;
  line-height: 1.65;
}

.side-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 4px;
}

.side-btns button {
  border: none;
  border-radius: 4px;
  background: var(--orange-btn);
  color: #fff;
  padding: 8px 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pay-box {
  margin-top: 4px;
  border: 1px solid #3a3f4b;
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.72rem;
}

.audit-nav-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px solid #c4a882;
  border-radius: 4px;
  background: #3d2a1c;
  color: #ffe7c2;
  padding: 10px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.audit-nav-btn:hover,
.audit-nav-btn.active {
  background: #5a3a24;
  color: #fff;
  border-color: #e0c3a0;
}

.pay-head {
  background: #2c313c;
  padding: 6px 8px;
  font-weight: 600;
  color: #ffd54f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pay-edit-btn {
  border: 1px solid #c4a882;
  background: #fff;
  color: #5A3A24;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.pay-edit-btn:hover {
  background: #faf6f1;
  border-color: #5A3A24;
}

.pay-box table {
  width: 100%;
  border-collapse: collapse;
}

.pay-box th,
.pay-box td {
  padding: 4px 5px;
  border-top: 1px solid #3a3f4b;
  text-align: left;
  white-space: nowrap;
}

.pay-box th {
  background: #252930;
  color: #adb5bd;
  font-weight: 500;
}

.pay-box td {
  color: #e9ecef;
}

.side-demo {
  margin-top: auto;
  font-size: 0.72rem;
  color: #ffecb3;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 4px;
  padding: 8px;
  line-height: 1.4;
}

/* Top nav */
.topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 6px 8px;
}

.topnav button {
  border: 1px solid #c4a882;
  background: #fff;
  color: #5A3A24;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.topnav button:hover {
  border-color: #5A3A24;
  background: #faf6f1;
  color: #3d2818;
}

.topnav button.active {
  background: #fff;
  border: 1.5px solid #5A3A24;
  color: #5A3A24;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 #5A3A24;
}

.topnav .ico {
  font-size: 0.95rem;
}

.topnav .btn-logout-top {
  margin-left: auto;
  border: 1px solid #dc3545 !important;
  background: #fff !important;
  color: #dc3545 !important;
  border-radius: 4px;
  padding: 6px 14px !important;
  font-weight: 600;
  height: 34px !important;
}

.topnav .btn-logout-top:hover {
  background: #dc3545 !important;
  color: #fff !important;
}

.topnav button.active + .btn-logout-top,
.topnav .btn-logout-top.active {
  background: #fff !important;
  color: #dc3545 !important;
}

/* Main */
.main {
  padding: 12px 14px 24px;
  overflow: auto;
  flex: 1;
}

.main.main-key {
  background: #eef2f6;
  padding: 10px 12px 20px;
}

/* ========== PLAY PAGE ========== */
.play-top {
  margin-bottom: 10px;
}

.link-back {
  border: none;
  background: transparent;
  color: #5A3A24;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
}

.tip-box {
  background: #f0e6da;
  border: 1px solid #d4b896;
  border-radius: 4px;
  padding: 10px 12px;
  color: #4a2f1c;
  font-size: 0.9rem;
  margin: 8px 0;
}

.tip-box.tip-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: #f0e6da;
  border: 1px solid #d4b896;
  border-radius: 4px;
  padding: 10px 12px;
  color: #4a2f1c;
  font-size: 0.92rem;
  margin: 8px 0 12px;
  position: relative;
}

.tip-box.tip-inline strong {
  color: #3d2818;
}

.tip-remain {
  margin-left: auto;
  color: #dc3545;
  font-weight: 700;
}

.box-h.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.box-h-sub {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.95;
}

.hot-table td.hot-full {
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-word;
  max-width: 220px;
}

.play-left {
  max-width: 640px;
  width: 100%;
}

.main.main-key {
  background: #fff;
}

.tip-sep {
  opacity: 0.55;
}

.play-remain {
  color: #dc3545;
  font-weight: 700;
  font-size: 1.05rem;
}

.play-remain.inline {
  margin-top: 4px;
  font-size: 0.95rem;
}

.play-remain.tiny {
  font-size: 0.85rem;
  white-space: nowrap;
}

.play-panel {
  background: #f5f7fa;
  border: 1px solid #cfd8dc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 12px;
}

.play-modes .play-mode.active {
  background: #e53935;
  border-color: #c62828;
  color: #fff;
}

.type-flag {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.tool-row {
  margin-bottom: 8px;
}

.qbtn.dark {
  background: #495057;
  color: #fff;
  min-width: 110px;
  height: 42px;
}

.num-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  min-height: 88px;
  margin: 10px 0 12px;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.num-box-body {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  max-height: 160px;
  overflow: auto;
  background: transparent;
  min-height: 48px;
}

.num-chip {
  appearance: none;
  border: none;
  background: #64b5f6;
  color: #fff;
  min-width: 48px;
  height: 42px;
  padding: 0 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.num-chip:hover {
  background: #ef5350;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.35);
}

.num-chip:hover::after {
  content: " ×";
  font-weight: 700;
}

.num-chip:active {
  transform: scale(0.96);
}

.num-placeholder {
  color: #90a4ae;
  font-weight: 500;
  font-size: 0.9rem;
  align-self: center;
}

.num-box-cancel {
  white-space: nowrap;
  height: 42px;
}

.box-b.pad {
  padding: 10px 12px;
}

.hot-row {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.play-note {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  background: transparent;
  padding: 4px 0;
  border-radius: 0;
}

.tip-box ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.play-remain {
  color: #dc3545;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 6px 0 8px;
}

.play-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  align-items: start;
}

.play-market {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0e6da;
  border: 1px solid #d4b896;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 0;
}

.play-market.bar {
  background: linear-gradient(180deg, #8b6346 0%, #6b4428 100%);
  border: 1px solid #4a2f1c;
  border-radius: 4px 4px 0 0;
  padding: 10px 14px;
  color: #fff;
}

.play-market-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
}

.play-market.bar .play-market-name {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.play-market.bar .play-market-date {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
}

.play-market-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #3d2818;
}

.play-market-date {
  color: #6b5344;
  font-size: 0.88rem;
}

.play-market-flag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4a2f1c;
}

.play-market.bar .play-market-flag {
  color: #fff;
}

.play-modes {
  display: flex;
  gap: 0;
  margin: 0 0 0;
  background: #fce8ea;
  border: 1px solid #e57373;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.play-mode {
  border: none;
  border-right: 1px solid #ef9a9a;
  background: transparent;
  color: #c62828;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 42px;
}

.play-mode:last-child {
  border-right: none;
}

.play-mode.active {
  background: #e53935;
  border-color: #e53935;
  color: #fff;
}

.type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
  align-items: center;
}

.type-btn {
  border: 1px solid #f0c36d;
  background: #ffe9a8;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: #5d4037;
  min-height: 36px;
}

.type-btn.active {
  background: #ffc107;
  border-color: #f9a825;
  color: #212529;
  box-shadow: none;
}

.qb-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  background: #fce8ea;
  border: 1px solid #e57373;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.qb-info-title {
  color: #b71c1c;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.qb-payrate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #5d4037;
}

.qb-payrate select {
  height: 32px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0 8px;
  background: #fff;
  min-width: 160px;
  font: inherit;
}

.link-detail {
  border: none;
  background: transparent;
  color: #e53935;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.88rem;
  text-decoration: underline;
}

.qb-info-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qb-pink {
  background: #fce8ea;
  border: 1px solid #e57373;
  border-radius: 0 0 6px 6px;
  padding: 12px 14px 14px;
  margin-bottom: 14px;
}

.qb-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.qb-title {
  color: #c62828;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.15;
}

.qb-sub {
  color: #b71c1c;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 2px;
}

.qb-panel-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qb-date {
  color: #5d4037;
  font-weight: 600;
  font-size: 0.92rem;
}

.qb-flag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 48px;
}

.qb-flag-tag {
  font-size: 0.58rem;
  font-weight: 700;
  color: #5A3A24;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.qb-cancel {
  white-space: nowrap;
  height: 36px;
  min-width: 96px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.num-cards {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 6px 10px;
  align-items: start;
  min-height: 72px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #ef9a9a;
  border-radius: 6px;
}

.num-cards[hidden],
.bills-box[hidden] {
  display: none !important;
}

.tool-row {
  margin: 0 0 10px;
}

.tool-row .qbtn.doubles {
  height: 36px;
  min-width: 100px;
  font-size: 0.9rem;
  font-weight: 700;
}

.num-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  min-height: 52px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #f5b7b1;
  border-radius: 4px;
}

.num-cards-label {
  width: 100%;
  color: #2e7d32;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.num-cards-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.num-cards .bill-row-del {
  margin-left: auto;
}

.num-cards .num-chip {
  appearance: none;
  border: none;
  background: #e53935;
  color: #fff;
  min-width: 44px;
  height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.num-cards .num-chip:hover {
  background: #c62828;
}

.play-form,
.play-form.mode-2,
.play-form.mode-3,
.play-form.num-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.6fr) 100px minmax(96px, 1fr) minmax(96px, 1fr) 128px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.play .pf label {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5d4037;
  margin-bottom: 4px;
  line-height: 1.2;
  height: 1.2em;
}

.play .pf input,
.play .pf .qbtn {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
}

.play .pf input {
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
  font-size: 1rem;
  text-align: center;
}

.play .pf input:focus {
  outline: 2px solid rgba(229, 57, 53, 0.25);
  border-color: #ef5350;
}

.play .qbtn.yellow.reverse,
.play .qbtn.yellow.doubles {
  background: #ffc107;
  border: 1px solid #e0a800;
  color: #212529;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0 8px;
}

.play .qbtn.red.add {
  background: #e53935;
  border: 1px solid #c62828;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0 8px;
}

.qb-pink .bills-box {
  background: #fff;
  border: 1px solid #f5b7b1;
  border-radius: 4px;
  min-height: 48px;
  max-height: none;
  height: auto;
  overflow: visible;
  margin: 8px 0 0;
  padding: 4px 0;
}

.qb-pink .bill-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid #ffebee;
}

.qb-pink .bill-row-label {
  color: #2e7d32;
  font-weight: 700;
  font-size: 0.88rem;
}

.qb-pink .num-text {
  color: #4a2f1c;
  font-weight: 700;
  font-size: 0.95rem;
}

.play-left {
  max-width: none;
  width: 100%;
}

.play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.play .qbtn.yellow.reverse {
  background: #ffb300;
  border-color: #fb8c00;
  color: #fff;
}

.play .qbtn.red.add {
  height: 40px;
  min-width: 118px;
  padding: 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 4px;
  background: #e53935;
  border-color: #c62828;
  color: #fff;
}

.qb-pink .bills-box {
  background: #fff;
  border: 1px solid #ef9a9a;
  border-radius: 4px;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow: visible;
  margin: 10px 0 0;
}

.qb-outro {
  padding: 2px 4px 0;
}

.play-note {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  background: transparent;
  padding: 0;
}

.play-note label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #5A3A24;
}

.play-note input {
  height: 34px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
}

.play-remain.tiny {
  font-size: 0.9rem;
  color: #e53935;
  font-weight: 700;
}

.play-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.play-foot-meta {
  text-align: center;
}

.play-foot-meta .muted {
  font-size: 0.9rem;
  color: #7a6454;
}

.play-total {
  font-size: 1.55rem;
  font-weight: 800;
  color: #212529;
  margin-top: 4px;
}

.play-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.qbtn.wide {
  min-width: 150px;
  height: 46px;
  font-size: 1.05rem;
  border-radius: 6px;
  font-weight: 700;
}

.play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.play-panel {
  background: #f0e6da;
  border: 1px solid #d4b896;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 12px;
}

.type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  align-items: center;
}

.type-btn {
  border: 1px solid #e0a800;
  background: #ffe082;
  padding: 8px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  color: #5d4037;
}

.type-btn.active {
  background: #ffc107;
  border-color: #ff8f00;
  color: #212529;
  box-shadow: inset 0 0 0 1px #ff8f00;
}

.type-cancel {
  margin-left: auto;
}

.qb-pink {
  background: #fde8eb;
  border: 1px solid #e57373;
  border-radius: 6px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}

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

.qb-title {
  color: #c62828;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
}

.qb-sub {
  color: #b71c1c;
  font-weight: 600;
  font-size: 0.98rem;
  margin-top: 2px;
}

.qb-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qb-date {
  color: #5d4037;
  font-weight: 600;
  font-size: 0.95rem;
}

.qb-flag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
}

.qb-flag.mini {
  min-width: 44px;
}

.qb-flag-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #37474f;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.qb-cancel {
  white-space: nowrap;
}

.qbtn.rec-launch {
  background: #c62828;
  color: #fff;
  min-width: 118px;
  height: 40px;
  white-space: nowrap;
  box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.45);
}

.qbtn.rec-launch:hover {
  background: #b71c1c;
}

body.is-recording .qbtn.rec-launch {
  background: #6c757d;
  animation: rec-pulse 1.2s ease-in-out infinite;
}

@keyframes rec-pulse {
  50% {
    filter: brightness(1.15);
  }
}

.qb-outro {
  padding: 0 2px;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: end;
}

.price-row .pf.amt {
  width: 110px;
}

.num-cards {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 6px 10px;
  align-items: start;
  min-height: 88px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #ef9a9a;
  border-radius: 6px;
}

.num-cards-label {
  grid-column: 1 / 2;
  color: #2e7d32;
  font-weight: 700;
  font-size: 0.88rem;
}

.num-cards-body {
  grid-column: 1 / 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  min-height: 48px;
  max-height: 160px;
  overflow: auto;
}

.num-cards .bill-row-del {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
}

.num-cards .num-chip {
  appearance: none;
  border: none;
  background: #e53935;
  color: #fff;
  min-width: 48px;
  height: 40px;
  padding: 0 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.num-cards .num-chip:hover {
  background: #c62828;
}

.confirm-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px;
}

.confirm-card {
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  padding: 16px 18px 20px;
}

.confirm-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.confirm-table-wrap {
  max-height: 360px;
  overflow: auto;
  margin: 12px 0;
  border: 1px solid #eceff1;
  border-radius: 4px;
}

.confirm-table th:nth-child(1),
.confirm-table td.left {
  text-align: left;
}

.confirm-table th:nth-child(2),
.confirm-table th:nth-child(3),
.confirm-table th:nth-child(4),
.confirm-table td.col-amt,
.confirm-table td.col-rate,
.confirm-table td.col-win {
  text-align: center;
  white-space: nowrap;
  width: 5.5rem;
}

.confirm-table tr.is-full-pay td.col-rate,
.confirm-table tr.is-full-pay td.col-win {
  color: #c62828;
  font-weight: 700;
}

.confirm-sum {
  text-align: center;
  margin: 12px 0;
  line-height: 1.7;
}

.confirm-net {
  font-size: 1.25rem;
  font-weight: 800;
}

.credit-warn {
  color: #c62828;
}

.play-credit {
  font-size: 0.9rem;
  color: #5a3a24;
  margin: 0 0 6px;
}

.play-credit b {
  font-weight: 800;
}

.qbtn:disabled,
.qbtn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.confirm-note {
  color: #7a6454;
  margin-top: 6px;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.qbtn.dark {
  background: #5A3A24;
  border-color: #37474f;
  color: #fff;
}

.demo-note.soft {
  text-align: center;
  color: #78909c;
  font-size: 0.85rem;
  margin-top: 14px;
}

.num-cards .num-placeholder {
  color: #90a4ae;
  font-weight: 500;
  font-size: 0.9rem;
  align-self: center;
}

.play-form.num-row {
  grid-template-columns: 1.6fr auto auto;
}

.qb-pink .bills-box {
  background: #fff;
  border: 1px solid #ef9a9a;
  border-radius: 4px;
  min-height: 48px;
  max-height: none;
  height: auto;
  overflow: visible;
  margin: 10px 0 4px;
}

.qb-pink .bill-row {
  border-bottom: 1px solid #ffebee;
}

.qb-pink .bill-row-label {
  color: #2e7d32;
}

.qb-pink .num-text {
  color: #4a2f1c;
}

.play-form {
  display: grid;
  grid-template-columns: minmax(120px, 1.35fr) 100px minmax(100px, 1fr) minmax(100px, 1fr) 128px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.play-form.mode-3 {
  grid-template-columns: minmax(120px, 1.35fr) 100px minmax(100px, 1fr) minmax(100px, 1fr) 128px;
}

.play-note {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  background: transparent;
  padding: 4px 0;
  border-radius: 0;
}

.play-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.play-foot-meta {
  text-align: center;
}

.play-total {
  font-size: 1.45rem;
  font-weight: 800;
  color: #212529;
  margin-top: 4px;
}

.play-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.qbtn.wide {
  min-width: 140px;
  height: 44px;
  font-size: 1.05rem;
}

.qbtn.red.add {
  background: #e53935;
  border-color: #c62828;
  color: #fff;
  min-width: 120px;
  height: 42px;
  font-weight: 700;
}

.qbtn.yellow.reverse {
  background: #ffb300;
  border-color: #f57c00;
  color: #fff;
  font-weight: 700;
}

.type-btn {
  border: 1px solid #e0a800;
  background: #ffe082;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #5d4037;
}

.type-btn.active {
  background: #ffb300;
  border-color: #ef6c00;
  color: #212529;
  box-shadow: inset 0 0 0 1px #ef6c00;
}

.bills-box {
  background: #fff;
  border: 1px solid #d4b896;
  border-radius: 6px;
  min-height: 48px;
  max-height: none;
  height: auto;
  overflow: visible;
  margin: 12px 0;
}

.bills-box.empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bills-empty {
  color: #90a4ae;
  font-size: 0.9rem;
  padding: 24px;
}

.bill-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid #f0e6da;
}

.bill-row:last-child {
  border-bottom: none;
}

.bill-row-label {
  color: #2e7d32;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.35;
}

.bill-row-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.bill-row.pending {
  background: #fffde7;
}

.bill-row-label em {
  font-style: normal;
  color: #f57c00;
  font-weight: 600;
  font-size: 0.8rem;
}

.num-text {
  appearance: none;
  border: none;
  background: transparent;
  color: #4a2f1c;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1.4;
}

.num-text:hover {
  color: #c62828;
  text-decoration: line-through;
}

.num-chip.sm {
  min-width: 40px;
  height: 34px;
  font-size: 0.92rem;
  background: #d4b896;
}

.summary-empty {
  color: #90a4ae;
  font-size: 0.9rem;
  padding: 6px 0;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-group {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.88rem;
}

.summary-title {
  font-weight: 700;
  color: #4a2f1c;
}

.summary-nums {
  color: #37474f;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  word-break: break-word;
}

.bill-row-del {
  border: none;
  background: transparent;
  color: #dc3545;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
}

.bill-row-del:hover {
  background: #ffebee;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .bill-row {
    grid-template-columns: 1fr auto;
  }
  .bill-row-label {
    grid-column: 1 / -1;
  }
  .play-form.mode-3 {
    grid-template-columns: 1fr 1fr;
  }
}

.pf label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: #37474f;
}

.pf input {
  width: 100%;
  height: 42px;
  border: 1px solid #d4b896;
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
  outline: none;
  font-size: 1.05rem;
  font-weight: 600;
}

.pf input:focus {
  border-color: #5A3A24;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.18);
}

.pf .qbtn {
  height: 42px;
  width: 100%;
}

.qbtn.blue.add {
  min-width: 110px;
  padding: 0 12px;
  font-size: 0.92rem;
  background: #5A3A24;
}

.qbtn.yellow {
  background: #ffc107;
  border: 1px solid #e0a800;
  color: #212529;
}

.qbtn.red {
  background: #dc3545;
  color: #fff;
}

.qbtn.blue {
  background: #5A3A24;
  color: #fff;
}

.play-bill-list {
  border: 1px solid #d4b896;
  border-radius: 3px;
  min-height: 140px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  margin-bottom: 10px;
}

.play-bill-row {
  display: grid;
  grid-template-columns: 28px 1.2fr 1fr auto;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #f0e6da;
  align-items: center;
  font-size: 0.9rem;
}

.play-bill-row .type {
  color: #28a745;
  font-weight: 700;
}

.play-bill-row .nums {
  font-weight: 700;
}

.play-bill-row .del {
  border: none;
  background: transparent;
  color: #dc3545;
  cursor: pointer;
}

.play-empty {
  padding: 28px 12px;
  text-align: center;
  color: #78909c;
}

.play-empty.soft {
  background: #fff;
  border-radius: 4px;
}

.play-note {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.play-note input {
  height: 34px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
}

.play-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.play-total {
  font-size: 1.45rem;
  font-weight: 800;
  color: #212529;
}

.play-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.muted {
  color: #78909c;
  font-size: 0.85rem;
}

.play-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.box {
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.box-h {
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 8px 10px;
}

.box-h.red {
  background: #dc3545;
}

.box-h.blue {
  background: #5A3A24;
}

.box-h.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-add {
  border: none;
  background: #fff;
  color: #5A3A24;
  font-weight: 700;
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.8rem;
}

.box-b {
  overflow: auto;
  max-height: 240px;
}

.bet-wrap {
  min-height: 160px;
  max-height: 280px;
  background: #fafbfd;
}

.bet-board {
  padding: 10px;
}

.bet-empty {
  padding: 28px 12px;
  text-align: center;
  color: #90a4ae;
  font-size: 0.9rem;
}

.bet-group {
  margin-bottom: 12px;
}

.bet-group-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #4a2f1c;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e8d9c4;
}

.bet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 3px;
  background: #f0e6da;
  border: 1px solid #d4b896;
  color: #3d2818;
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.chip.live {
  background: #fff8e1;
  border-color: #ffc107;
  color: #e65100;
  box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.35);
  animation: pop 0.12s ease;
}

@keyframes pop {
  from {
    transform: scale(0.92);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

table.data th,
table.data td {
  padding: 6px 7px;
  border-bottom: 1px solid #eee;
  text-align: left;
  white-space: nowrap;
}

table.data th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  position: sticky;
  top: 0;
}

table.data td.empty {
  text-align: center;
  color: #adb5bd;
  padding: 16px;
}

@media (max-width: 1100px) {
  .play-grid {
    grid-template-columns: 1fr;
  }
  .play-form {
    grid-template-columns: 1fr 1fr;
  }
}

/* Banners */
.banner-info {
  background: var(--announce);
  border: 1px solid var(--announce-border);
  border-radius: 4px;
  padding: 10px 12px;
  color: #0c5460;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.banner-info .meta {
  color: #6b4428;
  font-size: 0.8rem;
  margin-top: 4px;
}

.banner-warn {
  background: var(--yellow-bar);
  border: 1px solid #ffeaa0;
  color: #c62828;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 10px;
  margin-bottom: 14px;
  border-radius: 2px;
}

/* Sections */
.sec {
  margin-bottom: 16px;
}

.sec-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #212529;
}

.closed-bar {
  background: var(--pink);
  border: 1px solid #f1b0b7;
  color: var(--pink-text);
  text-align: center;
  font-weight: 700;
  padding: 10px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 310.25px);
  gap: 8px;
  justify-content: start;
}

.card-grid.cols-2 {
  grid-template-columns: repeat(2, 310.25px);
  max-width: none;
}

.card-grid.cols-1 {
  grid-template-columns: 310.25px;
}

/* Lottery cards — match SMLOT shape */
.lcard {
  appearance: none;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: var(--grey-card);
  color: #212529;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  width: 310.25px;
  min-height: 120px;
  height: 120px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto auto 1fr auto;
  column-gap: 8px;
  row-gap: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  align-content: start;
}

.lcard .extra.times {
  min-height: 20px;
}

.lcard .extra .t-note {
  display: none;
}

.lcard .flag {
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 2px;
  line-height: 0;
}

.flag-img {
  display: inline-block;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  vertical-align: middle;
  background: #fff;
}

.lcard .flag-img {
  width: 32px;
  height: 24px;
}

.flag-img.flag-logo,
.lcard .flag-img.flag-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
}

.qb-badge .flag-img,
.qb-timer .flag-img {
  margin-right: 4px;
}

.lcard .name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.lcard .date {
  font-size: 0.82rem;
  color: #495057;
}

.lcard .foot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-size: 0.82rem;
}

.lcard .st-label {
  color: #495057;
}

.lcard .st-val {
  font-weight: 600;
  color: #6c757d;
}

.lcard.is-open {
  background: var(--green);
  border-color: #1e7e34;
  color: #fff;
  cursor: pointer;
}

.lcard.is-open .name,
.lcard.is-open .name small,
.lcard.is-open .date,
.lcard.is-open .extra,
.lcard.is-open .st-label,
.lcard.is-open .st-val,
.lcard.is-open .timer {
  color: #fff !important;
}

.lcard.is-open .name {
  font-weight: 700;
}

.lcard.is-open .extra {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 1;
  margin-top: 2px;
  color: #fff !important;
}

.lcard .extra.times {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  align-items: baseline;
}

.lcard .extra .t-lab {
  font-weight: 500;
  opacity: 0.9;
  margin-right: 4px;
}

.lcard .extra .t-close,
.lcard .extra .t-result {
  white-space: nowrap;
}

.lcard .extra .t-note {
  width: 100%;
  font-size: 0.75rem;
  opacity: 0.95;
}

.lcard.is-open .extra .t-lab,
.lcard.is-urgent .extra .t-lab,
.lcard.is-open .extra .t-close,
.lcard.is-open .extra .t-result,
.lcard.is-urgent .extra .t-close,
.lcard.is-urgent .extra .t-result {
  color: #fff !important;
}

.lcard.is-urgent {
  background: var(--red);
  border-color: #bd2130;
  color: #fff;
}

.lcard.is-urgent .name,
.lcard.is-urgent .name small,
.lcard.is-urgent .date,
.lcard.is-urgent .extra,
.lcard.is-urgent .st-label,
.lcard.is-urgent .st-val,
.lcard.is-urgent .timer {
  color: #fff !important;
}

.lcard.is-closed {
  cursor: default;
}

.lcard.is-closed:hover {
  filter: none;
}

.lcard.is-open:hover,
.lcard.is-urgent:hover {
  filter: brightness(1.05);
}

.placeholder {
  background: #fff;
  border-radius: 6px;
  padding: 20px;
  max-width: 640px;
}

/* ติดต่อ — Discord */
.contact-page {
  max-width: 640px;
  margin: 0 auto;
}

.contact-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 22px 20px 26px;
}

.contact-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: #212529;
}

.contact-lead {
  margin: 0 0 18px;
  color: #6b5344;
  font-size: 0.95rem;
  line-height: 1.5;
}

.discord-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.discord-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(88, 101, 242, 0.45);
}

.discord-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.discord-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.discord-title {
  font-weight: 800;
  font-size: 1.15rem;
}

.discord-sub {
  font-size: 0.88rem;
  opacity: 0.92;
}

.discord-url {
  font-size: 0.8rem;
  opacity: 0.85;
  word-break: break-all;
}

.discord-cta {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .discord-card {
    flex-wrap: wrap;
  }
  .discord-cta {
    width: 100%;
    text-align: center;
  }
}

/* ตรวจรางวัล — ตารางผลตามหมวด */
.check-page {
  max-width: 1100px;
  margin: 0 auto;
}

.check-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.check-sec h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #212529;
}

.check-empty {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #5d4037;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  border-radius: 2px;
}

.check-table-wrap {
  overflow: auto;
  border: 1px solid #cfd8dc;
}

.check-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.check-result-table th {
  background: #5A3A24;
  color: #fff;
  font-weight: 600;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

.check-result-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
  background: #fff;
}

.check-result-table tbody tr:nth-child(even) td {
  background: #f7f9fa;
}

.check-result-table td.left {
  text-align: left;
}

.check-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 3px;
  background: #6b4428;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.check-view-btn:hover {
  background: #4a2f1c;
}

.check-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 16px;
}

.check-modal {
  background: #fff;
  border-radius: 8px;
  width: min(420px, 100%);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.check-modal-wide {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
}

.check-modal-wide .check-modal-body {
  overflow: auto;
}

.check-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #5A3A24;
  color: #fff;
}

.check-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.check-modal-x {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.check-modal-body {
  padding: 16px;
}

.check-modal-nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.check-modal-nums > div {
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 10px 6px;
}

.check-modal-nums span {
  display: block;
  font-size: 0.75rem;
  color: #7a6454;
  margin-bottom: 4px;
}

.check-modal-nums b {
  font-size: 1.3rem;
  color: #c62828;
}

.check-win-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.check-win-head span {
  color: #2e7d32;
  font-weight: 700;
}

.check-win-table-wrap {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: auto;
  max-height: 320px;
}

.check-win-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.check-win-table th {
  background: #eceff1;
  padding: 7px 8px;
  text-align: center;
  position: sticky;
  top: 0;
}

.check-win-table td {
  padding: 7px 8px;
  border-top: 1px solid #eee;
  text-align: center;
}

.check-win-table td.left {
  text-align: left;
}

.check-win-table td.win {
  color: #2e7d32;
  font-weight: 700;
}

.check-win-table td.empty {
  color: #90a4ae;
  padding: 18px;
}

.check-modal-foot {
  padding: 0 16px 16px;
  text-align: right;
}

/* กรอกผลหวย */
.enter-page {
  max-width: 980px;
  margin: 0 auto;
}

.enter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e4d5c8;
  border-radius: 6px;
}

.enter-date-lab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #3d2e24;
}

.enter-sec {
  margin-bottom: 18px;
}

.enter-sec h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #5a3a24;
}

.enter-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4d5c8;
  border-radius: 6px;
  background: #fff;
}

.enter-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.enter-table th,
.enter-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee4db;
  text-align: left;
  vertical-align: middle;
}

.enter-table th {
  background: #f7f1ea;
  color: #5a3a24;
  font-weight: 700;
  white-space: nowrap;
}

.enter-table tr:last-child td {
  border-bottom: none;
}

.enter-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-width: 160px;
}

.enter-inp {
  width: 72px;
  height: 34px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0 8px;
  font: inherit;
  text-align: center;
  letter-spacing: 0.06em;
}

.enter-inp:focus {
  outline: 2px solid #c4a882;
  border-color: #8b6346;
}

.enter-ok {
  color: #1b7a3d;
  font-weight: 700;
  font-size: 0.82rem;
}

.enter-auto {
  color: #b8860b;
  font-weight: 700;
  font-size: 0.82rem;
}

.enter-wait {
  color: #9a7b5f;
  font-size: 0.82rem;
}

.qbtn.gold {
  background: linear-gradient(180deg, #e0c36a, #b8922e);
  color: #1a1408;
  border: 1px solid #9a7820;
  font-weight: 700;
}

@media (max-width: 640px) {
  .enter-inp {
    width: 56px;
  }
}

/* ส่วนลด % / แก้ไขอัตราจ่าย */
.disc-page {
  max-width: 640px;
  margin: 0 auto;
}

.disc-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 18px 20px 22px;
}

.disc-card h1 {
  margin: 0 0 16px;
  font-size: 1.3rem;
  color: #212529;
}

.disc-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.disc-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
}

.pay-member-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
  font-weight: 700;
  color: #5a3a24;
  font-size: 0.9rem;
}

.pay-member-pick select {
  height: 38px;
  max-width: 280px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}

.pay-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
}

.pay-row-head {
  background: transparent;
  border: none;
  padding: 0 12px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b5344;
}

.pay-mini {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8b6346;
  min-width: 1.8rem;
}

.disc-lab {
  font-weight: 700;
  color: #3d2e24;
  font-size: 0.95rem;
}

.disc-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.disc-input-wrap input {
  width: 100%;
  min-width: 72px;
  max-width: 110px;
  height: 36px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0 10px;
  font: inherit;
  text-align: right;
}

@media (max-width: 640px) {
  .pay-row,
  .pay-row-head {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.disc-input-wrap em {
  font-style: normal;
  font-weight: 700;
  color: #6b5344;
}

.disc-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.disc-actions .qbtn {
  min-width: 110px;
  justify-content: center;
}

/* ข้อมูลผู้ใช้ / เพิ่ม user */
.users-page {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.audit-page {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.audit-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px 18px 18px;
}

.audit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.audit-card h1 {
  margin: 0;
  color: #5a3a24;
  font-size: 1.25rem;
}

.audit-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8b6346;
  margin-left: 8px;
}

.audit-table-wrap {
  overflow: auto;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  max-height: min(70vh, 640px);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.audit-table th {
  background: #5a3a24;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}

.audit-table td {
  padding: 8px 10px;
  border-top: 1px solid #eee;
  vertical-align: top;
}

.audit-table td.left {
  text-align: left;
}

.audit-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audit-table td.empty {
  text-align: center;
  color: #90a4ae;
  padding: 24px;
}

.audit-act {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #f1e8df;
  color: #5a3a24;
}

.audit-act.audit-credit_add {
  background: #e8f5e9;
  color: #1b7a3d;
}

.audit-act.audit-credit_sub {
  background: #ffebee;
  color: #c62828;
}

.audit-act.audit-payrate_edit {
  background: #e3f2fd;
  color: #1565c0;
}

.users-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px 18px 18px;
}

.users-card h1,
.users-card h2 {
  margin: 0 0 12px;
  color: #5A3A24;
}

.users-card h1 {
  font-size: 1.25rem;
}

.users-card h2 {
  font-size: 1.05rem;
}

.users-table-wrap {
  overflow: auto;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.users-table th {
  background: #5A3A24;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
}

.users-table td {
  padding: 8px 10px;
  border-top: 1px solid #eee;
}

.users-table td.left {
  text-align: left;
}

.users-table td.empty {
  text-align: center;
  color: #90a4ae;
  padding: 16px;
}

.user-you {
  color: #2e7d32;
  font-style: normal;
  font-weight: 700;
  font-size: 0.78rem;
}

.user-locked {
  color: #90a4ae;
  font-size: 0.8rem;
}

.users-backup-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.users-import-lab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.users-backup-note {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: #8b6346;
  line-height: 1.4;
}

.users-row-actions .qbtn {
  min-width: auto;
  padding: 4px 10px;
  font-size: 0.78rem;
}

.users-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.users-form-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.users-form-row .users-actions {
  margin: 0;
}

.users-credit-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.users-form select,
.user-role-select {
  height: 38px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}

.user-role-select {
  min-width: 120px;
  height: 32px;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .users-form-row {
    grid-template-columns: 1fr;
  }
}

.users-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: #5A3A24;
  font-size: 0.88rem;
}

.users-form input {
  height: 36px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0 10px;
  font: inherit;
  font-weight: 400;
}

.users-actions {
  margin-top: 6px;
}

/* กฎและกติกา */
.rules-page {
  max-width: 920px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 18px 20px 28px;
  color: #3d2e24;
  line-height: 1.65;
}

.rules-hero h1 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  color: #1a237e;
}

.rules-lead {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #5A3A24;
}

.rules-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #eceff1;
}

.rules-section h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  color: #212529;
}

.rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rules-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.92rem;
}

.rules-num {
  font-weight: 800;
  color: #4a2f1c;
}

.rules-body b {
  color: #212529;
}

.rules-important {
  margin-top: 6px;
  padding: 8px 10px;
  background: #fff8e1;
  border-left: 3px solid #f9a825;
  color: #5d4037;
  border-radius: 0 4px 4px 0;
}

.rules-market {
  margin: 14px 0 18px;
  background: #f8fafc;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 12px 14px 10px;
}

.rules-market h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: #3d2818;
}

.rules-market-list {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.88rem;
  color: #5A3A24;
}

.rules-market-list li {
  margin-bottom: 4px;
}

.rules-market-list strong {
  color: #263238;
}

/* ลิงค์ดูผลหวย */
.result-links-page {
  max-width: 1100px;
  margin: 0 auto;
}

.rl-section {
  margin: 16px 0 22px;
}

.rl-section h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #3d2818;
}

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

.result-link-card {
  display: block;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  padding: 12px 14px;
  color: inherit;
}

.result-link-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rl-flag {
  flex: 0 0 auto;
  line-height: 0;
}

.rl-flag .flag-img {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.result-link-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: #4a2f1c;
  line-height: 1.3;
}

.rl-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.84rem;
  margin-bottom: 8px;
  line-height: 1.45;
}

.rl-close {
  color: #c62828;
}

.rl-ok {
  color: #2e7d32;
}

.rl-note {
  color: #6b5344;
}

.rl-urls {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rl-btn {
  display: inline-block;
  font-size: 0.8rem;
  color: #3d2818;
  text-decoration: none;
  background: #f0e6da;
  border: 1px solid #d4b896;
  border-radius: 4px;
  padding: 5px 8px;
  word-break: break-all;
}

.rl-btn:hover {
  background: #e8d9c4;
}

@media (max-width: 700px) {
  .result-link-grid {
    grid-template-columns: 1fr;
  }
}

/* รายการโพย — ตารางแบบต้นแบบ */
.poy-page {
  max-width: 1200px;
  margin: 0 auto;
}

.poy-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.poy-title-row h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #212529;
}

.poy-range-label {
  color: #9c1c28;
  font-weight: 700;
  font-size: 0.95rem;
}

.poy-search {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin-bottom: 14px;
  overflow: hidden;
}

.poy-search-head {
  background: #f1f3f5;
  border-bottom: 1px solid #dee2e6;
  padding: 8px 14px;
  font-weight: 600;
  color: #3d2e24;
  font-size: 0.92rem;
}

.poy-search-body {
  padding: 12px 14px 14px;
}

.poy-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 10px;
}

.poy-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #3d2e24;
  cursor: pointer;
  white-space: nowrap;
}

.poy-radio input {
  accent-color: #5A3A24;
}

.poy-month,
.poy-date {
  height: 34px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 0 10px;
  font: inherit;
  color: #3d2e24;
  background: #fff;
}

.poy-month {
  min-width: 200px;
}

.poy-date {
  width: 130px;
}

.poy-range-sep {
  color: #495057;
  font-size: 0.9rem;
}

.poy-search-body .qbtn.blue {
  min-width: 110px;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
}

.poy-head-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

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

.poy-head h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #212529;
}

.poy-count {
  display: inline-block;
  margin-left: 6px;
  background: #5A3A24;
  color: #fff;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.poy-actions {
  display: flex;
  gap: 8px;
}

.poy-empty {
  background: #fff;
  border: 1px dashed #ced4da;
  border-radius: 6px;
  padding: 28px 16px;
  text-align: center;
  color: #78909c;
}

.poy-table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.poy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  color: #3d2e24;
}

.poy-table th,
.poy-table td {
  border: 1px solid #dee2e6;
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
}

.poy-table thead th {
  background: #f1f3f5;
  font-weight: 600;
  white-space: nowrap;
}

.poy-table td.left,
.poy-table th.left,
.poy-detail-table td.left {
  text-align: left;
}

.poy-table .c-stake,
.poy-detail-table .c-stake {
  color: #28a745;
  font-weight: 600;
}

.poy-table .c-disc,
.poy-detail-table .c-disc {
  color: #dc3545;
  font-weight: 600;
}

.poy-table .c-net,
.poy-detail-table .c-net {
  color: #17a2b8;
  font-weight: 600;
}

.poy-table .c-win {
  color: #5A3A24;
  font-weight: 600;
}

.poy-table .poy-sum-row,
.poy-detail-table .poy-sum-row {
  background: #f8f9fa;
}

.poy-acts {
  white-space: nowrap;
  text-align: left !important;
}

.poy-link {
  border: none;
  background: none;
  color: #5A3A24;
  cursor: pointer;
  font: inherit;
  padding: 0;
  margin-right: 10px;
  text-decoration: none;
}

.poy-link:hover {
  text-decoration: underline;
}

.poy-cancel {
  border: none;
  background: none;
  color: #dc3545;
  cursor: pointer;
  font: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.poy-cancel:hover {
  text-decoration: underline;
}

.poy-trash {
  font-size: 0.95em;
}

.poy-user {
  font-weight: 700;
  color: #5a3a24;
  white-space: nowrap;
}

.poy-badge-user {
  background: #efe6dc !important;
  color: #5a3a24 !important;
}

/* โมดัลรายละเอียดโพย */
.poy-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(33, 37, 41, 0.45);
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 24px;
  overflow: auto;
}

.poy-modal {
  background: #fff;
  border-radius: 4px;
  width: min(920px, 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.poy-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e9ecef;
}

.poy-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.45;
}

.poy-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ffc107;
  color: #212529;
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: middle;
}

.poy-modal-x {
  border: none;
  background: transparent;
  color: #868e96;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.poy-modal-x:hover {
  color: #212529;
}

.poy-modal-body {
  padding: 12px 16px;
  overflow: auto;
}

.poy-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.poy-detail-table th,
.poy-detail-table td {
  border: 1px solid #ced4da;
  padding: 8px 10px;
  text-align: center;
}

.poy-detail-table thead th {
  background: #6c757d;
  color: #fff;
  font-weight: 600;
}

.poy-modal-foot {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 14px;
  border-top: 1px solid #e9ecef;
}

.poy-modal-foot .qbtn.blue {
  min-width: 88px;
  justify-content: center;
}

/* เพิ่มเลขเต็ม / เลขอั้น — การ์ดเหมือนหน้าแทงหวย */
.fullnum-page .lcard.has-full {
  border-color: #d4b896;
  box-shadow: inset 0 0 0 1px #d4b896;
}

.fullnum-page .lcard.is-full-active {
  outline: 2px solid #6b4428;
  outline-offset: 1px;
}

.fullnum-page .lcard.has-full .extra {
  color: #4a2f1c;
  font-weight: 600;
}

.limitnum-page .lcard.has-limit {
  border-color: #ffcc80;
  box-shadow: inset 0 0 0 1px #ffcc80;
}

.limitnum-page .lcard.is-limit-active {
  outline: 2px solid #ef6c00;
  outline-offset: 1px;
}

.limitnum-page .lcard.has-limit .extra {
  color: #e65100;
  font-weight: 600;
}

.limit-editor {
  border-color: #ffcc80;
  box-shadow: 0 2px 8px rgba(239, 108, 0, 0.08);
}

.fullnum-page .card-nums-preview,
.limitnum-page .card-nums-preview {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 0;
  min-height: 0;
  align-content: flex-start;
}

.fullnum-page .card-num-chip,
.limitnum-page .card-num-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  box-sizing: border-box;
}

.fullnum-page .card-num-chip.is-full {
  background: #e8d9c4;
  color: #3d2818;
}

.limitnum-page .card-num-chip.is-limit {
  background: #ffe0b2;
  color: #e65100;
}

.fullnum-page .lcard.is-open .card-num-chip.is-full,
.fullnum-page .lcard.is-urgent .card-num-chip.is-full {
  background: #f0e6da;
  color: #3d2818;
}

.limitnum-page .lcard.is-open .card-num-chip.is-limit,
.limitnum-page .lcard.is-urgent .card-num-chip.is-limit {
  background: #fff3e0;
  color: #e65100;
}

.fullnum-page .card-num-more,
.limitnum-page .card-num-more {
  font-size: 0.72rem;
  color: #78909c;
  font-weight: 600;
  align-self: center;
}

.fullnum-page .lcard.is-open .card-num-more,
.fullnum-page .lcard.is-urgent .card-num-more,
.limitnum-page .lcard.is-open .card-num-more,
.limitnum-page .lcard.is-urgent .card-num-more {
  color: rgba(255, 255, 255, 0.9);
}

/* เฉพาะหน้าเลขเต็ม/อั้น — การ์ดยืดตามจำนวนชิป (ไม่แตะหน้าแทงหวย) */
.fullnum-page .lcard,
.limitnum-page .lcard {
  height: auto;
  min-height: 120px;
}

.saved-panel {
  background: #f5f8fb;
  border: 1px solid #cfd8dc;
  border-radius: 5px;
  padding: 10px 12px;
  margin: 0 0 14px;
}

.saved-panel.is-empty {
  background: #fafafa;
}

.saved-panel-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #37474f;
  margin-bottom: 8px;
}

.saved-count {
  font-weight: 600;
  color: #78909c;
  font-size: 0.8rem;
  margin-left: 6px;
}

.saved-empty {
  font-size: 0.82rem;
  color: #90a4ae;
}

.saved-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: start;
  margin: 4px 0;
}

.saved-type {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b5344;
  padding-top: 2px;
}

.saved-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.saved-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.45;
}

.saved-chip em {
  font-style: normal;
  font-weight: 600;
  opacity: 0.75;
  font-size: 0.75rem;
  margin-left: 1px;
}

.saved-chip.is-full {
  background: #f0e6da;
  color: #3d2818;
  border: 1px solid #d4b896;
}

.saved-chip.is-limit {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.full-editor {
  background: #fff;
  border: 1px solid #d4b896;
  border-radius: 6px;
  padding: 14px 16px;
  margin: 0 0 16px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
}

.full-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.full-editor-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #212529;
}

.full-editor-sub {
  font-size: 0.85rem;
  color: #7a6454;
}

.full-editor-head .qbtn {
  margin-left: auto;
}

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

.full-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3d2e24;
}

.full-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.full-field-opts {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.full-limit-lab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b5344;
}

.full-limit-lab.is-pct {
  color: #e65100;
}

.full-limit-lab.is-pct input {
  width: 58px;
  border-color: #ffcc80;
}

.full-limit-lab input {
  width: 72px;
  height: 28px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 0 6px;
  font: inherit;
  font-weight: 400;
}

.saved-pct {
  margin-left: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e65100;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
}

.confirm-table tr.is-limit-pay td.col-rate,
.confirm-table tr.is-limit-pay td.col-win {
  color: #e65100;
  font-weight: 700;
}

.confirm-table .limit-cut {
  font-weight: 600;
  opacity: 0.85;
}

.full-field-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: #78909c;
}

.full-field-hint code {
  background: #eceff1;
  padding: 1px 4px;
  border-radius: 3px;
}

.full-field textarea {
  font: inherit;
  font-weight: 400;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 56px;
  color: #212529;
}

.full-field textarea:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.full-editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 720px) {
  .full-editor-grid {
    grid-template-columns: 1fr;
  }
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #212529;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  z-index: 50;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ========== QUICK BET ========== */
.qb {
  max-width: 960px;
  margin: 0 auto;
  background: var(--qb-bg);
  border: 2px solid var(--qb-border);
  border-radius: 6px;
  padding: 12px 14px 16px;
}

.qb-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.qb-title {
  margin: 0;
  color: #155724;
  font-size: 1.45rem;
  font-weight: 700;
}

.qb-meta {
  margin: 2px 0 0;
  color: #3d6b45;
  font-size: 0.92rem;
}

.qb-date {
  font-weight: 700;
  color: #155724;
}

.qb-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: #fff;
  border: 1px solid #c3e6cb;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
}

.qb-back {
  margin-bottom: 6px;
}

.qb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.qb-tab {
  border: 1px solid #d6c9a0;
  background: #f5edd8;
  padding: 9px 14px;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
  min-width: 78px;
}

.qb-tab.active {
  background: var(--qb-yellow);
  border-color: #e0a800;
}

.qb-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

.qbtn {
  border: none;
  border-radius: 3px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.qbtn.red {
  background: var(--red);
  color: #fff;
}

.qbtn.yellow {
  background: var(--qb-yellow);
  color: #212529;
  border: 1px solid #e0a800;
}

.qbtn.green {
  background: var(--green);
  color: #fff;
  min-width: 118px;
  height: 40px;
}

.qbtn.blue {
  background: #5A3A24;
  color: #fff;
  min-width: 130px;
  padding: 11px 16px;
  font-size: 1.02rem;
}

.qb-form {
  display: grid;
  grid-template-columns: 110px 118px 88px 88px auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.qf label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: #2b552f;
}

.qf input {
  width: 100%;
  height: 40px;
  border: 1px solid #9bbb9b;
  border-radius: 3px;
  padding: 0 10px;
  background: #fff;
  outline: none;
}

.qf input:focus {
  border-color: #5A3A24;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.18);
}

.qf .qbtn {
  width: 100%;
  height: 40px;
}

.qb-list {
  background: #fff;
  border: 1px solid #b7d4b7;
  border-radius: 3px;
  min-height: 170px;
  max-height: 300px;
  overflow: auto;
  margin-bottom: 10px;
}

.qb-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr auto;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #e8f0e8;
  align-items: center;
}

.qb-row .t {
  color: var(--green);
  font-weight: 700;
  font-size: 0.92rem;
}

.qb-row .n {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.qb-row .del {
  border: none;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 1.05rem;
}

.qb-empty {
  padding: 36px;
  text-align: center;
  color: #6c757d;
}

.qb-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.qb-note input {
  height: 34px;
  border: 1px solid #9bbb9b;
  border-radius: 3px;
  padding: 0 10px;
}

.qb-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.qb-total {
  margin: 4px 0 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: #155724;
}

.qb-timer {
  color: var(--red);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qb-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 1100px) {
  .card-grid {
    grid-template-columns: repeat(2, 310.25px);
  }
  .card-grid.cols-2,
  .card-grid.cols-1 {
    max-width: none;
    grid-template-columns: 310.25px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .qb-form {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== PLAY LAYOUT — exact DevTools frames from real SMLOT =====
   Content row ~1717px | col-6/col-6 ~859px
   Market card 829×108 | Modes bar ~60 | Quick panel 829×325
   Right stack ~859×679
   Text: Prompt 13.824px #373C45 */
html,
body,
.play,
.topnav,
.sidebar {
  font-family: "Prompt", sans-serif !important;
  color: #373c45 !important;
}

.topnav button {
  font-size: 13.824px !important;
  color: #373c45 !important;
  height: 36px !important;
  line-height: 20px !important;
  padding: 8px 10px !important;
}

.main.main-key {
  padding: 8px 15px 16px !important;
  background: #f5f6f8 !important;
  max-width: 1747px !important;
}

.app-shell {
  grid-template-columns: 200px 1fr !important;
}

.play .link-back {
  font-size: 13.824px !important;
  color: #5A3A24 !important;
  margin: 0 0 8px !important;
}

/* Tip: full width ~1717 */
.play .tip-box.tip-block {
  width: 100% !important;
  max-width: 1717px !important;
  box-sizing: border-box !important;
  background: #cce5ff !important;
  border: 1px solid #b8daff !important;
  border-radius: 4px !important;
  padding: 12px 15px !important;
  margin: 0 0 8px !important;
  font-size: 13.824px !important;
  color: #004085 !important;
}

.play .tip-box.tip-block strong {
  display: block !important;
  margin-bottom: 4px !important;
}

.play .tip-box.tip-block ul {
  margin: 0 !important;
  padding-left: 18px !important;
}

.play .tip-box.tip-block li {
  margin: 2px 0 !important;
}

.play .play-remain-bar {
  width: 100% !important;
  max-width: 1717px !important;
  box-sizing: border-box !important;
  height: 26px !important;
  line-height: 26px !important;
  padding: 0 15px !important;
  margin: 0 0 8px !important;
  font-size: 13.824px !important;
  font-weight: 700 !important;
  color: #dc3545 !important;
  background: #e7f1ff !important;
  border-radius: 3px !important;
}

.play .play-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 1717px !important;
}

.play .play-left,
.play .play-right {
  width: 100% !important;
  max-width: 859px !important;
  min-width: 0 !important;
}

.play .play-right {
  min-height: 679px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.play .play-right .box-bills-last {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
}

.play .play-right .box-bills-last .box-b {
  flex: 1 1 auto !important;
  min-height: 140px !important;
  background: #cce5ff !important;
}

/* Market card — 829 × 108 */
.play .qb-market {
  width: 100% !important;
  max-width: 829px !important;
  height: 108px !important;
  min-height: 108px !important;
  max-height: 108px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: #cce5ff !important;
  border: 1px solid #b8daff !important;
  border-radius: 4px !important;
  padding: 12px 14px !important;
  margin: 0 0 8px !important;
}

.play .qb-market-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 8px !important;
}

.play .qb-market-title {
  font-size: 13.824px !important;
  font-weight: 700 !important;
  color: #373c45 !important;
}

.play .qb-date {
  font-size: 13.824px !important;
  color: #373c45 !important;
  line-height: 20px !important;
}

.play .qb-market-bot {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
}

.play .qb-payrate {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13.824px !important;
  color: #373c45 !important;
}

.play .qb-payrate select {
  height: 30px !important;
  font-size: 13px !important;
  border: 1px solid #80bdff !important;
  border-radius: 3px !important;
  background: #e7f1ff !important;
  color: #373c45 !important;
  padding: 0 6px !important;
}

.play .link-detail {
  border: none !important;
  background: transparent !important;
  color: #5A3A24 !important;
  font-size: 13.824px !important;
  cursor: pointer !important;
  padding: 0 !important;
}

.play .qb-flag {
  position: relative !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.play .qb-flag-tag {
  position: absolute !important;
  bottom: -2px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: #000 !important;
  color: #fff !important;
  font-size: 9px !important;
  line-height: 1.1 !important;
  padding: 1px 3px !important;
  white-space: nowrap !important;
}

/* Modes — ~60px bar under market */
.play .play-modes {
  width: 100% !important;
  max-width: 829px !important;
  height: 40px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: stretch !important;
  background: #9fcdff !important;
  border: 1px solid #80bdff !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  margin: 0 0 8px !important;
}

.play .play-mode {
  padding: 0 16px !important;
  height: 100% !important;
  font-size: 13.824px !important;
  color: #373c45 !important;
  border: none !important;
  border-right: 1px solid #80bdff !important;
  background: transparent !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.play .play-mode.active {
  background: #5a8fc7 !important;
  color: #fff !important;
}

/* Quick-bet blue card — กว้าง 829, สูงขั้นต่ำ 325 แล้วขยายตามบิล */
.play .qb-panel,
.play .qb-pink {
  width: 100% !important;
  max-width: 829px !important;
  height: auto !important;
  min-height: 325px !important;
  max-height: none !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  background: #9bc2e6 !important;
  border: 1px solid #6c9bc7 !important;
  border-radius: 4px !important;
  padding: 10px 12px !important;
  margin: 0 !important;
}

.play .qb-panel-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  flex: 0 0 auto !important;
}

.play .qb-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #373c45 !important;
  line-height: 1.2 !important;
}

.play .qb-sub {
  font-size: 13.824px !important;
  color: #373c45 !important;
}

.play .qb-panel-head-right {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
}

.play .qb-cancel,
.play .qbtn.pink.qb-cancel {
  height: 28px !important;
  font-size: 12px !important;
  padding: 0 10px !important;
  background: #e83e8c !important;
  border: 1px solid #d63384 !important;
  color: #fff !important;
  border-radius: 3px !important;
}

.play .type-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin-bottom: 6px !important;
  flex: 0 0 auto !important;
}

.play .type-btn {
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 3px !important;
  background: #e2e6ea !important;
  border: 1px solid #ced4da !important;
  color: #373c45 !important;
  font-weight: 600 !important;
}

.play .type-btn.active {
  background: #ffc107 !important;
  border-color: #e0a800 !important;
  color: #212529 !important;
}

.play .tool-row {
  margin: 0 0 6px !important;
  flex: 0 0 auto !important;
}

.play .tool-row .qbtn.doubles {
  height: 26px !important;
  min-width: 80px !important;
  font-size: 12px !important;
  background: #ffc107 !important;
  border: 1px solid #e0a800 !important;
  color: #212529 !important;
}

.play .num-cards {
  flex: 0 0 auto !important;
  margin: 0 0 6px !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  background: #fff !important;
  border: 1px solid #80bdff !important;
  border-radius: 3px !important;
  padding: 4px 6px !important;
}

.play .num-cards.is-empty,
.play .num-cards[hidden] {
  display: none !important;
}

.play .play-form,
.play .play-form.mode-2,
.play .play-form.mode-3 {
  display: grid !important;
  grid-template-columns: minmax(110px, 1.5fr) 80px minmax(70px, 0.85fr) minmax(70px, 0.85fr) 100px !important;
  gap: 6px !important;
  margin: 0 0 6px !important;
  flex: 0 0 auto !important;
  align-items: end !important;
}

.play .pf label {
  font-size: 12px !important;
  margin-bottom: 2px !important;
  text-align: center !important;
  color: #373c45 !important;
}

.play .pf input,
.play .pf .qbtn {
  height: 30px !important;
  font-size: 13.824px !important;
  box-sizing: border-box !important;
  border-radius: 3px !important;
  width: 100% !important;
}

.play .pf input {
  border: 1px solid #ced4da !important;
  text-align: center !important;
  background: #fff !important;
  color: #373c45 !important;
}

.play .qbtn.green.reverse,
.play .qbtn.blue.reverse,
.play .qbtn.yellow.reverse {
  background: #28a745 !important;
  border: 1px solid #1e7e34 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.play .qbtn.blue.add,
.play .qbtn.red.add {
  background: #5A3A24 !important;
  border: 1px solid #0069d9 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

.play .qb-panel .bills-box,
.play .qb-pink .bills-box {
  flex: 0 0 auto !important;
  width: 100% !important;
  margin: 0 !important;
  background: #fff !important;
  border: 1px solid #80bdff !important;
  border-radius: 3px !important;
  padding: 4px 6px !important;
  min-height: 48px !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.play .qb-panel .bills-box.empty,
.play .qb-panel .bills-box[hidden],
.play .qb-pink .bills-box.empty,
.play .qb-pink .bills-box[hidden] {
  display: block !important;
  visibility: visible !important;
  flex: 0 0 auto !important;
  min-height: 48px !important;
}

.play .slip-card {
  display: grid !important;
  grid-template-columns: 150px minmax(0, 1fr) 34px !important;
  gap: 10px !important;
  align-items: center !important;
  padding: 8px 6px !important;
  border: none !important;
  border-bottom: 1px solid #e3e6ea !important;
  background: transparent !important;
}

.play .slip-card:last-child {
  border-bottom: none !important;
}

.play .slip-meta {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.35 !important;
}

.play .slip-type,
.play .slip-line,
.play .slip-price {
  display: block !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #495057 !important;
  margin: 0 !important;
}

.play .slip-price {
  font-weight: 700 !important;
  color: #212529 !important;
}

.play .slip-type::after,
.play .slip-line::after {
  content: none !important;
}

.play .slip-nums {
  display: flex !important;
  flex-wrap: wrap !important;
  align-content: flex-start !important;
  gap: 2px 10px !important;
  border: 1px solid #ced4da !important;
  border-radius: 3px !important;
  background: #fff !important;
  padding: 8px 10px !important;
  min-height: 44px !important;
  height: auto !important;
}

.play .slip-num {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #212529 !important;
  font-weight: 400 !important;
  cursor: pointer !important;
}

.play .slip-num:hover {
  color: #dc3545 !important;
  text-decoration: line-through !important;
}

.play .slip-num.is-full {
  color: #c62828 !important;
  font-weight: 700 !important;
}

.play .slip-num.is-limit {
  color: #ef6c00 !important;
  font-weight: 700 !important;
}

.hot-full-num {
  display: inline-block;
  margin: 0 4px 2px 0;
  color: #3d2e24;
}

.hot-full-num.is-full {
  color: #c62828;
  font-weight: 700;
}

.hot-full-num.is-limit {
  color: #ef6c00;
  font-weight: 700;
}

.full-alert {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: #b71c1c;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 0 0 12px;
  font-size: 13.824px;
}

.full-alert strong {
  display: block;
  margin-bottom: 6px;
}

.full-alert ul {
  margin: 0;
  padding-left: 18px;
}

.full-alert li {
  margin: 2px 0;
}

.full-alert-more {
  margin-top: 6px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.limit-alert {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  color: #e65100;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 0 0 12px;
  font-size: 13.824px;
}

.limit-alert strong {
  display: block;
  margin-bottom: 6px;
}

.limit-alert ul {
  margin: 0;
  padding-left: 18px;
}

.limit-alert li {
  margin: 2px 0;
}

.play .slip-del {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  border: none !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: #b71c1c !important;
  cursor: pointer !important;
  flex: 0 0 auto !important;
  transition: color 0.15s ease, background 0.15s ease !important;
}

.play .slip-del:hover {
  background: #fdecec !important;
  color: #7f1018 !important;
}

.play .slip-del-ico {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  pointer-events: none !important;
}

/* Outside blue card — note / centered title+total+actions / flag right */
.play .qb-outro {
  margin-top: 12px !important;
  max-width: 829px !important;
  width: 100% !important;
}

.play .play-note {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  gap: 8px !important;
  align-items: center !important;
  margin: 0 0 14px !important;
  font-size: 13.824px !important;
  color: #373c45 !important;
}

.play .play-note input {
  height: 32px !important;
  font-size: 13.824px !important;
  border: 1px solid #ced4da !important;
  border-radius: 3px !important;
  padding: 0 8px !important;
  background: #fff !important;
  color: #373c45 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.play .play-foot {
  position: relative !important;
  display: block !important;
  min-height: 120px !important;
  margin: 0 !important;
  padding: 0 72px 0 0 !important;
}

.play .play-foot-center {
  width: 378px !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  text-align: center !important;
}

.play .play-market-name,
.play .play-market-name.text-center.mb-0 {
  display: block !important;
  width: 378px !important;
  max-width: 100% !important;
  margin: 0 auto 4px !important;
  padding: 0 !important;
  font-size: 1.25rem !important;
  font-weight: 500 !important;
  line-height: 23px !important;
  color: #212529 !important;
  text-align: center !important;
}

.play .play-total {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #212529 !important;
  line-height: 1.4 !important;
  margin: 4px 0 12px !important;
  text-align: center !important;
}

.play .play-foot-right {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  width: 72px !important;
}

.play .play-foot-right .qb-flag.mini {
  width: 48px !important;
}

.play .play-foot-right .qb-flag.mini img {
  width: 40px !important;
  height: auto !important;
  display: block !important;
  margin: 0 auto !important;
}

.play .play-remain {
  color: #dc3545 !important;
  font-weight: 700 !important;
  font-size: 13.824px !important;
  line-height: 1.25 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.play .play-actions {
  display: flex !important;
  gap: 10px !important;
  justify-content: center !important;
  margin: 0 !important;
}

.play .qbtn.wide {
  min-width: 120px !important;
  width: 120px !important;
  height: 38px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 0 12px !important;
}

.play .qbtn.red.wide {
  background: #dc3545 !important;
  border: 1px solid #c82333 !important;
  color: #fff !important;
}

.play .qbtn.purple.wide {
  background: #6f42c1 !important;
  border: 1px solid #5a32a3 !important;
  color: #fff !important;
}

.play .qbtn.blue.wide {
  background: #5A3A24 !important;
  border: 1px solid #0069d9 !important;
  color: #fff !important;
}

.play .play-right .box-h {
  font-size: 13.824px !important;
  padding: 6px 10px !important;
}

.play .play-right .box-h.red {
  background: #6f42c1 !important;
}

.play .play-right .box-h.blue {
  background: #5A3A24 !important;
}

.play .play-right table.data {
  font-size: 12px !important;
  color: #373c45 !important;
}

.play .play-right table.data th,
.play .play-right table.data td {
  padding: 4px 6px !important;
}

.play .play-right table.data tbody tr:nth-child(odd) {
  background: #e7f1ff !important;
}

.side-user,
.side-time {
  font-size: 13.824px !important;
}

.sidebar {
  color: #f5efe8 !important;
}

.side-user {
  color: #fff !important;
  font-weight: 500 !important;
}

.side-time {
  color: #ffe566 !important;
}

.side-demo {
  color: #ffe9b0 !important;
}

.pay-head {
  color: #ffd54f !important;
}

.pay-box th {
  color: #c5cdd6 !important;
}

.pay-box td {
  color: #f1f3f5 !important;
}

.logo {
  padding: 2px 4px !important;
  line-height: 0 !important;
  font-size: 0 !important;
}

.logo img {
  display: block !important;
  width: 100% !important;
  max-width: 160px !important;
  height: auto !important;
  margin: 0 auto !important;
}
