/* ==========================================================================
   QH88 mobile home — static replica
   Layout authored in rem where 1rem = 1 design px at 390px wide, so the UI
   scales fluidly with the viewport like the original H5 app.
   ========================================================================== */

:root {
  /* Fluid base: 1rem tracks the 390px design width */
  font-size: calc(100vw / 390);

  /* Brand colors */
  --c-page: #2b2b2b;
  --c-bg: #fafafa;
  --c-app-bg: #f7fcfe;
  --c-white: #fff;
  --c-text: #020817;
  --c-primary: #3a81e5;
  --c-link: #1f79ff;
  --c-link-border: #63a2ff;
  --c-register: #528ded;
  --c-badge: #ff4444;
  --c-app-orange: #ff9b29;
  --c-web-purple: #736fff;
  --c-sub: #bfbfbf;
  --c-notice: #64748b;
  --c-event-title: #3c3c3d;
  --c-event-label: #7c848c;
  --c-event-panel: #dcedff;
  --c-cat-bg: #f9f6e7;
  --c-cat-border: #e9e8e3;
  --c-cat-label: #737373;
  --c-cat-icon: #858484;
  --c-card-border: rgba(230, 227, 255, 0.898);
  --c-card-name: #3c4861;
  --c-tab-label: #979797;
  --c-tabbar-border: #ebeef7;

  /* Fonts */
  --font-body: 'SF Pro Text', -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-tab: 'Kanit', var(--font-body);
  --font-card: 'Roboto', var(--font-body);
}

/* Cap the scale on wide screens so a desktop preview stays phone-sized */
@media (min-width: 440px) {
  :root {
    font-size: calc(440 / 390 * 1px);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-page);
}

img {
  display: block;
  max-width: 100%;
}

button {
  padding: 0;
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--c-app-bg);
}

.main {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 12rem;
  -webkit-overflow-scrolling: touch;
}

.main::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   Download top bar
   -------------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 32rem;
  flex-shrink: 0;
  height: 44rem;
  padding: 0 12rem 0 54rem;
  background: var(--c-white);
}

.topbar--hidden {
  display: none;
}

.topbar__item {
  display: flex;
  align-items: center;
  gap: 6rem;
}

.topbar__icon {
  flex-shrink: 0;
  width: 28rem;
  height: 28rem;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: contain;
}

.topbar__icon--app {
  background-image: url(../images/appdownload.png);
}

.topbar__icon--web {
  background-image: url(../images/add-screen.png);
}

.topbar__text {
  display: flex;
  flex-direction: column;
}

.topbar__sub {
  font-size: 10rem;
  font-weight: 700;
  line-height: 12rem;
  color: var(--c-sub);
}

.topbar__label {
  margin-top: 2rem;
  font-size: 12rem;
  font-weight: 600;
  line-height: 12rem;
}

.topbar__label--app {
  color: var(--c-app-orange);
}

.topbar__label--web {
  color: var(--c-web-purple);
}

.topbar__close {
  width: 16rem;
  height: 16rem;
  margin-left: auto;
  background: url(../images/close.png) no-repeat 50% 50%;
  background-size: contain;
}

/* --------------------------------------------------------------------------
   App bar
   -------------------------------------------------------------------------- */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 48rem;
  padding: 0 12rem;
  background: var(--c-app-bg);
}

.appbar__menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4rem;
  width: 24rem;
  height: 48rem;
}

.appbar__menu-bar {
  width: 20rem;
  height: 2rem;
  border-radius: 2rem;
  background: var(--c-primary);
}

.appbar__menu-bar:nth-child(2) {
  width: 14rem;
}

.appbar__logo {
  width: 110rem;
  height: 40rem;
  object-fit: contain;
}

.appbar__actions {
  display: flex;
  align-items: center;
  gap: 8rem;
}

.appbar__login {
  height: 24rem;
  padding: 0 10rem;
  font-size: 12rem;
  line-height: 24rem;
  color: var(--c-link);
  border: 1rem solid var(--c-link-border);
  border-radius: 6rem;
}

