:root {
  --paper: #f4f5fb;
  --ink: #151015;
  --muted: #7a747d;
  --wine: #17090d;
  --wine-2: #2b0e15;
  --gold: #d4af37;
  --cta-gold: #ffd766;
  --cta-green: #23b36f;
  --blue: #0b4ea2;
  --teal: #0fa789;
  --line: rgba(22, 15, 21, 0.12);
  --green: #18a76e;
  --red: #d44747;
  --mobile-header-btn-size: 44px;
  --mobile-footer-space: calc(128px + env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #111;
  color: var(--ink);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, box-shadow 180ms ease, background 180ms ease, filter 180ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 215, 102, 0.72);
  outline-offset: 3px;
}

.phone {
  width: min(100vw, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 18px calc(88px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.98)),
    radial-gradient(circle at 50% -6%, rgba(227,185,75,0.22), transparent 160px),
    var(--paper);
  overflow-x: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: var(--mobile-header-btn-size) 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 52px;
}

.icon-btn {
  width: var(--mobile-header-btn-size);
  height: var(--mobile-header-btn-size);
  min-width: var(--mobile-header-btn-size);
  min-height: var(--mobile-header-btn-size);
  border-radius: 8px;
  background: transparent;
  color: #716b74;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1.35rem;
  font-weight: 800;
}

.icon-btn:nth-last-child(-n + 2) {
  font-size: 1.45rem;
}

.balance {
  display: grid;
  justify-items: start;
  line-height: 1.08;
}

.balance span {
  color: var(--muted);
  font-size: 0.9rem;
}

.balance strong {
  font-size: 1.15rem;
}

.logout-btn {
  height: var(--mobile-header-btn-size);
  min-height: var(--mobile-header-btn-size);
  min-width: 74px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--wine);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 118px;
}

.chip-mark {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, #ffeaa2 0 26%, #c7422c 27% 36%, #ffeaa2 37% 52%, #1f1510 53% 58%, #e3b94b 59%);
  border: 5px solid #f8d66f;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.chip-mark span {
  color: #39140d;
  font-size: 2rem;
  font-weight: 1000;
}

.brand p,
.brand h1 {
  margin: 0;
  text-transform: uppercase;
  line-height: 1;
}

.brand p {
  color: #b63b31;
  font-size: 0.96rem;
  font-weight: 900;
}

.brand h1 {
  font-size: 2.2rem;
  font-weight: 1000;
  color: #5a180f;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

#menuScreen,
#historyScreen,
#colorFunScreen,
#voucherScreen,
#scanScreen {
  padding-bottom: var(--mobile-footer-space);
  scroll-margin-bottom: var(--mobile-footer-space);
}

.login-card {
  display: grid;
  gap: 14px;
  margin: 8px 0 24px;
  padding: 18px;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 24px rgba(23, 9, 13, 0.08);
}

.scan-panel {
  display: grid;
  gap: 14px;
  margin: 16px 0 14px;
  padding: 18px;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line), 0 12px 24px rgba(23, 9, 13, 0.08);
}

.scan-panel h2 {
  margin: 0;
  color: var(--wine);
  font-size: 1.45rem;
}

.scan-panel label {
  display: grid;
  gap: 6px;
}

.scan-panel label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.scan-panel input {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
}

.login-card h2 {
  margin: 0;
  color: var(--wine);
  font-size: 1.5rem;
}

.login-card label {
  display: grid;
  gap: 6px;
}

.login-card label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.login-card input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.login-card button {
  min-height: 54px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--cta-green), #148551);
  color: white;
  font-weight: 1000;
  text-transform: uppercase;
  box-shadow: 0 14px 26px rgba(24, 167, 110, 0.26);
}

.login-card p {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.ticket-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px;
  justify-content: center;
  align-items: baseline;
  width: max-content;
  max-width: 100%;
  margin: 12px auto 22px;
  font-size: clamp(1.15rem, 6vw, 1.7rem);
  color: #302832;
}

.ticket-title span {
  font-weight: 800;
}

.ticket-title strong {
  font-weight: 1000;
  color: var(--wine);
}

.ticket-card {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 0 0 22px;
  padding: 18px;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 28px rgba(23, 9, 13, 0.1);
}

.ticket-card div,
.ticket-result div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.ticket-card span,
.ticket-result span {
  color: var(--muted);
  font-weight: 850;
}

.ticket-card strong,
.ticket-result strong {
  color: var(--ink);
  font-weight: 1000;
  text-align: right;
}

.ticket-card div:first-child strong,
.currency-label,
#lottoTotal {
  color: #0f8a58;
  font-size: clamp(1.15rem, 5vw, 1.45rem);
}

.purchase-btn {
  width: 100%;
  min-height: 70px;
  border-radius: 14px;
  color: #241308;
  text-transform: uppercase;
  font-size: clamp(1.1rem, 6vw, 1.6rem);
  font-weight: 1000;
  background:
    linear-gradient(95deg, rgba(255,255,255,0.36), transparent 36%),
    linear-gradient(180deg, #ffe489, #e0a71d);
  box-shadow: 0 16px 26px rgba(212, 175, 55, 0.34), inset 0 1px 0 rgba(255,255,255,0.42);
}

.purchase-btn:disabled {
  opacity: 0.55;
}

.ticket-message {
  min-height: 44px;
  margin: 14px 0;
  color: #706a74;
  text-align: center;
  font-weight: 850;
}

.ticket-result {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 245, 251, 0.38);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(100%, 360px);
  padding: 34px 22px 24px;
  border: 3px solid #415bd8;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.modal-card h2 {
  margin: 0 0 8px;
  color: #596de6;
  font-size: clamp(1.65rem, 8vw, 2.4rem);
}

