:root {
  --giay: #f6f1e8;
  --the: #fffdf9;
  --muc: #1f1b17;
  --muc-2: #554c43;
  --muc-3: #8a8075;
  --vien: #ddd2c2;
  --than: #252220;
  --tim: #d9a8f7;
  --lua: #c2410c;
  --lua-nhat: rgba(194, 65, 12, 0.16);

  --con: #17663a;
  --con-nen: #e4f2e8;
  --con-vien: #a6d2b6;
  --ban: #a1281e;
  --ban-nen: #fbebe8;
  --ban-vien: #ebb6ae;
  --dat: #84520a;
  --dat-nen: #fcf1da;
  --dat-vien: #e7c98d;

  --zalo: #0068ff;
  --zalo-dam: #0052cc;

  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--giay);
  color: var(--muc);
  font-family: var(--font);
  font-size: 1.1875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

b,
strong {
  font-weight: 700;
}

.ma {
  white-space: nowrap;
}

.an {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--lua);
  outline-offset: 3px;
}

.trang {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Banner ---------- */

.banner {
  position: relative;
  overflow: hidden;
  background-color: var(--than);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.055' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 34c18-15 42-11 55 6'/%3E%3Cpath d='M24 42c6-6 14-8 22-6'/%3E%3Cpath d='M112 18c10 17 32 24 50 15'/%3E%3Cpath d='M30 124c15 11 37 9 48-6'/%3E%3Cpath d='M122 132c-9 15-3 32 13 39'/%3E%3Cpath d='M128 140c4 2 7 6 8 11'/%3E%3Cpath d='M70 82c9 9 22 9 31 0'/%3E%3C/g%3E%3C/svg%3E");
  color: #efe9e2;
  border-radius: 22px;
  padding: 16px 18px;
}

.banner__dau {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.banner__lua {
  font-size: 1.625rem;
  line-height: 1;
}

.banner__ten {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tim);
}

.banner__chinh {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  text-wrap: balance;
}

.banner em {
  font-style: normal;
  color: var(--tim);
}

.banner__y {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  font-size: 1.125rem;
  line-height: 1.42;
}

.banner__y li {
  position: relative;
  padding-left: 1.1em;
}

.banner__y li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.62em;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--tim);
}

.banner__y strong {
  color: #fff;
}

.banner__cam-on {
  margin: 8px 0 0;
  font-weight: 600;
  color: #fff;
}

/* ---------- Ô tìm ---------- */

.tim {
  background: var(--the);
  border: 1px solid var(--vien);
  border-radius: 22px;
  padding: 20px 16px 10px;
  box-shadow: 0 10px 28px -20px rgba(70, 45, 20, 0.45);
  scroll-margin-top: 12px;
}

.tim h1 {
  margin: 0 0 4px;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tim__mo-ta {
  margin: 0 0 12px;
  color: var(--muc-2);
}

.chi-dan {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding-left: 10px;
  color: var(--lua);
  font-size: 1.125rem;
  font-weight: 700;
  animation: nhun 1.6s ease-in-out infinite;
}

.chi-dan span {
  padding-top: 2px;
}

.chi-dan svg {
  width: 52px;
  height: 44px;
  flex: none;
  margin-bottom: -6px;
}

.tim.da-cham .chi-dan {
  animation: none;
}

.o-tim {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 70px;
  padding: 0 6px 0 14px;
  background: #fff;
  border: 3px solid var(--muc);
  border-radius: 16px;
  animation: quang 2.4s ease-in-out infinite;
  cursor: text;
}

.o-tim:focus-within {
  border-color: var(--lua);
  box-shadow: 0 0 0 5px var(--lua-nhat);
  animation: none;
}

.tim.da-cham .o-tim {
  animation: none;
}

.o-tim.rung {
  animation: rung 0.4s ease-in-out;
  border-color: var(--lua);
}

.o-tim__kinh {
  width: 26px;
  height: 26px;
  flex: none;
  margin-right: 4px;
  color: var(--muc-2);
}

.o-tim__tien-to {
  display: none;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--muc);
  letter-spacing: 0.02em;
  margin-right: -3px;
}

.o-tim.co-tien-to .o-tim__tien-to {
  display: inline;
}

.o-tim input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muc);
  padding: 12px 0;
}

.o-tim input::placeholder {
  color: #a39889;
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 1;
}

.o-tim__xoa {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #f1ebe2;
  color: var(--muc-2);
  cursor: pointer;
}

.o-tim__xoa svg {
  width: 22px;
  height: 22px;
}

.o-tim__xoa[hidden] {
  display: none;
}

.tim__vi-du {
  margin: 10px 2px 0;
  font-size: 1.0625rem;
  color: var(--muc-2);
}

.lien-ket {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 10px 4px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--muc-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Nút ---------- */

.nut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  padding: 12px 18px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, transform 0.1s;
}

