.ngan-keo-gon {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 5px;
  box-sizing: border-box;
  width: 100%;
  height: var(--chieu-cao-ngan-keo-gon, 122px);
  padding: 5px;
  border: 2px solid #422514;
  border-top: 3px solid #c19a57;
  background: repeating-linear-gradient(0deg, #794825 0 3px, #84522d 3px 8px);
  box-shadow: inset 0 1px #e1bd76, 0 3px #382316;
  color: #f6e1b2;
  flex-shrink: 0;
}

.ngan-keo-gon .ngan-keo-gon__so {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  padding-right: 4px;
  border-right: 3px solid #452a19;
  box-shadow: 1px 0 #b98b4d;
}

.ngan-keo-gon .ngan-keo-gon__tien {
  display: grid;
  grid-template-rows: 16px minmax(28px, 1fr) minmax(28px, 1fr) 28px;
  gap: 2px;
  min-width: 0;
  min-height: 0;
}

.ngan-keo-gon .ngan-keo-gon__hang {
  display: flex;
  gap: 3px;
  min-width: 0;
}

.ngan-keo-gon__nut {
  box-sizing: border-box;
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 2px 4px;
  border: 1px solid #452a19;
  border-radius: 2px;
  background: #bc9557;
  color: #302013;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  touch-action: manipulation;
}

.ngan-keo-gon__nut:disabled {
  cursor: default;
  filter: saturate(0.55);
  opacity: 0.62;
}

.ngan-keo-gon__nut:focus-visible {
  outline: 2px solid #fff4b7;
  outline-offset: -2px;
}

.ngan-keo-gon__nut:not(:disabled):active {
  box-shadow: inset 0 2px 3px #3c291b80;
}

.ngan-keo-gon .ngan-keo-gon__bia {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
  border: 1.5px solid rgba(185, 139, 77, 0.35);
  border-radius: 5px;
  background: rgba(56, 34, 21, 0.65);
  color: #ffe7ab;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ngan-keo-gon .ngan-keo-gon__bia--can-ky-so {
  border-color: #fde047 !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(254, 240, 138, 0.52) 0%, rgba(217, 119, 6, 0.45) 62%, rgba(120, 53, 15, 0.85) 100%) !important;
  color: #fffbeb !important;
  box-shadow:
    0 0 12px rgba(250, 204, 21, 0.9),
    0 0 22px rgba(245, 158, 11, 0.65),
    inset 0 0 10px rgba(254, 249, 195, 0.55) !important;
  animation: sangRucCuonSoNo 0.95s ease-in-out infinite alternate;
}

.ngan-keo-gon .ngan-keo-gon__bia--can-ky-so .ngan-keo-gon__anh-so {
  filter: drop-shadow(0 0 7px rgba(254, 240, 138, 0.98)) brightness(1.16) saturate(1.2);
  transform: scale(1.05);
}

.ngan-keo-gon .ngan-keo-gon__bia--can-ky-so .ngan-keo-gon__nhan-so {
  padding: 1px 4px;
  border-radius: 3px;
  background: #92400e;
  color: #fef08a;
  font-size: 9.5px;
  font-weight: 900;
  text-shadow: 0 1px 1px #451a03;
}

@keyframes sangRucCuonSoNo {
  0% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 8px rgba(250, 204, 21, 0.72),
      0 0 14px rgba(245, 158, 11, 0.45),
      inset 0 0 6px rgba(254, 249, 195, 0.4);
  }
  100% {
    transform: translateY(-1px) scale(1.03);
    box-shadow:
      0 0 15px rgba(254, 240, 138, 1),
      0 0 26px rgba(245, 158, 11, 0.85),
      inset 0 0 12px rgba(254, 249, 195, 0.75);
  }
}

.ngan-keo-gon .ngan-keo-gon__anh-so {
  display: block;
  width: 56px;
  height: 70px;
  min-height: 0;
  max-height: 65%;
  object-fit: contain;
  image-rendering: pixelated;
}

.ngan-keo-gon .ngan-keo-gon__phu {
  flex-shrink: 0;
  width: 100%;
  padding: 2px;
  font-size: 9px;
  background: #d0aa65;
}

.ngan-keo-gon .ngan-keo-gon__tom-tat {
  align-self: center;
  overflow: hidden;
  color: #ffe5ad;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

.ngan-keo-gon .ngan-keo-gon__to {
  --mau-ngan-tien: #f4b84c;
  --mau-vien-tien: #ffda79;
  position: relative;
  flex: 1 1 0;
  overflow: hidden;
  padding: 0;
  border: 1.5px solid #59351c;
  border-top: 2px solid #231208;
  border-bottom-color: var(--mau-vien-tien);
  border-radius: 4px;
  /* Lòng ngăn gỗ sâu tối màu để làm nổi bật độ dày 3D của sấp tiền xếp chồng bên trong */
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 224, 150, 0.1) 0%, transparent 75%),
    linear-gradient(180deg, #1b0e06 0%, #2b170b 58%, #1d0f07 100%);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 218, 121, 0.16),
    0 1px 0 #382010;
}