.modal-card p {
  margin: 0 0 24px;
  color: #7180ce;
  font-size: clamp(1rem, 4.8vw, 1.3rem);
  font-weight: 800;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-actions button {
  min-height: 68px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--cta-green), #12824e);
  color: white;
  font-size: clamp(1rem, 5vw, 1.3rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.modal-actions button:last-child {
  background: #f4f0f2;
  color: var(--wine);
  box-shadow: inset 0 0 0 1px var(--line);
}

.mode-btn {
  width: 100%;
  min-height: clamp(86px, 18vh, 132px);
  margin: 0 0 22px;
  border-radius: 16px;
  color: white;
  text-transform: uppercase;
  font-size: clamp(1.25rem, 7vw, 2rem);
  font-weight: 1000;
  letter-spacing: 0;
  background:
    linear-gradient(95deg, rgba(255,255,255,0.1), transparent 35%),
    linear-gradient(180deg, var(--wine-2), #0d0507);
  box-shadow: 0 16px 28px rgba(15, 6, 8, 0.22), inset 0 1px 0 rgba(255,255,255,0.14);
}

.result-banner {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  padding: 15px;
  border-radius: 16px;
  color: #251923;
  background:
    linear-gradient(135deg, rgba(227, 185, 75, 0.28), rgba(255, 255, 255, 0.72)),
    white;
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 20px rgba(23, 9, 13, 0.08);
}

.result-banner span,
.category-card span,
.category-view-title span {
  color: #7a6470;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.result-banner strong {
  color: var(--wine);
  font-size: 1.12rem;
  line-height: 1.08;
}

.result-banner p {
  margin: 0;
  color: #6d6570;
  font-size: 0.9rem;
  font-weight: 750;
}

.result-banner-compact {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  gap: 3px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.result-banner-compact span {
  font-size: 0.66rem;
}

.result-banner-compact strong {
  font-size: 0.9rem;
}

.result-banner-compact p {
  font-size: 0.75rem;
  line-height: 1.25;
}

.category-home {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.category-home[hidden],
.category-card[hidden],
.game-list[hidden] {
  display: none;
}

.category-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 142px;
  padding: 18px;
  border-radius: 20px;
  color: white;
  text-align: left;
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 32px rgba(15, 6, 8, 0.2), inset 0 1px 0 rgba(255,255,255,0.16);
}

.category-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -30px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 22px solid rgba(255, 255, 255, 0.13);
}

.category-card span,
.category-card small {
  color: rgba(255,255,255,0.72);
}

.category-card strong {
  font-size: 2rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.category-card small {
  max-width: 250px;
  font-size: 0.92rem;
  font-weight: 800;
}

.category-keno {
  background:
    linear-gradient(130deg, rgba(255,255,255,0.08), transparent 45%),
    linear-gradient(135deg, var(--wine), #6b2430);
}

.category-lotto {
  background:
    linear-gradient(130deg, rgba(255,255,255,0.1), transparent 45%),
    linear-gradient(135deg, var(--blue), var(--teal));
}

.category-color {
  background:
    radial-gradient(circle at 83% 34%, rgba(255,255,255,0.22) 0 18%, transparent 19% 100%),
    linear-gradient(135deg, #0a9d62 0 34%, #a82d44 35% 68%, #7c43c5 69% 100%);
}

.category-voucher {
  background:
    radial-gradient(circle at 82% 28%, rgba(255, 228, 137, 0.3) 0 18%, transparent 19% 100%),
    linear-gradient(135deg, #191b3f 0 34%, #7b1f52 62%, #d28b18 100%);
}

.voucher-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 18px;
  color: white;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,0.22) 0 18%, transparent 19% 100%),
    linear-gradient(135deg, #17060b, #204f9c 48%, #0c9b70);
  box-shadow: 0 18px 32px rgba(15, 6, 8, 0.18);
}

.voucher-hero span,
.voucher-detail-head span {
  display: block;
  color: rgba(255,255,255,0.72);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.voucher-hero strong {
  display: block;
  margin-top: 4px;
  font-size: 1.7rem;
  line-height: 1;
  text-transform: uppercase;
}

.voucher-hero small {
  display: block;
  margin-top: 6px;
  max-width: 260px;
  color: rgba(255,255,255,0.78);
  font-weight: 800;
}

.voucher-hero button,
.voucher-buy-btn {
  min-height: 50px;
  border-radius: 14px;
  padding: 0 16px;
  color: #241308;
  font-weight: 1000;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffe486, #d99b13);
  box-shadow: 0 12px 22px rgba(212, 156, 19, 0.26);
}

.voucher-brand-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.voucher-brand-card {
  display: grid;
  gap: 8px;
  min-height: 122px;
  padding: 12px;
  border-radius: 16px;
  color: white;
  text-align: left;
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 22px rgba(15, 6, 8, 0.12), inset 0 1px 0 rgba(255,255,255,0.18);
}

.voucher-brand-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 18px solid rgba(255,255,255,0.13);
}

.voucher-brand-card .voucher-logo,
.voucher-detail-head .voucher-logo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,0.18);
  color: white;
  font-size: 0.88rem;
  font-weight: 1000;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.voucher-brand-card strong {
  align-self: end;
  font-size: 1rem;
  line-height: 1.05;
}

.voucher-brand-card small {
  color: rgba(255,255,255,0.74);
  font-weight: 850;
}

.voucher-detail-card {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 28px rgba(23, 9, 13, 0.08);
}

.voucher-detail-card[hidden] {
  display: none;
}

.voucher-detail-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.voucher-detail-head .voucher-logo {
  background: linear-gradient(135deg, #19060c, #0f9b6a);
}

.voucher-detail-head span {
  color: var(--muted);
}

.voucher-detail-head strong {
  display: block;
  color: var(--wine);
  font-size: 1.35rem;
}

.voucher-denominations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.voucher-denominations button {
  min-height: 52px;
  border-radius: 12px;
  background: #fff7df;
  color: #241308;
  font-weight: 1000;
  box-shadow: inset 0 0 0 1px #f1c968;
}

.voucher-denominations button.active {
  background: var(--wine);
  color: white;
  box-shadow: 0 10px 18px rgba(35, 7, 13, 0.22);
}

.voucher-buy-btn {
  width: 100%;
  font-size: 1.08rem;
}

.voucher-buy-btn:disabled {
  opacity: 0.48;
}

.voucher-lock-card label {
  display: grid;
  gap: 6px;
  margin: 12px 0 18px;
  text-align: left;
}

.voucher-lock-card label span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.voucher-lock-card input {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  font-weight: 900;
}

.category-view {
  display: grid;
  gap: 14px;
}

.category-view:has(#kenoGameList:not([hidden])) {
  padding: 12px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 225, 110, 0.2) 0 18%, transparent 19% 100%),
    linear-gradient(180deg, rgba(16, 156, 103, 0.08), rgba(181, 45, 70, 0.07)),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(216, 224, 239, 0.9), 0 16px 32px rgba(23, 9, 13, 0.08);
}

.category-view[hidden] {
  display: none;
}

.category-view-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.category-switch-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 5px;
  border-radius: 16px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line), 0 8px 18px rgba(23, 9, 13, 0.06);
}

.category-switch {
  min-height: 48px;
  border-radius: 12px;
  background: transparent;
  color: #5f5963;
  font-weight: 1000;
  text-transform: uppercase;
}

.category-switch.active {
  color: white;
  background: linear-gradient(180deg, #1b77d1, #07966a);
  box-shadow: 0 10px 18px rgba(11, 78, 162, 0.22);
}

.category-view-title button {
  height: var(--mobile-header-btn-size);
  min-height: var(--mobile-header-btn-size);
  min-width: 70px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f7f4f5;
  color: var(--wine);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.category-view-title strong {
  display: block;
  color: var(--wine);
  font-size: 1.32rem;
  line-height: 1;
  text-transform: uppercase;
}

.promo-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 0;
  margin-bottom: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  contain: inline-size;
  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.promo-slider::-webkit-scrollbar {
  display: none;
}

.promo-slider article {
  width: 100%;
  height: clamp(142px, 34vw, 170px);
  min-height: 0;
  padding: 16px;
  border-radius: 18px;
  color: white;
  scroll-snap-align: start;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12), transparent 45%),
    linear-gradient(135deg, var(--wine), #255bd8);
  box-shadow: 0 14px 26px rgba(15, 6, 8, 0.16);
}

.promo-slider article.poster-slide {
  height: clamp(142px, 34vw, 170px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(28, 6, 16, 0.22);
}

.promo-slider span,
.promo-slider strong,
.promo-slider p {
  display: block;
}

.promo-slider span {
  color: rgba(255,255,255,0.72);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.promo-slider strong {
  margin-top: 8px;
  font-size: 1.55rem;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.36);
}

.promo-slider p {
  margin: 10px 0 0;
  color: rgba(255,255,255,0.78);
  font-weight: 750;
  text-shadow: 0 1px 8px rgba(0,0,0,0.26);
}

.mode-btn:active,
.category-card:active,
.category-switch:active,
.purchase-btn:active,
.confirm-draw:active,
.coupon-number:active,
.footer-btn:active {
  transform: scale(0.98);
}

.mode-btn:hover,
.category-card:hover,
.purchase-btn:hover,
.confirm-draw:hover {
  filter: brightness(1.04);
}

.game-list {
  display: grid;
  gap: 10px;
}

.game-list .mode-btn {
  min-height: 64px;
  margin-bottom: 0;
  border-radius: 12px;
  font-size: 0.98rem;
  text-align: left;
  padding: 0 18px;
}

#kenoGameList {
  gap: 12px;
}

#kenoGameList .mode-btn {
  min-height: 74px;
  padding: 0 18px 0 20px;
  border-radius: 18px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 86% 50%, rgba(255, 225, 110, 0.18) 0 20%, transparent 21% 100%),
    radial-gradient(circle at 72% 18%, rgba(26, 228, 141, 0.2) 0 14%, transparent 15% 100%),
    linear-gradient(135deg, #210810 0 36%, #722131 68%, #202064 100%);
  box-shadow: 0 16px 26px rgba(23, 9, 13, 0.18), inset 0 1px 0 rgba(255,255,255,0.16);
}

#kenoGameList .mode-btn::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: inherit;
  background: linear-gradient(180deg, #18c985, #ffe16e, #a972ff);
}

#kenoGameList .mode-btn::after {
  content: "Play";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 54px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #211203;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffe16e, #f2b928);
  box-shadow: 0 8px 16px rgba(204, 139, 16, 0.2);
}