.appbar__register {
  position: relative;
  height: 24rem;
  padding: 0 10rem;
  font-size: 12rem;
  line-height: 16rem;
  color: var(--c-white);
  background: url(../images/push-tab_bg-blue.png) no-repeat 50% 50%;
  background-size: 100% 100%;
  border-radius: 6rem;
}

.appbar__badge {
  position: absolute;
  top: -8rem;
  right: -6rem;
  padding: 0 2rem;
  font-size: 10rem;
  font-weight: 600;
  line-height: 14rem;
  white-space: nowrap;
  background: var(--c-badge);
  border-radius: 8rem 8rem 8rem 0;
}

/* --------------------------------------------------------------------------
   Banner slider
   -------------------------------------------------------------------------- */
.banner {
  position: relative;
  padding: 0 10rem;
}

.banner__viewport {
  overflow: hidden;
  border-radius: 8rem;
}

.banner__track {
  display: flex;
  transition: transform 0.4s ease;
}

.banner__slide {
  flex: 0 0 100%;
}

.banner__img {
  width: 100%;
  aspect-ratio: 390 / 134;
  object-fit: cover;
  border-radius: 8rem;
}

.banner__arrow {
  position: absolute;
  top: 50%;
  width: 16rem;
  height: 40rem;
  background: url(../images/arrow_right.png) no-repeat 50% 50%;
  background-size: 8rem auto;
  transform: translateY(-50%);
}

.banner__arrow--prev {
  left: 14rem;
  transform: translateY(-50%) scaleX(-1);
}

.banner__arrow--next {
  right: 14rem;
}

.banner__online {
  position: absolute;
  top: 8rem;
  right: 18rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 6rem;
  font-size: 12rem;
  color: var(--c-white);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 17rem;
}

.banner__online-icon {
  width: 14rem;
  height: 14rem;
  background: url(../images/ol_user.png) no-repeat 50% 50%;
  background-size: 60% auto;
}

.banner__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6rem;
}

.banner__dot {
  width: 6rem;
  height: 6rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 9999rem;
  transition: width 0.3s ease, background 0.3s ease;
}

.banner__dot--active {
  width: 10rem;
  background: var(--c-primary);
}

/* --------------------------------------------------------------------------
   Marquee notice
   -------------------------------------------------------------------------- */
.notice {
  display: flex;
  align-items: center;
  height: 16rem;
  margin: 6rem 0;
  padding: 0 12rem;
  font-size: 12rem;
}

.notice__icon {
  flex-shrink: 0;
  width: 12rem;
  height: 16rem;
  margin-right: 5rem;
  background: url(../images/icon-notice-blue.png) no-repeat 50% 50%;
  background-size: contain;
}

.notice__viewport {
  flex: 1;
  overflow: hidden;
}

.notice__track {
  display: inline-flex;
  white-space: nowrap;
  color: var(--c-notice);
  animation: notice-scroll 60s linear infinite;
}

.notice__item {
  padding: 0 16rem;
}

.notice__badges {
  display: flex;
  align-items: center;
  gap: 8rem;
  flex-shrink: 0;
  padding-left: 8rem;
}

.notice__badge {
  width: 20rem;
  height: 20rem;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: contain;
}

.notice__badge--usdt {
  background-image: url(../images/usdt.webp);
}

.notice__badge--vip {
  background-image: url(../images/vip-icon.webp);
}

.notice__badge--gift {
  background-image: url(../images/gift-icon.webp);
}

@keyframes notice-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   Featured events
   -------------------------------------------------------------------------- */
.events {
  padding: 6rem 10rem;
}

.events__panel {
  position: relative;
  padding: 10rem 8rem;
  overflow: hidden;
  background: url(../images/recommend-bg.png) no-repeat 50% 50%;
  background-size: 100% 100%;
  border: 1rem solid var(--c-white);
  border-radius: 12rem;
}