.nut:active {
  transform: translateY(1px);
}

.nut--tim {
  margin-top: 14px;
  background: var(--muc);
  color: #fff;
}

.nut--tim:hover {
  background: #3a332c;
}

.nut--zalo {
  background: var(--zalo);
  color: #fff;
  min-height: 64px;
  font-size: 1.3125rem;
  box-shadow: 0 8px 18px -10px rgba(0, 82, 204, 0.8);
}

.nut--zalo:hover {
  background: var(--zalo-dam);
}

.nut--zalo svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.nut__chu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.nut__chu small {
  font-size: 0.9375rem;
  font-weight: 500;
  opacity: 0.92;
}

.nut--phu {
  background: transparent;
  color: var(--muc);
  border: 2px solid currentColor;
}

/* ---------- Kết quả ---------- */

.ket-qua {
  scroll-margin-top: 12px;
}

.ket-qua:empty {
  display: none;
}

.ket-qua:focus {
  outline: none;
}

.the {
  border: 2px solid var(--vien);
  border-radius: 22px;
  padding: 20px 18px;
  background: var(--the);
  animation: hien 0.25s ease-out;
}

.the--con {
  background: var(--con-nen);
  border-color: var(--con-vien);
}

.the--ban {
  background: var(--ban-nen);
  border-color: var(--ban-vien);
}

.the--dat {
  background: var(--dat-nen);
  border-color: var(--dat-vien);
}

.the__dau {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.the__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  background: var(--muc-2);
}

.the__icon svg {
  width: 32px;
  height: 32px;
}

.the--con .the__icon {
  background: var(--con);
}

.the--ban .the__icon {
  background: var(--ban);
}

.the--dat .the__icon {
  background: var(--dat);
}

.the__ma {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.the__trang-thai {
  margin: 2px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.the--con .the__trang-thai {
  color: var(--con);
}

.the--ban .the__trang-thai {
  color: var(--ban);
}

.the--dat .the__trang-thai {
  color: var(--dat);
}

.the__loi {
  margin: 0 0 16px;
}

.the__loi:last-child {
  margin-bottom: 0;
}

.the__ghi-chu {
  margin: 14px 0 0;
  font-size: 1.0625rem;
  color: var(--muc-2);
}

.the__ghi-chu a {
  color: var(--muc);
  font-weight: 700;
}

.the__tieu {
  margin: 0 0 8px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
}

.the__goi-y {
  margin: 16px 0 10px;
  font-weight: 700;
}

.the--tai {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
}

.xoay {
  width: 30px;
  height: 30px;
  flex: none;
  border: 4px solid var(--vien);
  border-top-color: var(--lua);
  border-radius: 50%;
  animation: xoay 0.8s linear infinite;
}

/* ---------- Mã mới ---------- */

.ma-moi h2 {
  margin: 8px 0 2px;
  font-size: 1.375rem;
  line-height: 1.3;
}

.ma-moi h2 span {
  color: var(--con);
}

.ma-moi__mo-ta {
  margin: 0 0 12px;
  color: var(--muc-2);
  font-size: 1.0625rem;
}

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

@media (min-width: 400px) {
  .luoi-ma {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.luoi-ma.luoi-ma--mot {
  grid-template-columns: minmax(0, 1fr);
}

.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 60px;
  padding: 6px 8px;
  border: 2px solid var(--vien);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--muc);
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  border-color: var(--muc-3);
}

.chip:active {
  background: var(--giay);
}

.chip__cham {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: #2f9e5b;
}

.chip--tt {
  flex-direction: column;
  gap: 2px;
}

.chip--tt small {
  font-size: 0.9375rem;
  font-weight: 700;
}

.chip--con small {
  color: var(--con);
}

.chip--ban small {
  color: var(--ban);
}

.chip--dat small {
  color: var(--dat);
}

.chip--cho {
  border-style: dashed;
  background: transparent;
  animation: nhap-nhay 1.4s ease-in-out infinite;
  cursor: default;
}

.ma-moi .nut--phu {
  margin-top: 12px;
}

.ma-moi__trong {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muc-2);
}

/* ---------- Chân trang ---------- */

.chan {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--vien);
  color: var(--muc-2);
  font-size: 1rem;
  text-align: center;
}

.chan p {
  margin: 0 0 4px;
}

/* ---------- Thông báo nổi ---------- */

.thong-bao {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--muc);
  color: #fff;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.thong-bao.hien {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  max-width: 34rem;
  margin: 0 auto 24px;
  padding: 16px;
  font-weight: 600;
}

/* ---------- Chuyển động ---------- */

@keyframes nhun {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@keyframes quang {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(194, 65, 12, 0);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(194, 65, 12, 0.15);
  }
}

@keyframes rung {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@keyframes hien {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes xoay {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nhap-nhay {
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }

  .xoay {
    animation: xoay 1.6s linear infinite !important;
  }
}