.lotto-entry {
  background:
    linear-gradient(95deg, rgba(255,255,255,0.08), transparent 35%),
    linear-gradient(180deg, #255bd8, #07966a);
}

.purchase-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin: 6px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 18px rgba(23, 9, 13, 0.06);
}

.game-line {
  display: flex;
  gap: 5px;
  align-items: baseline;
  justify-content: center;
  min-width: 0;
  font-size: clamp(1rem, 5vw, 1.4rem);
}

.game-line span,
.game-line strong,
.currency-label {
  color: #302832;
  font-weight: 1000;
  text-transform: uppercase;
}

.currency-label {
  font-size: clamp(0.95rem, 4.4vw, 1.25rem);
  white-space: nowrap;
}

.coupon-card {
  padding: 18px 16px;
  border: 2px solid #5872e6;
  border-radius: 20px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 28px rgba(23, 9, 13, 0.08);
}

.lotto-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 14px 28px rgba(23, 9, 13, 0.08);
}

.lotto-draw-status {
  display: grid;
  gap: 4px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(45, 85, 207, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(37, 91, 216, 0.1), rgba(7, 150, 106, 0.08)),
    #fff;
  box-shadow: 0 12px 24px rgba(35, 28, 31, 0.08);
}

.lotto-draw-status span,
.lotto-draw-status small {
  color: #706a74;
  font-size: 0.78rem;
  font-weight: 900;
}

.lotto-draw-status strong {
  color: var(--wine);
  font-size: 1.12rem;
}

.lotto-draw-status.closed {
  border-color: rgba(207, 63, 87, 0.28);
  background:
    linear-gradient(135deg, rgba(207, 63, 87, 0.12), rgba(211, 145, 34, 0.1)),
    #fff;
}

.lotto-card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.lotto-card-title h2 {
  margin: 0;
  font-size: 1.15rem;
}

.lotto-card-title button,
.lotto-remove {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: white;
  background: linear-gradient(180deg, var(--wine-2), #0d0507);
  font-weight: 900;
}

.lotto-lines {
  display: grid;
  gap: 10px;
}

.lotto-line {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfafb;
}

.lotto-digits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.lotto-digit-slot {
  width: 54px;
  height: 54px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: center;
  color: var(--ink);
  font: inherit;
  font-size: 1.3rem;
  font-weight: 1000;
  box-shadow: 0 4px 10px rgba(20, 14, 22, 0.08);
}

.lotto-digit-slot.active {
  border-color: #2d55cf;
  box-shadow: 0 0 0 4px rgba(45, 85, 207, 0.14);
}

.lotto-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.lotto-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.lotto-price-breakdown {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #e2d8dc;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 215, 102, 0.18), rgba(255,255,255,0.92));
  color: #5f5761;
  font-size: 0.88rem;
}

.lotto-price-breakdown span {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.lotto-price-breakdown strong {
  color: #0f8a58;
  line-height: 1.35;
}

.lotto-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.lotto-keypad button {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--wine);
  font-size: 1.18rem;
  font-weight: 1000;
  box-shadow: 0 5px 12px rgba(20, 14, 22, 0.08);
}

.lotto-keypad button:active,
.lotto-digit-slot:active {
  transform: scale(0.96);
}

.lotto-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lotto-actions button {
  min-height: 42px;
  border-radius: 10px;
  background: #f7f4f5;
  color: var(--wine);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.lotto-actions button:last-child {
  color: white;
  background: linear-gradient(180deg, #255bd8, #07966a);
}

.coupon-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.coupon-header h2 {
  margin: 0;
  color: #2d55cf;
  font-size: clamp(1.05rem, 5.1vw, 1.42rem);
  line-height: 1.08;
  font-weight: 900;
  white-space: nowrap;
}

.coupon-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.coupon-tools button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent),
    linear-gradient(180deg, var(--wine-2), #120509);
  color: white;
  box-shadow: 0 8px 16px rgba(23, 9, 13, 0.18), inset 0 1px 0 rgba(255,255,255,0.16);
}

.coupon-icon-btn::before,
.coupon-icon-btn::after {
  content: "";
  position: absolute;
  display: block;
}

.coupon-icon-btn.quick::before {
  inset: 9px;
  border: 2px solid #ffe16e;
  border-right-color: transparent;
  border-radius: 50%;
}

.coupon-icon-btn.quick::after {
  right: 8px;
  top: 8px;
  width: 0;
  height: 0;
  border-left: 7px solid #ffe16e;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(28deg);
}

.coupon-icon-btn.clear::before {
  left: 11px;
  right: 11px;
  top: 14px;
  height: 15px;
  border: 2px solid #fff;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.coupon-icon-btn.clear::after {
  left: 10px;
  right: 10px;
  top: 9px;
  height: 2px;
  border-radius: 999px;
  background: #ffe16e;
  box-shadow: 8px -3px 0 -1px #ffe16e;
}

.coupon-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.coupon-slot,
.coupon-number {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #211b22;
  border: 3px solid #28232a;
  font-weight: 950;
  box-shadow: 0 4px 10px rgba(20, 14, 22, 0.12);
}

.coupon-slot {
  min-width: 0;
  font-size: clamp(0.95rem, 6vw, 1.5rem);
}

.confirm-draw {
  display: block;
  width: min(180px, 58%);
  min-height: 76px;
  margin: 0 auto;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--cta-green), #12824e);
  color: white;
  text-transform: uppercase;
  font-size: clamp(1rem, 5.4vw, 1.35rem);
  font-weight: 1000;
  box-shadow: 0 14px 24px rgba(24, 167, 110, 0.28);
}

.confirm-draw:disabled {
  opacity: 0.55;
}

.coupon-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 9px;
  margin: 8px 0 12px;
}

.coupon-number {
  border-width: 2px;
  background: rgba(255, 255, 255, 0.45);
  font-size: clamp(0.88rem, 4.8vw, 1.22rem);
}