.ngan-keo-gon .ngan-keo-gon__to[data-menh-gia='200000'] {
  --mau-ngan-tien: #e0523c;
  --mau-vien-tien: #ffada1;
}

.ngan-keo-gon .ngan-keo-gon__to[data-menh-gia='100000'] {
  --mau-ngan-tien: #26ca92;
  --mau-vien-tien: #92f6bd;
}

.ngan-keo-gon .ngan-keo-gon__to[data-menh-gia='50000'] {
  --mau-ngan-tien: #f078b0;
  --mau-vien-tien: #ffc0dd;
}

.ngan-keo-gon .ngan-keo-gon__to[data-menh-gia='20000'] {
  --mau-ngan-tien: #429fe5;
  --mau-vien-tien: #9ee6ff;
}

.ngan-keo-gon .ngan-keo-gon__to[data-menh-gia='5000'] {
  --mau-ngan-tien: #bc88e5;
  --mau-vien-tien: #e0baff;
}

.ngan-keo-gon .ngan-keo-gon__to[data-menh-gia='2000'] {
  --mau-ngan-tien: #40c8b4;
  --mau-vien-tien: #a1f1d5;
}

.ngan-keo-gon .ngan-keo-gon__to[data-menh-gia='1000'] {
  --mau-ngan-tien: #ed9c5b;
  --mau-vien-tien: #ffd39a;
}

.ngan-keo-gon .ngan-keo-gon__to:disabled {
  /* A locked drawer still displays its banknotes in full color. */
  filter: none;
  opacity: 1;
}

.ngan-keo-gon .ngan-keo-gon__hinh-tien {
  position: absolute;
  top: 2px;
  left: 2.5px;
  right: 2.5px;
  bottom: 13px;
  overflow: visible;
  opacity: 1;
  pointer-events: none;
}

.ngan-keo-gon .ngan-keo-gon__hinh-tien .anh-to-tien-that-vn {
  filter: saturate(1.14) contrast(1.08) brightness(1.04);
}

