/* =========================
   FONTS
========================= */
@font-face {
  font-family: "MyriadPro";
  src: url("../fonts/MyriadPro-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "SourceSans";
  src: url("../fonts/SourceSansPro-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* =========================
   RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "MyriadPro", "SourceSans", "Segoe UI", Arial, sans-serif;
  background: #000;
  color: #fff;
}

/* =========================
   APP LAYOUT
========================= */
.app-shell {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.app-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100vw;
  height: 100vh;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  overflow: hidden;
  background: #000;
}

/* =========================
   SPLASH
========================= */
#splash {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #212020;
  padding-top: 30px;
}

#splash.hide {
  display: none;
}

#splash-image {
  width: 100%;
  height: 80%;
  background: url("../img/splash.png") no-repeat center 30px;
  background-size: min(380px, 70%);
}

.progress-bar-wrap {
  width: 50%;
  max-width: 360px;
  margin-top: 50px;
}

.progress-bar-wrap span {
  display: block;
  width: 0%;
  height: 11px;
  background: url("../img/loading_bar.png") left center / 100% 100% no-repeat;
  transition: width 1s ease-in-out;
}

.loading-text {
  margin-top: 10px;
  color: whitesmoke;
  font-size: 15px;
  text-align: center;
  letter-spacing: 1px;
}

/* =========================
   LOBBY
========================= */
#lobby {
  position: relative;
  display: none;
  width: 100%;
  height: 100%;
  padding: 10px 0;
  overflow: hidden;
}

#lobby.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lobby-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("/lobby-bg.jpg") center center / cover no-repeat;
}

.lobby-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.lobby-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-bottom: 18px;
  transform: scale(1.12);
  transform-origin: center center;
}

/* =========================
   LOGO
========================= */
.logo-wrap {
  width: 500px;
  height: 280px;
  margin-bottom: 10px;
  margin-left: 55px;
  animation: none;
  filter: none;
}

.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* =========================
   MAIN BUTTONS
========================= */
.btn-row {
  display: flex;
  gap: 18px;
  margin-bottom: 20px;
  margin-top: 50px;
  transform: translateX(-10px);
}

.btn-game {
  display: block;
  flex: 0 0 auto;
  width: 170px;
  height: 65px;
  border: none;
  outline: none;
  cursor: pointer;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: transparent;
  font-size: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-game:hover {
  transform: scale(1.05);
  filter: brightness(1.12);
}

.btn-game:active {
  transform: scale(0.97);
}

.btn-register {
  background-image: url("../img/btn-dangky.png");
}

.btn-login {
  background-image: url("../img/btn-dangnhap.png");
}

/* =========================
   NOTICE / VERSION
========================= */
.notice {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.8px;
  color: #d9c06d;
  white-space: nowrap;
}

.notice strong {
  font-weight: 700;
}

.version {
  position: absolute;
  left: 14px;
  bottom: 20px;
  z-index: 1;
  color: #d9c06d;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

/* =========================
   SIDE BUTTONS
========================= */
.side-btns {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  transform: translateY(-50%);
}

.side-btn {
  display: block;
  width: 120px;
  height: 120px;
  text-decoration: none;
  cursor: pointer;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  transition: transform 0.2s ease;
}

.side-btn:hover {
  transform: scale(1.05);
}

.side-btn-download {
  background-image: url("../img/taiapp.jpg");
}

.side-btn-support {
  background-image: url("../img/hotro.jpg");
}

/* =========================
   MODAL OVERLAY
========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.modal-overlay.active {
  display: flex;
}

/* =========================
   MODAL BASE
========================= */
.modal {
  position: relative;
  overflow: visible;
  width: 600px;
  max-width: 100%;
  border: none;
  border-radius: 0;
  padding: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.35s ease;
}

.login-modal {
  min-height: 300px;
  background-image: url("../img/form-dang-nhap.png");
}

.register-modal {
  min-height: 540px;
  background-image: url("../img/form-dang-ky.png");
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  position: relative;
  height: 92px;
  padding: 0;
  text-align: center;
}

.modal-header h2 {
  display: none;
}

.modal-close {
  position: absolute;
  top: 5px;
  right: 2px;
  z-index: 10;
  width: 68px;
  height: 45px;
  border: none;
  cursor: pointer;
  background: url("../img/thoatt.png") no-repeat center / 100% 100%;
  transition: transform 0.2s ease;
}

.modal-close:hover {
  transform: scale(1.08);
}

.modal-close svg {
  display: none;
}

.modal-body {
  padding: 34px 54px 42px;
}

.login-modal .modal-body {
  padding-top: 48px;
  padding-bottom: 56px;
}

/* =========================
   FORM
========================= */
.form-field {
  margin-bottom: 22px;
}

.form-field input {
  width: 100%;
  height: 68px;
  padding: 0 22px;
  border: 2px solid rgba(179, 145, 63, 0.7);
  border-radius: 8px;
  outline: none;
  background: rgba(22, 12, 4, 0.72);
  color: #eee;
  font-family: "MyriadPro", "SourceSans", sans-serif;
  font-size: 23px;
  font-weight: 700;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder {
  color: rgba(255, 255, 255, 0.42);
  font-size: 23px;
  font-weight: 700;
}

.form-field input:focus {
  border-color: #dfbf63;
  box-shadow: 0 0 10px rgba(223, 191, 99, 0.18);
}

.register-extra {
  display: block;
}

/* =========================
   FLOATING ALERT IN POPUP
========================= */
.form-alert {
  position: absolute;
  top: -6px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 30;
  display: none;
  width: max-content;
  max-width: calc(100% - 24px);
  min-height: 50px;
  padding: 7px 40px;
  border: none;
  border-radius: 0 !important;
  clip-path: inset(0 round 0);
  color: #f3d46b;
  font-family: "SourceSans" !important;
  font-weight: 400 !important;
  font-style: normal;
  font-size: 32px;
  line-height: 1.02;
  text-align: center;
  letter-spacing: 0.6px;
  white-space: nowrap;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.95),
    0 0 8px rgba(255, 215, 90, 0.18);
  background: linear-gradient(
    to right,
    rgba(18, 10, 2, 0.20) 0%,
    rgba(24, 14, 4, 0.40) 10%,
    rgba(30, 18, 3, 0.72) 18%,
    rgba(8, 8, 8, 0.94) 32%,
    rgba(8, 8, 8, 0.94) 68%,
    rgba(30, 18, 3, 0.72) 82%,
    rgba(24, 14, 4, 0.40) 90%,
    rgba(18, 10, 2, 0.20) 100%
  );
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: formAlertDrop 0.22s ease;
}

.form-alert::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    rgba(255, 210, 80, 0) 0%,
    rgba(255, 210, 80, 0.22) 18%,
    rgba(255, 220, 120, 0.75) 50%,
    rgba(255, 210, 80, 0.22) 82%,
    rgba(255, 210, 80, 0) 100%
  );
  pointer-events: none;
}