.coupon-number.selected,
.coupon-slot:not(:empty) {
  background: linear-gradient(180deg, var(--wine-2), #0d0507);
  color: white;
  border-color: var(--wine);
}

.message {
  min-height: 46px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: white;
  color: #3d3841;
  font-weight: 800;
}

.history-panel {
  border-radius: 16px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.wallet-card {
  display: grid;
  gap: 7px;
  min-height: 210px;
  align-content: center;
  margin: 18px 0 14px;
  padding: 22px;
  border-radius: 14px;
  color: white;
  background:
    linear-gradient(110deg, rgba(255,255,255,0.08), transparent 40%),
    linear-gradient(180deg, var(--wine-2), #0d0507);
  box-shadow: 0 16px 28px rgba(15, 6, 8, 0.22);
}

.wallet-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  font-weight: 850;
  text-transform: uppercase;
}

.wallet-card strong {
  font-size: clamp(1.55rem, 8vw, 2.75rem);
  line-height: 1;
}

.wallet-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 750;
}

.wallet-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  margin-bottom: 10px;
  padding: 14px;
  border-radius: 12px;
  color: white;
  background:
    linear-gradient(110deg, rgba(255,255,255,0.08), transparent 45%),
    linear-gradient(180deg, var(--wine-2), #0d0507);
  box-shadow: 0 10px 18px rgba(15, 6, 8, 0.18);
}

.wallet-mini-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wallet-mini-card strong {
  font-size: 1.45rem;
  line-height: 1;
  white-space: nowrap;
}

.history-title span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 850;
}

.history-panel {
  margin-top: 14px;
  padding: 12px;
}

.history-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.history-tab {
  min-height: 42px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f4f5;
  color: #5f5963;
  font-size: clamp(0.62rem, 2.9vw, 0.78rem);
  font-weight: 900;
  text-transform: uppercase;
}

.history-tab.active {
  color: white;
  border-color: var(--wine);
  background: linear-gradient(180deg, var(--wine-2), #0d0507);
  box-shadow: 0 8px 18px rgba(37, 12, 18, 0.2);
}

.history-tab-panel {
  display: none;
}

.history-tab-panel.active {
  display: block;
}

.history-title strong {
  font-size: 0.72rem;
  color: white;
  background: var(--red);
  border-radius: 999px;
  padding: 4px 8px;
}

.history-title strong.connected {
  background: var(--green);
}

.history {
  display: grid;
  gap: 7px;
  padding-bottom: calc(var(--mobile-footer-space) + 18px);
}

.sales-mobile-panel {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 16px 34px rgba(34, 22, 28, 0.08);
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 14px;
}

.sales-mobile-title {
  display: grid;
  gap: 5px;
  min-height: 54px;
  padding: 6px 2px 4px;
}

.sales-mobile-title span,
.sales-agent-card span,
.sales-agent-metrics span,
.sales-topup-form span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

.sales-mobile-title strong {
  color: var(--wine);
  font-size: 1.32rem;
  line-height: 1.28;
}

.sales-welcome {
  margin: 2px 2px 6px;
  color: #4d566c;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
}

.sales-mobile-note {
  margin: 0;
  color: #6d5f68;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.sales-unlock-hint {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(211, 143, 24, 0.26);
  border-radius: 13px;
  background: linear-gradient(135deg, #fff9e8, #fff);
  color: #624b2a;
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.35;
}

.sales-unlock-hint[hidden] {
  display: none;
}

.sales-refresh-btn {
  justify-self: end;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(35, 89, 213, 0.18);
  border-radius: 12px;
  background: #eef5ff;
  color: #2359d5;
  font-weight: 850;
}

.sales-punch-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(211, 143, 24, 0.35);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff9e8, #fff);
}

.sales-punch-panel.punched {
  border-color: rgba(0, 154, 112, 0.28);
  background: linear-gradient(135deg, #e9fff7, #fff);
}

.sales-punch-panel.waiting {
  box-shadow: inset 4px 0 0 rgba(211, 143, 24, 0.9);
}

.sales-punch-panel span,
.sales-punch-panel small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.sales-punch-panel small:empty {
  display: none;
}

.sales-punch-panel strong {
  display: block;
  margin: 3px 0;
  color: var(--wine);
  font-size: 1.05rem;
}

.sales-punch-panel.punched strong {
  color: #008f6a;
}

.sales-punch-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sales-punch-actions button {
  min-height: 44px;
  width: 100%;
  padding: 0 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--cta-gold), #d68b12);
  color: #261306;
  font-weight: 1000;
  text-transform: uppercase;
}

.sales-punch-actions button:disabled {
  color: white;
  background: #00a878;
  opacity: 1;
}

.sales-work-tabs {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f4f7fb;
}

.sales-work-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #4d566c;
  -webkit-text-fill-color: #4d566c;
  font-weight: 850;
  font-size: 0.75rem;
}

.sales-work-tab.active {
  color: #10213f !important;
  -webkit-text-fill-color: #10213f !important;
  border-color: rgba(35, 89, 213, 0.22);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(13, 103, 196, 0.12);
}

.sales-work-tab:disabled {
  opacity: 0.72;
  color: #5f5963;
  -webkit-text-fill-color: #5f5963;
  background: #f8f8fb;
}

.sales-work-tab.locked,
.sales-footer-btn.locked {
  opacity: 1;
  color: #4f5870;
  -webkit-text-fill-color: #4f5870;
  background: #f6f7fb;
  border-color: rgba(211, 143, 24, 0.22);
  cursor: pointer;
}

.sales-work-tab.locked::before,
.sales-footer-btn.locked::before {
  content: "LOCK";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 16px;
  margin-right: 5px;
  border-radius: 999px;
  background: rgba(211, 143, 24, 0.13);
  color: #9d6511;
  font-size: 0.48rem;
  font-weight: 1000;
  letter-spacing: 0;
}

.sales-footer-nav {
  position: sticky;
  left: auto;
  bottom: 0;
  z-index: 13;
  width: 100%;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  align-self: end;
  min-height: auto;
  margin-top: 12px;
  padding: 8px 9px calc(8px + env(safe-area-inset-bottom));
  border: 1px solid rgba(22, 15, 21, 0.08);
  border-radius: 18px 18px 0 0;
  background: rgba(250, 251, 255, 0.98);
  box-shadow: 0 -10px 24px rgba(24, 22, 29, 0.1);
  transform: none;
}

body.sales-mobile-mode .sales-footer-nav {
  display: grid;
}

.sales-footer-btn {
  height: 46px;
  min-height: 46px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f2f5fb;
  color: #4f5870;
  -webkit-text-fill-color: #4f5870;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.64rem, 2.9vw, 0.74rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(22, 15, 21, 0.04);
}

.sales-footer-btn.active {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(180deg, var(--wine-2), #0d0507);
  box-shadow: 0 8px 16px rgba(23, 9, 13, 0.2);
}

.sales-footer-btn:disabled {
  opacity: 0.5;
  color: #5f5963;
  -webkit-text-fill-color: #5f5963;
  background: #f2f1f5;
}

.sales-work-panel {
  display: none;
}

.sales-work-panel.active {
  display: grid;
  gap: 10px;
}

.sales-agent-list {
  display: grid;
  gap: 10px;
}

.sales-today-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sales-today-summary:empty {
  display: none;
}

.sales-today-summary article,
.sales-agent-controls {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #effbfb);
  box-shadow: 0 8px 18px rgba(21, 40, 64, 0.06);
}

.sales-today-summary article {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
}

.sales-today-summary span,
.sales-agent-controls span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.sales-today-summary strong {
  color: var(--ink);
  font-size: 1.12rem;
  white-space: nowrap;
}

.sales-agent-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
}

.sales-agent-controls label {
  display: grid;
  gap: 5px;
}

.sales-agent-controls input,
.sales-agent-controls select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  font-weight: 850;
  background: #fff;
}

.sales-agent-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fcff, #fff);
}

.sales-agent-card.expanded {
  border-color: rgba(10, 128, 181, 0.55);
  box-shadow: 0 12px 28px rgba(10, 128, 181, 0.12);
}