.events__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.events__title {
  position: relative;
  z-index: 2;
  margin: 0;
  padding-left: 2rem;
  font-size: 13rem;
  font-weight: 700;
  line-height: 16rem;
  color: var(--c-event-title);
  text-shadow: -1rem 1rem 0 rgba(255, 255, 255, 0.6);
}

.events__arrows {
  display: flex;
  gap: 8rem;
}

.events__arrow {
  width: 14rem;
  height: 14rem;
  background-color: var(--c-white);
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
  border-radius: 2.5rem;
}

.events__arrow--prev {
  background-image: url(../images/icon-arrow-pre.png);
}

.events__arrow--next {
  background-image: url(../images/icon-arrow-next.png);
}

.events__list {
  display: flex;
  gap: 8rem;
  margin-top: 8rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.events__list::-webkit-scrollbar {
  display: none;
}

.event-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 80rem;
  height: 60rem;
}

.event-card__icon {
  width: 54rem;
  height: 44rem;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: auto 100%;
}

.event-card__name {
  margin: 0;
  font-size: 10rem;
  font-weight: 500;
  line-height: 12rem;
  color: var(--c-event-label);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Catalog: category rail + game grid
   -------------------------------------------------------------------------- */
.catalog {
  display: flex;
  gap: 10rem;
  align-items: flex-start;
  padding-left: 10rem;
}

.catalog__nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 6rem;
  flex-shrink: 0;
  width: 68rem;
  padding-top: 12rem;
}

.cat-tab {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 68rem;
  height: 48rem;
  padding-bottom: 5rem;
  background: var(--c-cat-bg);
  border-radius: 6rem;
  box-shadow: 0 2rem 6rem 0 rgba(104, 128, 163, 0.06);
}

.cat-tab--active {
  background: linear-gradient(#f9f6e7, #f9f6e7);
  border: 1rem solid var(--c-cat-border);
}

.cat-tab__icon {
  width: 30rem;
  height: 30rem;
  margin-bottom: 2rem;
  background-image: url(../images/c5079f337d60b6e3.png);
  background-repeat: no-repeat;
  background-position: 50% var(--mask-pos, 50%);
  background-size: 100% auto;
}

/* Active "Pho bien" uses the colored sprite (fire frame) */
.cat-tab__icon--image {
  background-image: url(../images/2d8fc8a9fcd932d9.png);
  background-position: 50% 71.43%;
}

.cat-tab__label {
  font-size: 12rem;
  line-height: 14rem;
  letter-spacing: -0.24rem;
  color: var(--c-cat-label);
  text-align: center;
  white-space: nowrap;
}

.cat-tab--active .cat-tab__label {
  font-weight: 600;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6rem;
  flex: 1;
  margin: 0;
  padding: 8rem 12rem 10rem 0;
  list-style: none;
}

/* Game card */
.game-card {
  position: relative;
  height: 119.5rem;
  padding: 4rem 0 0 8rem;
  overflow: hidden;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
  border: 1rem solid var(--c-card-border);
  border-radius: 8rem;
}

.game-card--wide {
  grid-column: span 2;
}

.game-card__logo {
  position: relative;
  z-index: 1;
  max-width: 85%;
  max-height: 44rem;
  object-fit: contain;
}

.game-card__name {
  position: relative;
  z-index: 1;
  width: 55%;
  margin: 6rem 0 0;
  font-family: var(--font-card);
  font-size: 10rem;
  font-weight: 500;
  line-height: 12rem;
  color: var(--c-card-name);
  overflow: hidden;
}

.game-card__vision {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 60%;
  height: 72%;
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: contain;
}

.game-card__thumb {
  position: absolute;
  right: 4rem;
  bottom: 4rem;
  width: 72rem;
  height: 72rem;
  overflow: hidden;
  border-radius: 5rem;
}

.game-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Bottom tab bar
   -------------------------------------------------------------------------- */
.tabbar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-shrink: 0;
  height: 56rem;
  color: var(--c-tab-label);
  background: var(--c-white);
  border-top: 1rem solid var(--c-tabbar-border);
  border-radius: 12rem 12rem 0 0;
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  height: 40rem;
  color: inherit;
}