.form-alert::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    rgba(120, 72, 8, 0) 0%,
    rgba(180, 130, 30, 0.14) 18%,
    rgba(240, 185, 70, 0.42) 50%,
    rgba(180, 130, 30, 0.14) 82%,
    rgba(120, 72, 8, 0) 100%
  );
  pointer-events: none;
}

.form-alert.show {
  display: block;
}

.form-alert.error {
  color: #f2d16b;
}

.form-alert.success {
  color: #f2d16b;
}

@keyframes formAlertDrop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* =========================
   SUBMIT BUTTON
========================= */
.btn-submit {
  display: block;
  margin: 28px auto 0;
  border: none;
  outline: none;
  cursor: pointer;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn-submit:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.btn-submit:active {
  transform: scale(0.97);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-submit-login {
  width: 200px;
  height: 72px;
  background-image: url("../img/btn-dangnhap.png");
}

.btn-submit-register {
  width: 250px;
  height: 72px;
  background-image: url("../img/btn-dangky.png");
}

/* =========================
   DESKTOP
========================= */
@media (min-width: 901px) {
  #lobby {
    padding: 10px 0;
  }
}

/* =========================
   MOBILE / SMALL HEIGHT
========================= */
@media (max-height: 600px), (max-width: 900px) {
  .lobby-content {
    transform: scale(1);
    padding-bottom: 8px;
  }

  .logo-wrap {
    width: 26%;
    height: auto;
    aspect-ratio: 410 / 325;
  }

  .btn-game {
    width: 100px;
    height: 35px;
  }

  #splash-image {
    height: 60%;
    background-size: 80% auto;
  }

  .progress-bar-wrap {
    margin-top: 200px;
  }

  .side-btns {
    right: 2px;
    gap: 6px;
  }

  .side-btn {
    width: 80px;
    height: 80px;
  }

  .notice {
    font-size: 10px;
  }

  .version {
    left: 10px;
    bottom: 8px;
    font-size: 18px;
  }

  .modal {
    max-width: 78%;
  }

  .login-modal {
    min-height: 300px;
  }

  .register-modal {
    min-height: auto;
  }

  .modal-header {
    height: 60px;
  }

  .modal-close {
    top: 3px;
    right: 1px;
    width: 40px;
    height: 32px;
  }

  .modal-body {
    padding: 18px 32px 20px;
  }

  .login-modal .modal-body {
    padding-top: 28px;
    padding-bottom: 32px;
  }

  .form-alert {
    top: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 16px);
    min-height: 32px;
    padding: 7px 14px;
    border-radius: 0 !important;
    clip-path: inset(0 round 0);
    font-size: 18px;
    line-height: 1.02;
    letter-spacing: 0.2px;
    white-space: nowrap;
  }

  .form-field {
    margin-bottom: 14px;
  }

  .form-field input {
    height: 46px;
    padding: 0 16px;
    font-size: 17px;
  }

  .form-field input::placeholder {
    font-size: 17px;
  }

  .btn-submit-login {
    width: 105px;
    height: 36px;
    margin-top: 18px;
  }

  .btn-submit-register {
    width: 130px;
    height: 44px;
    margin-top: 18px;
  }
}