.sales-agent-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  align-items: center;
}

.sales-agent-summary > div {
  min-width: 0;
}

.sales-agent-summary > div:not(:first-child) {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 5px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(45, 79, 172, 0.12);
  border-radius: 12px;
  background: #fff;
}

.sales-agent-summary button {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  background: #eef5ff;
  color: #2359d5;
  font-weight: 850;
}

.sales-agent-details {
  display: grid;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sales-agent-details[hidden] {
  display: none;
}

.sales-agent-card strong,
.sales-agent-card b,
.sales-money {
  overflow-wrap: normal;
  word-break: normal;
}

.sales-money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.98rem, 3.2vw, 1.08rem);
}

.sales-money small {
  display: block;
  white-space: nowrap;
}

.sales-agent-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sales-agent-metrics div,
.sales-agent-summary > div:not(:first-child) {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.sales-agent-metrics div strong,
.sales-agent-summary > div:not(:first-child) b {
  justify-self: start;
  text-align: left;
}

.sales-agent-summary > .sales-agent-quick-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.sales-agent-quick-metrics > div {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(45, 79, 172, 0.12);
  border-radius: 12px;
  background: #fff;
}

.sales-agent-quick-metrics span {
  font-size: 0.68rem;
  line-height: 1;
}

.sales-agent-quick-metrics .sales-money {
  justify-self: end;
  font-size: clamp(0.84rem, 3.6vw, 0.98rem);
  text-align: right;
}

.sales-agent-metrics small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: none;
}

.sales-card-action {
  min-height: 44px;
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cta-green), #008f6a);
  color: white;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(0, 154, 112, 0.18);
}

.sales-card-action:disabled {
  opacity: 0.72;
}

.sales-proof-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(0, 154, 112, 0.16);
  border-radius: 12px;
  background: linear-gradient(135deg, #f2fff9, #fff);
}

.sales-proof-fields label {
  display: grid;
  gap: 5px;
}

.sales-proof-fields input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  background: #fff;
  font-weight: 850;
}

.sales-signature-pad {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(45, 79, 172, 0.14);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
}

.sales-signature-pad span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sales-signature-pad canvas {
  display: block;
  width: 100%;
  height: 128px;
  border: 1px dashed rgba(23, 9, 13, 0.26);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.96)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(45, 79, 172, 0.07) 32px);
  touch-action: none;
  cursor: crosshair;
}

.sales-signature-pad.signed canvas {
  border-color: rgba(24, 167, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(24, 167, 110, 0.08);
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
}

.signature-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f2f5fb;
  color: #4f5870;
  font-size: 0.76rem;
  font-weight: 850;
}

.compact-signature-pad {
  padding: 8px;
}

.compact-signature-pad canvas {
  height: 112px;
}

.deployment-mobile-card {
  border-left: 4px solid var(--cyan);
}

.deployment-mobile-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  min-width: 0;
}

.deployment-mobile-summary > div {
  min-width: 0;
}

.deployment-mobile-summary strong {
  color: var(--wine);
  font-size: 0.98rem;
  line-height: 1.18;
}

.deployment-mobile-summary span,
.deployment-mobile-summary small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.2;
}