.tabbar__item--active {
  color: var(--c-primary);
}

.tabbar__icon {
  width: 24rem;
  height: 24rem;
  margin-bottom: 4rem;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: contain;
}

.tabbar__icon--home {
  background-image: url(../images/home-blue.png);
}

.tabbar__icon--slot {
  background-image: url(../images/dz.png);
}

.tabbar__icon--discover {
  background-image: url(../images/discover.png);
}

.tabbar__icon--chat {
  background-image: url(../images/chat.png);
}

.tabbar__icon--mine {
  background-image: url(../images/mine.png);
}

.tabbar__icon--casino {
  display: flex;
  justify-content: center;
  align-items: center;
}

.tabbar__svg {
  width: 24rem;
  height: 24rem;
  fill: currentColor;
}

.tabbar__label {
  font-family: var(--font-tab);
  font-size: 11.5rem;
  line-height: 12rem;
  letter-spacing: -0.115rem;
}

.tabbar__item--active .tabbar__label {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Floating buttons
   -------------------------------------------------------------------------- */
.float {
  position: absolute;
  right: 8rem;
  z-index: 8;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: contain;
}

.float--jackpot {
  width: 80rem;
  height: 80rem;
  bottom: 190rem;
  background-image: url(../images/1d5e61c9a30f79e2.png);
}

.float--chat {
  width: 65rem;
  height: 65rem;
  bottom: 120rem;
  background-image: url(../images/vn_menu_CSKH_animate.png);
  background-size: 3600% 100%;
  background-position: -500% 0;
}

/* --------------------------------------------------------------------------
   Auth modal (login / register)
   -------------------------------------------------------------------------- */
.auth {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth[hidden] {
  display: none;
}

.auth__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.auth__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(100% - 24rem);
  max-width: 366rem;
  max-height: 86%;
  overflow: hidden;
  background: linear-gradient(#fff 0%, #ebf5ff 100%);
  border-radius: 12rem;
}

/* Tabs */
.auth__tabs {
  position: relative;
  display: flex;
  flex-shrink: 0;
  padding: 16rem 16rem 0;
}

.auth__tabs::after {
  content: '';
  position: absolute;
  left: 16rem;
  right: 16rem;
  bottom: 0;
  height: 1.5rem;
  background: rgba(210, 210, 215, 0.5);
}

.auth__tab {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  flex: 1;
  padding-bottom: 10rem;
  font-size: 16rem;
  color: #9aa0ad;
}

.auth__tab--active {
  color: var(--c-register);
}

.auth__tab--active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: 128rem;
  height: 2rem;
  background: var(--c-register);
  transform: translateX(-50%);
}

.auth__tab-icon {
  width: 20rem;
  height: 20rem;
}

.auth__tab-badge {
  position: absolute;
  top: -4rem;
  left: 50%;
  padding: 0 4rem;
  font-size: 10rem;
  font-weight: 600;
  line-height: 14rem;
  color: var(--c-white);
  white-space: nowrap;
  background: var(--c-badge);
  border-radius: 8rem 8rem 8rem 0;
  transform: translateX(10rem);
}

.auth__tab-badge--plus {
  transform: translateX(44rem);
}

/* Panels */
.auth__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.auth__panel--hidden {
  display: none;
}

.auth__scroll {
  flex: 1;
  padding: 16rem 16rem 4rem;
  overflow-y: auto;
  scrollbar-width: none;
}

.auth__scroll::-webkit-scrollbar {
  display: none;
}

/* In-modal promo banner */
.auth__banner {
  margin-bottom: 8rem;
  overflow: hidden;
  border-radius: 8rem;
}

.auth__banner-track {
  display: flex;
  transition: transform 0.4s ease;
}

.auth__banner-slide {
  flex: 0 0 100%;
}

.auth__banner-slide img {
  width: 100%;
  aspect-ratio: 334 / 88;
  object-fit: cover;
}

/* Fields */
.field {
  display: flex;
  align-items: center;
  height: 44rem;
  margin-bottom: 8rem;
  padding: 0 12rem;
  background: var(--c-bg);
  border: 1rem solid #d2d2d7;
  border-radius: 6rem;
}

.field__icon {
  display: flex;
  flex-shrink: 0;
  width: 18rem;
  height: 18rem;
  margin-right: 8rem;
  color: #afafb9;
}

.field__icon svg {
  width: 100%;
  height: 100%;
}

.field__input {
  flex: 1;
  width: 100%;
  min-width: 0;
  font-family: inherit;
  font-size: 14rem;
  color: var(--c-text);
  background: none;
  border: 0;
  outline: none;
}

.field__input::placeholder {
  font-size: 12rem;
  color: rgba(62, 69, 88, 0.6);
}

.field__eye {
  display: flex;
  flex-shrink: 0;
  width: 20rem;
  height: 20rem;
  margin-left: 8rem;
  color: #afafb9;
}

.field__eye svg {
  width: 100%;
  height: 100%;
}

.field__eye--on {
  color: var(--c-register);
}

.field__flag {
  display: flex;
  align-items: center;
  gap: 6rem;
  flex-shrink: 0;
  margin-right: 8rem;
  font-size: 12rem;
  font-weight: 500;
  color: #2c344d;
}

.field__flag img {
  width: 24rem;
  height: 24rem;
  border-radius: 9999rem;
  object-fit: cover;
}

.field-hint {
  display: flex;
  align-items: center;
  gap: 6rem;
  margin: 6rem 0 8rem;
  font-size: 12rem;
  line-height: 18rem;
  color: var(--c-register);
}

.field-hint::before {
  content: '';
  width: 4rem;
  height: 4rem;
  border-radius: 9999rem;
  background: var(--c-register);
}

/* Captcha row */
.field-row {
  display: flex;
  gap: 8rem;
}

.field--captcha {
  flex: 1;
  min-width: 0;
}

.captcha {
  display: flex;
  align-items: center;
  gap: 8rem;
  flex-shrink: 0;
  height: 44rem;
  padding: 0 8rem;
  background: var(--c-bg);
  border: 1rem solid #d5d5d6;
  border-radius: 6rem;
}

.captcha__img {
  width: 70rem;
  height: 24rem;
  border-radius: 4rem;
  object-fit: cover;
}

.captcha__refresh {
  display: flex;
  width: 18rem;
  height: 18rem;
  color: #9aa0ad;
}

.captcha__refresh svg {
  width: 100%;
  height: 100%;
}

.auth__forgot {
  display: block;
  margin-top: 8rem;
  font-size: 13rem;
  color: #ff5a3c;
  text-align: right;
  text-decoration: none;
}

/* Footer: submit + quick links */
.auth__footer {
  flex-shrink: 0;
  padding: 8rem 16rem 16rem;
}

.auth__submit {
  width: 100%;
  height: 40rem;
  font-size: 16rem;
  font-weight: 500;
  color: #f8fafc;
  background: var(--c-register);
  border-radius: 9999rem;
}

.auth__links {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 12rem;
}

.auth__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
  width: 64rem;
  color: #7a8793;
  text-decoration: none;
}

.auth__link-icon {
  width: 40rem;
  height: 40rem;
  object-fit: contain;
}

.auth__link-icon--wide {
  width: 64rem;
}

.auth__link span {
  font-size: 12rem;
  line-height: 14rem;
  text-align: center;
}

/* Close */
.auth__close {
  position: absolute;
  left: 50%;
  bottom: -46rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 28rem;
  height: 28rem;
  color: var(--c-white);
  border: 1.5rem solid var(--c-white);
  border-radius: 9999rem;
  transform: translateX(-50%);
}

.auth__close svg {
  width: 16rem;
  height: 16rem;
}