.ngan-keo-gon .ngan-keo-gon__hinh-tien svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Huy hiệu báo rõ số tờ tiền còn trong sấp (góc phải trên mỗi ngăn tiền) */
.ngan-keo-gon .ngan-keo-gon__dem-to {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 3.5px;
  border-radius: 3px;
  border: 1px solid #fde68a;
  background: rgba(24, 13, 6, 0.92);
  color: #fef08a;
  font-size: 8.5px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.ngan-keo-gon .ngan-keo-gon__dem-to--nhieu {
  background: linear-gradient(180deg, #065f46 0%, #064e3b 100%);
  border-color: #6ee7b7;
  color: #ecfdf5;
}

.ngan-keo-gon .ngan-keo-gon__dem-to--vua {
  background: linear-gradient(180deg, #451a03 0%, #271004 100%);
  border-color: #fbbf24;
  color: #fef08a;
}

.ngan-keo-gon .ngan-keo-gon__dem-to--it {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  border-color: #fca5a5;
  color: #fff1f2;
}

/* Ô tiền sắp hết (1-2 tờ) chớp đỏ nhẹ thông báo cho người chơi */
.ngan-keo-gon .ngan-keo-gon__to--sap-het {
  animation: chopDoNheNganTien 1.15s ease-in-out infinite alternate;
}

.ngan-keo-gon .ngan-keo-gon__to--sap-het::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  pointer-events: none;
  z-index: 4;
  animation: chopDoLopPhuNganTien 1.15s ease-in-out infinite alternate;
}

@keyframes chopDoNheNganTien {
  0% {
    border-color: #59351c;
    box-shadow:
      inset 0 2px 5px rgba(0, 0, 0, 0.85),
      0 1px 0 #382010;
  }
  100% {
    border-color: #f87171;
    box-shadow:
      inset 0 0 8px rgba(239, 68, 68, 0.55),
      0 0 7px rgba(248, 113, 113, 0.65);
  }
}

@keyframes chopDoLopPhuNganTien {
  0% {
    background: rgba(239, 68, 68, 0);
  }
  100% {
    background: rgba(239, 68, 68, 0.22);
  }
}

.ngan-keo-gon .ngan-keo-gon__dem-to--het {
  background: #7f1d1d;
  border-color: #fca5a5;
  color: #fecaca;
}

.ngan-keo-gon .ngan-keo-gon__menh-gia {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 12px;
  padding: 0 2px;
  border-top: 1px solid var(--mau-vien-tien);
  background: linear-gradient(180deg, #fff6cf 0%, #f5c962 100%);
  color: #361906;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 11px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ngan-keo-gon .ngan-keo-gon__so-to {
  position: absolute;
  top: 1px;
  left: 1px;
  z-index: 6;
  padding: 1px 3px;
  border-radius: 3px;
  border: 1px solid #a7f3d0;
  background: #047857;
  color: #fff8ce;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.05;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.ngan-keo-gon .ngan-keo-gon__to[aria-pressed='true'] {
  border-color: #fffbd1;
  box-shadow: inset 0 0 0 1px #ffdc52, 0 0 0 1px #ffdc52;
}

.ngan-keo-gon .ngan-keo-gon__keo {
  flex: 1 1 0;
  padding: 1px;
  background: #c34a2f;
  color: #fff0bf;
}

.ngan-keo-gon .ngan-keo-gon__chan {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.ngan-keo-gon .ngan-keo-gon__da-chon {
  flex: 1 1 0;
  min-width: 0;
  color: #ffe9bd;
  font-size: 9px;
  line-height: 12px;
}

.ngan-keo-gon .ngan-keo-gon__hoan-tac,
.ngan-keo-gon .ngan-keo-gon__xoa {
  flex: 0 0 28px;
  height: 28px;
  padding: 0;
  font-size: 17px;
}

.ngan-keo-gon .ngan-keo-gon__thu,
.ngan-keo-gon .ngan-keo-gon__mo-cua {
  flex: 0 1 auto;
  min-width: 77px;
  max-width: 118px;
  height: 28px;
  background: #e5c77e;
  box-shadow: inset 0 1px #fff0c1;
  font-size: 10px;
}

.ngan-keo-gon__dong-ky {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #b48a49;
  background: #f5e7bd;
  color: #442b1b;
}

.ngan-keo-gon__dong-ky p {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.4;
}

.ngan-keo-gon__dong-ky .ngan-keo-gon__nhac-ky {
  font-size: 11px;
}

.ngan-keo-gon__dong-ky .ngan-keo-gon__ky-no {
  min-height: 34px;
  padding: 6px 12px;
  background: #8b342c;
  color: #fff0ce;
  font-size: 12px;
}

.ngan-keo-gon .ngan-keo-gon__doi-tien {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  border-color: #451a03;
  color: #2b1d14;
  font-weight: 800;
}

.ngan-keo-gon .ngan-keo-gon__phu--canh-bao {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  border-color: #fef08a;
  color: #fffbeb;
  animation: nhapNhayNutDoiTien 0.75s ease-in-out infinite alternate;
}

@keyframes nhapNhayNutDoiTien {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.04);
    box-shadow: 0 0 8px rgba(254, 240, 138, 0.85);
  }
}

.ngan-keo-gon .ngan-keo-gon__to--het {
  background: repeating-linear-gradient(90deg, #3b2416 0 4px, #472c1b 4px 8px) !important;
  border-color: #6b4423 !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65) !important;
}

.ngan-keo-gon .ngan-keo-gon__hoc-trong {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 2px 2px 13px;
  color: #fca5a5;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 0 #1f1007;
}

.ngan-keo-gon .ngan-keo-gon__to--het .ngan-keo-gon__menh-gia {
  background: #451a03;
  color: #fca5a5;
  border-top-color: #78350f;
}

.ngan-keo-gon .ngan-keo-gon__tom-tat--canh-bao {
  color: #fde047;
  text-shadow: 0 1px 0 #7f1d1d;
}

.ngan-keo-gon .ngan-keo-gon__keo--goi-y {
  border-color: #fef08a;
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  color: #fef08a;
  box-shadow: 0 0 6px rgba(134, 239, 172, 0.75);
}

.ngan-keo-gon .ngan-keo-gon__khat-le {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 5px;
  background: #9a3412;
  border-color: #fdba74;
  color: #fff7ed;
  font-size: 9px;
}

.ngan-keo-gon .ngan-keo-gon__thu--san-sang {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  border-color: #bbf7d0;
  color: #fef08a;
  box-shadow: inset 0 1px #86efac;
}

.ngan-keo-gon .ngan-keo-gon__thu--thoi-du {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
  border-color: #fef08a;
  color: #fffbeb;
}

.ngan-keo-gon .ngan-keo-gon__thu--ky-so {
  background: linear-gradient(180deg, #facc15 0%, #d97706 100%);
  border-color: #fef08a;
  color: #291404;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.65), inset 0 1px #fef9c3;
}