.deployment-mobile-summary b {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(16, 144, 104, 0.1);
  color: #087657;
  font-size: 0.76rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.deployment-mobile-summary small {
  grid-column: 1 / 2;
}

.deployment-mobile-summary button {
  grid-column: 2;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(45, 79, 172, 0.1);
  color: #2455d7;
  font-weight: 1000;
}

.deployment-mobile-details {
  display: grid;
  gap: 10px;
}

.deployment-mobile-facts {
  display: grid;
  gap: 0;
  border: 1px solid rgba(45, 79, 172, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: #fbfdff;
}

.deployment-mobile-facts div {
  display: grid;
  grid-template-columns: minmax(72px, 0.35fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(22, 15, 21, 0.08);
}

.deployment-mobile-facts div:last-child {
  border-bottom: 0;
}

.deployment-mobile-facts span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.deployment-mobile-facts strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.deployment-mobile-facts small {
  grid-column: 2;
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sales-field-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #f7fbff);
}

.sales-field-form label {
  display: grid;
  gap: 5px;
}

.sales-field-form span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.sales-field-form input,
.sales-field-form select,
.sales-field-form textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  background: #fff;
  font: inherit;
  font-weight: 850;
  text-overflow: ellipsis;
}

.sales-field-form textarea {
  min-height: 92px;
  padding-top: 10px;
  resize: vertical;
}

.sales-wide-field,
.sales-form-section-title,
.sales-field-form > button[type="submit"],
.sales-form-message {
  grid-column: 1 / -1;
}

.sales-form-section-title {
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(22, 15, 21, 0.08);
  color: #10213f;
  font-size: 0.96rem;
  line-height: 1.1;
}

.sales-field-form .sales-form-section-title:first-child {
  padding-top: 0;
  border-top: 0;
}

.sales-secondary-btn,
.sales-field-form > button[type="submit"] {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.sales-secondary-btn {
  color: var(--blue);
  background: #eef5ff;
  border: 1px solid var(--line);
}

.sales-field-form > button[type="submit"] {
  color: white;
  background-color: #255bd8;
  background: linear-gradient(135deg, #255bd8, #1098ad);
  box-shadow: 0 12px 22px rgba(37, 91, 216, 0.18);
}

#salesAgreementForm > button[type="submit"] {
  color: #fff;
  -webkit-text-fill-color: #fff;
  background-color: #255bd8;
  background-image: linear-gradient(135deg, #255bd8, #1098ad);
}

.sales-field-form > button[type="submit"]:disabled {
  color: #fff;
  background: #9b9298;
  box-shadow: none;
}

.sales-form-message {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-weight: 850;
}

.sales-agreement-next-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.sales-agreement-next-actions button {
  min-height: 42px;
  border-radius: 12px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, #255bd8, #1098ad);
  box-shadow: 0 10px 20px rgba(37, 91, 216, 0.16);
}

.sales-agreement-next-actions button:first-child {
  background: linear-gradient(135deg, #00a36f, #1098ad);
}

.sales-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.sales-history-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sales-history-main strong {
  text-transform: capitalize;
}

.sales-history-row span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
  text-transform: none;
}

.sales-activity-card {
  gap: 4px;
}

.sales-activity-card div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.sales-activity-card p {
  margin: 0;
  color: #5e6476;
  font-weight: 800;
}

.mobile-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 50;
  padding: 12px 14px;
  border-radius: 14px;
  color: #fff;
  font-weight: 950;
  text-align: center;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  transform: translateY(24px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mobile-toast.success {
  background: linear-gradient(135deg, #009a70, #0a8bb8);
}

.mobile-toast.error {
  background: linear-gradient(135deg, #c22f4b, #8a1630);
}

.sales-topup-form,
.sales-collection-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
}

.sales-topup-form label,
.sales-collection-form label {
  display: grid;
  gap: 5px;
}

.color-game-hero,
.color-bet-card,
.color-result-card {
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(23, 9, 13, 0.08), inset 0 0 0 1px var(--line);
}

.color-game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 8px 0 14px;
  padding: 20px;
  color: white;
  background:
    radial-gradient(circle at 86% 20%, rgba(255,255,255,0.25) 0 14%, transparent 15% 100%),
    radial-gradient(circle at 70% 82%, rgba(255,255,255,0.13) 0 14%, transparent 15% 100%),
    linear-gradient(135deg, #109c67 0 34%, #b52d46 35% 68%, #6d48ca 69% 100%);
  overflow: hidden;
}

.color-hero-copy {
  display: grid;
  gap: 5px;
}

.color-hero-copy small {
  color: rgba(255,255,255,0.82);
  font-weight: 900;
}

.color-hero-balls {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 6px;
}

.color-hero-balls b,
.color-mini-ball {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  font-size: 0.82rem;
  font-weight: 1000;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.28), 0 8px 16px rgba(0,0,0,0.18);
}

.color-hero-balls .green,
.color-mini-ball.green { background: linear-gradient(180deg, #18c985, #05734e); }
.color-hero-balls .red,
.color-mini-ball.red { background: linear-gradient(180deg, #ff4c68, #89182d); }
.color-hero-balls .violet,
.color-mini-ball.violet { background: linear-gradient(180deg, #a972ff, #4c2c94); }

.color-timer-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.13);
}

.color-timer-panel span {
  font-size: 0.9rem;
  font-weight: 850;
}

.color-timer-panel strong {
  color: #ffe16e;
  font-size: 1.4rem;
  line-height: 1;
  text-transform: uppercase;
}

.color-timer-panel i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
}

.color-timer-panel i::before {
  content: "";
  display: block;
  width: var(--color-timer-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1ae48d, #ffe16e);
  transition: width 0.25s ease;
}

.color-timer-panel i.closing::before {
  background: linear-gradient(90deg, #ffe16e, #ff4c68);
}

.color-game-hero span,
.color-bet-header small {
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
  opacity: 0.82;
}

.color-game-hero strong {
  font-size: 1.72rem;
  line-height: 1.05;
}

.color-game-hero p {
  margin: 0;
  font-weight: 900;
}

.color-bet-card,
.color-result-card,
.color-rules-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
}

.color-bet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.color-bet-header small {
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff4d1;
  color: #8a5a06;
  opacity: 1;
}

.color-bet-header small.closing {
  background: #ffe2e8;
  color: #b51f3c;
}

.color-bet-card h2,
.color-result-card h2,
.color-rules-card h2 {
  margin: 0;
  font-size: 1rem;
}

.color-rules-card {
  border-radius: 18px;
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px #ead8af, 0 12px 28px rgba(72, 42, 9, 0.08);
}

.color-rules-card summary {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 14px;
  color: #201103;
  background: linear-gradient(180deg, #ffe16e, #f2b928);
  box-shadow: 0 10px 18px rgba(204, 139, 16, 0.18);
  cursor: pointer;
  font-weight: 1000;
  list-style: none;
  text-transform: uppercase;
}

.color-rules-card summary::-webkit-details-marker {
  display: none;
}

.color-rules-card summary::after {
  content: "Show game rules";
  margin-top: 2px;
  color: rgba(32, 17, 3, 0.72);
  font-size: 0.66rem;
  font-weight: 900;
}

.color-rules-card[open] summary::after {
  content: "Hide game rules";
}

.color-rules-card[open] .color-rule-grid {
  margin-top: 12px;
}

.color-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.color-rule-grid article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: #fff8de;
  box-shadow: inset 0 0 0 1px rgba(211, 143, 24, 0.18);
}

.color-rule-grid span,
.color-rule-grid small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.color-rule-grid strong {
  font-size: 1rem;
  color: #241016;
}

.color-rule-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #554951;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.color-picks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.color-pick,
.color-number,
.color-slip > button {
  min-height: 52px;
  border-radius: 14px;
  font-weight: 1000;
}

.color-pick {
  display: grid;
  gap: 4px;
  align-content: center;
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.color-pick span {
  font-size: 1.05rem;
}

.color-pick small {
  font-size: 0.68rem;
  opacity: 0.78;
}

.color-pick em,
.color-section-title small {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 3px 12px;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 1000;
  color: rgba(255,255,255,0.96);
  background: rgba(255,255,255,0.18);
}

.color-pick.green { background: linear-gradient(180deg, #11a96b, #05734e); }
.color-pick.red { background: linear-gradient(180deg, #d53d56, #89182d); }
.color-pick.violet { background: linear-gradient(180deg, #8858d8, #4c2c94); }

.color-pick.active,
.color-number.active {
  outline: 3px solid rgba(240, 190, 56, 0.88);
  outline-offset: 2px;
}

.color-pick:disabled,
.color-number:disabled {
  opacity: 0.48;
}

.color-number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.color-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-section-title small {
  min-height: 22px;
  color: #fff;
  background: linear-gradient(135deg, #7a4ee0, #4d2bb5);
}

.color-number {
  background: #f7f8fc;
  color: #171a24;
  box-shadow: inset 0 0 0 1px #d8e0ef;
}

.color-number.green {
  color: white;
  background: linear-gradient(180deg, #12b86f, #07884f);
}

.color-number.red {
  color: white;
  background: linear-gradient(180deg, #ff465d, #cc2039);
}

.color-number.violet {
  color: white;
  background: linear-gradient(180deg, #df42f2, #9b23d8);
}

.color-number.red.violet {
  background: linear-gradient(90deg, #df42f2 0 50%, #ff465d 50% 100%);
}

.color-number.green.violet {
  background: linear-gradient(90deg, #12b86f 0 50%, #df42f2 50% 100%);
}

.color-combo-box {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.color-combo-help {
  margin: -8px 0 -2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.color-combo-box select,
.color-combo-box button {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid #d8e0ef;
  background: #f7f8fc;
  color: #171a24;
  padding: 0 12px;
  font: inherit;
  font-weight: 1000;
}

.color-combo-box button {
  color: #fff;
  background: linear-gradient(135deg, #241016, #774a18);
}

.color-combo-box button.active {
  outline: 3px solid rgba(240, 190, 56, 0.88);
  outline-offset: 2px;
}

.color-combo-box button:disabled {
  opacity: 0.48;
}

@media (max-width: 430px) {
  .color-rule-grid {
    grid-template-columns: 1fr;
  }

  .color-combo-box {
    grid-template-columns: 1fr 1fr;
  }

  .color-combo-box button {
    grid-column: 1 / -1;
  }
}

.color-slip {
  position: sticky;
  bottom: var(--mobile-footer-space);
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px;
  margin: 2px -4px -4px;
  border-radius: 18px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 -10px 24px rgba(23, 9, 13, 0.1), inset 0 0 0 1px rgba(216, 224, 239, 0.8);
}

.color-slip > div,
.color-slip label {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #dce4f0;
}

.color-slip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.color-slip input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 1000;
}

.color-amount-field {
  align-content: stretch;
}

.color-amount-stepper {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.color-amount-stepper button,
.color-amount-presets button {
  min-height: 34px;
  border-radius: 10px;
  color: #201103;
  background: #ffe16e;
  font-weight: 1000;
}

.color-amount-presets {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.color-amount-presets button {
  min-height: 36px;
  background: #fff8d7;
  box-shadow: inset 0 0 0 1px rgba(211, 143, 24, 0.22);
  font-size: 0.76rem;
}

.color-amount-presets button.active {
  color: #fff;
  background: linear-gradient(180deg, #241016, #0d0507);
}

.color-slip > button {
  grid-column: 1 / -1;
  color: #201103;
  background: linear-gradient(180deg, #ffe16e, #f2b928);
  box-shadow: 0 12px 22px rgba(204, 139, 16, 0.24);
}

.color-slip > button:disabled {
  color: #f5f2f4;
  background: #8a8288;
  box-shadow: none;
}

.color-result-pill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  color: white;
  background: #261015;
}

.color-result-pill.green { background: linear-gradient(135deg, #0a9661, #045539); }
.color-result-pill.red { background: linear-gradient(135deg, #d33751, #7b1428); }
.color-result-pill.violet { background: linear-gradient(135deg, #8050d4, #45247d); }

.color-result-pill strong {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  font-size: 1.45rem;
}

.color-result-pill span {
  font-weight: 1000;
}

.color-result-pill small {
  opacity: 0.78;
}

.color-latest-result {
  display: grid;
  gap: 8px;
}

.color-result-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.color-mini-result {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 4px;
  border-radius: 13px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #dce4f0;
  text-align: center;
}

.color-mini-result span,
.color-mini-result small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-mini-result span {
  color: #171a24;
}

.color-bet-history {
  display: grid;
  gap: 8px;
}

.color-bet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #dce4f0;
}

.color-bet-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.color-bet-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-bet-row small {
  color: #7c8497;
  font-size: 0.72rem;
  font-weight: 800;
}

.color-bet-row span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

@media (max-width: 520px) {
  #menuScreen,
  #historyScreen,
  #colorFunScreen,
  #scanScreen {
    padding-bottom: calc(var(--mobile-footer-space) + 22px);
  }

  .promo-slider article,
  .promo-slider article.poster-slide {
    height: clamp(138px, 38vw, 158px);
  }

  .color-game-hero {
    padding: 16px;
  }

  .color-picks,
  .color-slip {
    grid-template-columns: 1fr;
  }
}

.sales-topup-form input,
.sales-collection-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  font: inherit;
  font-weight: 850;
}

.sales-topup-form button,
.sales-collection-form button,
.sales-invoice-actions button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--cta-gold), #d68b12);
  color: #261306;
  font-weight: 1000;
  text-transform: uppercase;
}

.sales-invoice-list {
  display: grid;
  gap: 9px;
}

.sales-invoice-list h3 {
  margin: 4px 0 0;
  color: var(--wine);
  font-size: 1rem;
}

.sales-invoice-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f7fbff);
}

.sales-invoice-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.sales-invoice-title,
.sales-invoice-date {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sales-invoice-title strong,
.sales-invoice-date strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-invoice-top-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(78px, auto));
  gap: 6px;
}

.sales-invoice-top-metrics div {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(45, 79, 172, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
}

.sales-invoice-top-metrics span,
.sales-invoice-date span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.sales-invoice-top-metrics strong {
  white-space: nowrap;
}

.sales-invoice-status {
  justify-self: end;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(24, 167, 110, 0.1);
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.sales-invoice-summary button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  background: linear-gradient(180deg, #315be1, #6940cd);
  color: #fff;
  font-weight: 1000;
}

.sales-invoice-body {
  display: grid;
  gap: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(45, 79, 172, 0.12);
}

.sales-invoice-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sales-invoice-metrics div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(45, 79, 172, 0.14);
}

.sales-invoice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sales-invoice-actions button:nth-child(2) {
  background: linear-gradient(180deg, #315be1, #6940cd);
  color: #fff;
}

.sales-topup-message {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-weight: 850;
}

.purchase-history-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  max-width: 100%;
  overflow: hidden;
}

.purchase-history-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.purchase-history-controls label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.purchase-history-controls input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-weight: 850;
}

.purchase-history-controls > strong {
  min-width: 0;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--wine);
  background: #f1eef1;
  font-weight: 1000;
  white-space: nowrap;
}

.purchase-category-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.purchase-category-tab {
  min-height: 52px;
  border-radius: 999px;
  background: #e7e4e8;
  color: #77717a;
  font-weight: 1000;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(22, 15, 21, 0.06);
}

.purchase-category-tab.active {
  color: white;
  background: linear-gradient(180deg, var(--wine-2), #0d0507);
  box-shadow: 0 10px 18px rgba(23, 9, 13, 0.24);
}

.history-ticket-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 22px rgba(23, 9, 13, 0.08);
}

.history-ticket-card header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  color: white;
  background:
    linear-gradient(95deg, rgba(255,255,255,0.08), transparent 36%),
    linear-gradient(180deg, var(--wine-2), #0d0507);
}

.history-ticket-card header span {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 900;
}

.history-ticket-card header strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font-weight: 1000;
}

.history-ticket-card div {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  align-items: start;
  padding: 10px 14px;
}

.history-ticket-card div span {
  color: #a59ea8;
  font-weight: 850;
}

.history-ticket-card div strong {
  color: #312b34;
  text-align: right;
  overflow-wrap: anywhere;
  font-weight: 950;
}

.usage-summary {
  display: grid;
  gap: 12px;
}

.summary-filter-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  max-width: 100%;
  overflow: hidden;
}

.summary-filter-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.summary-filter-controls label span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-filter-controls input,
.summary-filter-controls button {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  border-radius: 11px;
  font: inherit;
  font-weight: 900;
}

.summary-filter-controls input {
  min-width: 0;
  border: 1px solid var(--line);
  padding: 0 9px;
  color: var(--ink);
  background: white;
}

.summary-filter-controls button {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 8px 16px rgba(0, 122, 167, 0.18);
}

.summary-filter-controls button:last-child {
  color: var(--wine);
  border: 1px solid var(--line);
  background: #f7f4f5;
  box-shadow: none;
}

.summary-rate-pill {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(39, 174, 96, 0.22);
  border-radius: 14px;
  color: #075d3a;
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.12), rgba(255, 215, 0, 0.12));
}

.summary-rate-pill span {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.summary-rate-pill strong {
  font-size: 1.05rem;
  font-weight: 1000;
}

.summary-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 18px rgba(23, 9, 13, 0.06);
}

.summary-block h2 {
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--wine);
  text-align: center;
  font-size: 1.18rem;
  text-transform: uppercase;
}

.summary-overall h2 {
  color: #0f8a58;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(22, 15, 21, 0.08);
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row span {
  color: #3f3942;
  font-weight: 850;
}

.summary-row strong {
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  font-weight: 1000;
}

.round {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.round span {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.round span b {
  color: var(--ink);
  font-weight: 800;
}

.round span small {
  color: var(--muted);
  font-size: 0.76rem;
}

.round strong {
  color: var(--ink);
  white-space: nowrap;
}

.round strong.amount-win {
  color: var(--green);
}

.round strong.amount-debit {
  color: var(--red);
}

.footer-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(100vw, 480px);
  padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(244, 245, 251, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.footer-nav[hidden],
body.sales-mobile-mode .footer-nav,
body.sales-mobile-mode #backBtn {
  display: none !important;
}

body.sales-mobile-mode .phone {
  padding-top: 10px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

body.sales-mobile-mode #salesScreen {
  display: grid;
  grid-template-rows: auto auto;
  min-height: calc(100vh - 20px);
  padding-bottom: 0;
}

body.sales-mobile-mode .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
}

body.sales-mobile-mode .balance {
  min-width: 0;
}

body.sales-mobile-mode .balance span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.sales-mobile-mode .balance strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.sales-mobile-mode .logout-btn {
  height: var(--mobile-header-btn-size);
  min-height: var(--mobile-header-btn-size);
  min-width: 74px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.68rem;
}

body.sales-mobile-mode .brand {
  min-height: 48px;
  justify-content: flex-start;
}

body.sales-mobile-mode .chip-mark {
  width: 38px;
  height: 38px;
  border-width: 3px;
}

body.sales-mobile-mode .chip-mark span {
  font-size: 1.05rem;
}

body.sales-mobile-mode .brand p {
  font-size: 0.62rem;
}

body.sales-mobile-mode .brand h1 {
  font-size: 1.35rem;
}

body.login-mode .topbar {
  display: none;
}

.footer-btn {
  min-height: 56px;
  border-radius: 14px;
  background: transparent;
  color: #5f5963;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.footer-btn.active {
  background: linear-gradient(180deg, var(--wine-2), #0d0507);
  color: white;
  box-shadow: 0 10px 20px rgba(23, 9, 13, 0.18);
}

.purchase-effect {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(244, 245, 251, 0.18);
}

.purchase-effect[hidden] {
  display: none;
}

.effect-ring {
  width: min(74vw, 260px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 50%;
  color: white;
  background:
    radial-gradient(circle, rgba(255,255,255,0.18) 0 26%, transparent 27%),
    linear-gradient(180deg, #2b0e15, #0d0507);
  box-shadow: 0 0 0 0 rgba(227, 185, 75, 0.75), 0 24px 70px rgba(0, 0, 0, 0.28);
  transform: scale(0.5);
  opacity: 0;
}

.purchase-effect.win .effect-ring {
  background:
    radial-gradient(circle, rgba(255,255,255,0.26) 0 26%, transparent 27%),
    linear-gradient(180deg, #f0bf45, #138458);
  color: #11160f;
}

.purchase-effect.win .effect-ring span {
  color: rgba(17, 22, 15, 0.72);
}

.purchase-effect.win .spark {
  width: 16px;
  height: 16px;
}

.effect-ring span {
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.effect-ring strong {
  font-size: clamp(2rem, 12vw, 3.4rem);
  line-height: 1;
}

.purchase-effect.play .effect-ring {
  animation: purchase-pop 1200ms ease forwards;
}

.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
}

.purchase-effect.play .spark {
  animation: spark-fly 900ms ease-out forwards;
}

.s1 { --x: -135px; --y: -130px; background: #e3b94b; }
.s2 { --x: 132px; --y: -118px; background: #2d55cf; }
.s3 { --x: -150px; --y: 86px; background: #0b8f5b; }
.s4 { --x: 142px; --y: 105px; background: #c7422c; }
.s5 { --x: 0px; --y: -170px; background: #e3b94b; }
.s6 { --x: 0px; --y: 165px; background: #2d55cf; }

@keyframes purchase-pop {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-8deg);
    box-shadow: 0 0 0 0 rgba(227, 185, 75, 0.75), 0 24px 70px rgba(0, 0, 0, 0.28);
  }
  22% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }
  55% {
    opacity: 1;
    transform: scale(1) rotate(0);
    box-shadow: 0 0 0 26px rgba(227, 185, 75, 0), 0 24px 70px rgba(0, 0, 0, 0.28);
  }
  100% {
    opacity: 0;
    transform: scale(0.86);
  }
}

@keyframes spark-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.25);
  }
}

.receipt {
  width: min(100%, 360px);
  margin: 0 auto 18px;
  padding: 20px 20px 12px;
  background: #f7f7f4;
  color: #191919;
  font-family: "Courier New", ui-monospace, monospace;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.receipt-logo {
  text-align: center;
  font-family: Georgia, serif;
  font-weight: 900;
  margin-bottom: 16px;
}

.receipt-meta {
  display: grid;
  gap: 5px;
  font-size: 0.83rem;
}

.receipt-meta div,
.ticket-id {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.receipt-meta strong,
.ticket-id strong {
  font-weight: 500;
}

.ticket-id {
  margin: 16px 0;
  padding-top: 10px;
  border-top: 1px dashed #999;
  font-size: 0.92rem;
}

.receipt h2 {
  margin: 0 0 8px;
  font-size: 1.04rem;
}

.receipt-picks {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.receipt-pick-line {
  display: flex;
  justify-content: center;
  gap: 7px;
  width: 100%;
}

.receipt-lotto-order {
  display: grid;
  gap: 9px;
  justify-items: center;
  width: 100%;
  flex: 0 0 100%;
}

.receipt-digit {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #222;
  border-radius: 7px;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
}

.receipt-methods {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
}

.receipt-method {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6b6570;
}

.receipt-method i {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid #222;
  border-radius: 2px;
  color: #111;
  font-size: 0.78rem;
  line-height: 1;
  font-style: normal;
  font-weight: 900;
}

.receipt-method.checked {
  color: #111;
}

.receipt-draw-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px 16px;
  margin-bottom: 15px;
}

.receipt-draw-grid div {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.receipt-draw-grid div.matched-payable {
  color: #007a4d;
  font-weight: 900;
}

.receipt-draw-grid strong {
  font-size: 1.2rem;
}

.receipt-draw-grid span {
  font-size: 0.72rem;
}

.receipt-match-summary {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border: 1px dashed #888;
  border-radius: 10px;
  background: #fffdf4;
  font-family: "Courier New", monospace;
}

.receipt-match-summary strong {
  text-align: center;
  font-size: 0.95rem;
}

.receipt-match-summary p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.3;
  text-align: center;
}

.receipt-match-summary div {
  display: grid;
  gap: 4px;
}

.receipt-match-summary span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.receipt-match-summary .payable {
  color: #007a4d;
}

.receipt-banner {
  display: block;
  border-top: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
  padding: 10px 0;
  margin-bottom: 12px;
  text-align: center;
  font-size: 1rem;
}

.receipt-qr {
  width: 132px;
  height: 132px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 6px solid #fff;
}

.receipt-qr img {
  width: 100%;
  height: 100%;
  display: block;
}

.receipt-info,
.receipt-thanks {
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.25;
}

@media (min-width: 720px) {
  body {
    background: radial-gradient(circle at 50% 0, #3a3036, #0d0b0d 62%);
  }

  .phone {
    width: min(100vw, 480px);
    min-height: calc(100vh - 32px);
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 600px) {
  .summary-filter-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-filter-controls label {
    grid-column: 1 / -1;
  }

  .purchase-history-controls {
    grid-template-columns: 1fr;
  }

  .purchase-history-controls > strong {
    justify-self: stretch;
    white-space: normal;
  }

  .summary-filter-controls input,
  .purchase-history-controls input {
    appearance: none;
    -webkit-appearance: none;
  }

  .sales-punch-panel {
    grid-template-columns: 1fr;
  }

  .sales-today-summary,
  .sales-agent-controls {
    grid-template-columns: 1fr;
  }

  .sales-work-tabs {
    display: none;
  }

  .sales-work-tab {
    min-width: 116px;
    scroll-snap-align: start;
  }

  .sales-field-form {
    grid-template-columns: 1fr;
  }

  .sales-topup-form,
  .sales-collection-form {
    grid-template-columns: 1fr;
  }

  .sales-agent-summary,
  .deployment-mobile-summary {
    grid-template-columns: 1fr;
  }

  .sales-agent-summary > div:first-child,
  .sales-agent-summary button {
    grid-column: auto;
  }

  .sales-agent-summary > div:not(:first-child) {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .sales-agent-summary > .sales-agent-quick-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .sales-agent-quick-metrics > div {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    padding: 9px 10px;
  }

  .sales-history-row {
    grid-template-columns: 1fr;
  }

  .sales-history-row b {
    justify-self: start;
  }

  .sales-invoice-summary {
    grid-template-columns: 1fr;
  }

  .sales-invoice-top-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-invoice-status {
    justify-self: start;
  }

  .sales-agent-metrics {
    grid-template-columns: 1fr;
  }

  .sales-agent-metrics div {
    min-height: 52px;
    grid-template-columns: minmax(118px, 0.85fr) minmax(0, 1fr);
    align-items: center;
  }

  .sales-agent-metrics div span {
    align-self: center;
  }

  .sales-agent-metrics div strong {
    justify-self: start;
    text-align: left;
  }
}
