/* ======================================================== */
/* NRO WebGL Modern Theme - Style Sheet                     */
/* Giữ nguyên 100% logic tọa độ và tương tác gốc của Unity   */
/* ======================================================== */

:root {
  --color-bg: #07090e;
  --color-primary: #ff8c00;
  --color-primary-glow: rgba(255, 140, 0, 0.45);
  --color-card-bg: rgba(16, 20, 28, 0.88);
  --color-border: rgba(255, 140, 0, 0.3);
  --color-gold: #ffc400;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Orbitron', 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 50% 15%, rgba(255, 140, 0, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 10% 85%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 85%, rgba(255, 60, 0, 0.08) 0%, transparent 50%);
  font-family: var(--font-main);
  color: #e6edfa;
}

/* Background animated particle dots effect */
.bg-ambient-fx {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1px 1px at 30px 40px, #ffb300, rgba(0, 0, 0, 0)),
    radial-gradient(1.5px 1.5px at 120px 180px, #00e5ff, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 250px 90px, #ffffff, rgba(0, 0, 0, 0)),
    radial-gradient(1.5px 1.5px at 320px 260px, #ff7700, rgba(0, 0, 0, 0));
  background-repeat: repeat;
  background-size: 360px 360px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* ======================================================== */
/* MÀN HÌNH CHỜ TRƯỚC KHI TẢI (PRE-LAUNCH GATE)             */
/* ======================================================== */
#pre-launch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: radial-gradient(circle at center, rgba(20, 26, 38, 0.98) 0%, rgba(7, 9, 14, 0.99) 100%);
  transition: opacity 0.35s ease;
  padding: 16px;
}

/* Cảnh báo xoay ngang điện thoại */
#rotate-device-prompt {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 380px;
}

.rotate-phone-anim {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 22px;
}

.phone-icon {
  width: 44px;
  height: 72px;
  border: 3px solid var(--color-primary);
  border-radius: 9px;
  position: absolute;
  left: calc(50% - 22px);
  top: calc(50% - 36px);
  animation: phone-rotate-anim 2.5s infinite ease-in-out;
  box-shadow: 0 0 18px rgba(255, 140, 0, 0.5);
  background: rgba(255, 140, 0, 0.12);
}

.phone-notch {
  width: 14px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  margin: 4px auto 0 auto;
}

@keyframes phone-rotate-anim {

  0%,
  25% {
    transform: rotate(0deg);
  }

  55%,
  85% {
    transform: rotate(-90deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.rotate-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--color-gold);
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-shadow: 0 0 12px rgba(255, 196, 0, 0.4);
}

.rotate-desc {
  font-size: 13px;
  color: #90a4ae;
  line-height: 1.5;
}

/* Khung chọn bắt đầu */
#pre-launch-box {
  background: rgba(16, 21, 30, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 30px 38px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 140, 0, 0.2);
}

.pre-launch-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.dragon-star-lg {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9c4, #ff9800 60%, #b71c1c 100%);
  box-shadow: 0 0 30px #ff9800, inset 0 -3px 6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #b71c1c;
  text-shadow: 0 0 6px rgba(255, 235, 59, 0.8);
  margin-bottom: 14px;
  animation: ball-glow 2.5s infinite alternate ease-in-out;
}

@keyframes ball-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 25px #ff9800;
  }

  100% {
    transform: scale(1.05);
    box-shadow: 0 0 45px #ffb300;
  }
}

.pre-launch-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 0%, #ffc400 45%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.pre-launch-tag {
  font-size: 12px;
  color: #78909c;
  letter-spacing: 0.8px;
}

.pre-launch-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  outline: none;
}

.btn-launch-primary {
  background: linear-gradient(135deg, #ff9100 0%, #ff3d00 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 80, 0, 0.45);
  flex: 1;
  min-width: 180px;
}

.btn-launch-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 120, 0, 0.6);
}

.btn-launch-primary:active {
  transform: translateY(0);
}

.btn-launch-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cfd8dc;
  padding: 13px 22px;
}

.btn-launch-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.pre-launch-note {
  margin-top: 18px;
  font-size: 12px;
  color: #607d8b;
}

/* ======================================================== */
/* UNITY FULLSCREEN CONTAINER (CHẾ ĐỘ TRÀN 100% CỬA SỔ WEB)  */
/* ======================================================== */
#unity-container {
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  transform: none !important;
  z-index: 1;
}

#unity-container.unity-desktop {
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  transform: none !important;
}

/* Ẩn Header và Footer trên bản Desktop để tràn viền 100% */
#unity-header,
#unity-footer {
  display: none !important;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dragon-star {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9c4, #ff9800 65%, #d84315 100%);
  box-shadow: 0 0 12px #ff9800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #b71c1c;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, #ffffff 0%, #ffc400 45%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(255, 140, 0, 0.3);
}

.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.35);
  color: #00e676;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: #00e676;
  border-radius: 50%;
  box-shadow: 0 0 8px #00e676;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

/* ======================================================== */
#unity-fullscreen-container {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #000 !important;
  overflow: hidden !important;
  position: relative !important;
}

#unity-canvas {
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
  background: #231F20;
  outline: none;
  display: block !important;
}

/* ======================================================== */
/* FOOTER DƯỚI BẢN DESKTOP (ẨN TRONG CHẾ ĐỘ TRÀN VIỀN)       */
/* ======================================================== */
#unity-footer {
  display: none !important;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#unity-build-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #90a4ae;
}

/* Nút Toàn màn hình Custom */
.btn-fullscreen-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 140, 0, 0.12);
  border: 1px solid rgba(255, 140, 0, 0.45);
  color: #ffb74d;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  outline: none;
}

.btn-fullscreen-custom:hover {
  background: rgba(255, 140, 0, 0.28);
  border-color: rgba(255, 140, 0, 0.8);
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.45);
  color: #fff;
  transform: translateY(-1px);
}

.btn-fullscreen-custom:active {
  transform: translateY(0);
}

/* ======================================================== */
/* LOADING SCREEN (HIỆU ỨNG DRAGON BALL)                    */
/* ======================================================== */
#unity-loading-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #141a26 0%, #06080d 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.4s ease-out;
}

#unity-loading-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 85%;
  max-width: 380px;
}

.loading-dragon-ball {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9c4, #ff9800 60%, #b71c1c 100%);
  box-shadow: 0 0 35px #ff9800, inset 0 -3px 6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  animation: ball-float 2.5s infinite ease-in-out;
}

@keyframes ball-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
    box-shadow: 0 0 45px #ffb300;
  }
}

.ball-star {
  font-size: 34px;
  color: #b71c1c;
  text-shadow: 0 0 6px rgba(255, 235, 59, 0.8);
}

.loading-game-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 0%, #ffc400 45%, #ff6d00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.loading-sub-status {
  font-size: 13px;
  color: #90a4ae;
  margin-bottom: 16px;
  font-weight: 600;
}

#unity-progress-bar-empty {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 140, 0, 0.35);
  border-radius: 8px;
  padding: 2px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff3d00, #ff9100 50%, #ffea00 100%);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(255, 145, 0, 0.9);
  transition: width 0.15s ease-out;
}

.loading-percent-num {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--color-gold);
  text-shadow: 0 0 12px rgba(255, 196, 0, 0.6);
}

/* ======================================================== */
/* MOBILE ADAPTATION (FULL SCREEN CHUẨN XÁC NGUYÊN BẢN)      */
/* ======================================================== */
#unity-container.unity-mobile {
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000 !important;
  transform: none !important;
}

.unity-mobile #unity-fullscreen-container {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #000 !important;
  overflow: hidden !important;
  position: relative !important;
}

.unity-mobile #unity-canvas {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

@media (min-aspect-ratio: 14/10) {
  .unity-mobile:not(.unity-floating-mode) #unity-canvas {
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
  }
}

/* Chế độ cửa sổ nổi / màn hình dọc trên Mobile: Giữ tỷ lệ Landscape chuẩn tránh lệch ảnh */
@media (max-aspect-ratio: 14/10) {
  .unity-mobile #unity-canvas {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    max-height: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
  }
}

.unity-mobile.unity-floating-mode #unity-canvas,
.unity-mobile #unity-fullscreen-container.unity-floating-mode #unity-canvas {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

.unity-mobile #unity-header,
.unity-mobile #unity-footer {
  display: none !important;
}

/* Nút phóng to nổi trên Mobile (Mặc định góc trên bên phải) */
#mobile-fullscreen-btn {
  display: none;
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(24, 30, 44, 0.92) 0%, rgba(12, 16, 25, 0.95) 100%);
  border: 1.5px solid rgba(255, 152, 0, 0.85);
  color: #ffb74d;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 152, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.15s ease, box-shadow 0.25s ease, opacity 0.3s ease, border-color 0.25s ease;
}

#mobile-fullscreen-btn .fs-icon {
  font-size: 14px;
  line-height: 1;
  color: #ff9800;
  display: inline-block;
  pointer-events: none;
}

#mobile-fullscreen-btn .fs-text {
  font-size: 11px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: none;
}

.unity-mobile-device #mobile-fullscreen-btn.not-fullscreen {
  display: flex !important;
  opacity: 1 !important;
  animation: pulse-fs-btn 2.2s infinite ease-in-out;
}

#unity-fullscreen-button {
  display: none !important;
}

@keyframes pulse-fs-btn {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 10px rgba(255, 152, 0, 0.4);
    border-color: rgba(255, 152, 0, 0.85);
  }
  50% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 152, 0, 0.75);
    border-color: rgba(255, 183, 77, 1);
  }
}

#mobile-fullscreen-btn.is-fullscreen {
  display: none !important;
}

#mobile-fullscreen-btn:hover,
#mobile-fullscreen-btn:active {
  opacity: 1 !important;
  transform: scale(0.96);
  background: linear-gradient(135deg, rgba(35, 45, 65, 0.96) 0%, rgba(18, 24, 38, 0.98) 100%);
  border-color: #ffb74d;
  color: #fff;
}

#mobile-fullscreen-btn:hover .fs-icon,
#mobile-fullscreen-btn:active .fs-icon {
  transform: scale(1.15);
  color: #fff;
}

/* Warning Banner */
#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: #d32f2f;
  color: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  display: none;
  z-index: 99999;
}

/* ======================================================== */
/* MOBILE KEYBOARD INPUT OVERLAY (DÀNH CHO WEB MOBILE)      */
/* ======================================================== */
.nro-kb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2147483647;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10px;
  pointer-events: auto;
}

.nro-kb-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.nro-kb-card {
  position: relative;
  z-index: 2;
  width: min(92%, 520px);
  background: linear-gradient(145deg, rgba(22, 27, 40, 0.97) 0%, rgba(12, 16, 24, 0.98) 100%);
  border: 2px solid rgba(255, 140, 0, 0.7);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 140, 0, 0.35);
  border-radius: 14px;
  padding: 10px 14px 12px;
  animation: nroKbSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nroKbSlideDown {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nro-kb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.nro-kb-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: #ffc400;
  letter-spacing: 0.8px;
  text-shadow: 0 0 10px rgba(255, 196, 0, 0.5);
}

.nro-kb-star {
  color: #ff8c00;
  font-size: 15px;
}

.nro-kb-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #aaa;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.nro-kb-close:hover,
.nro-kb-close:active {
  background: rgba(244, 67, 54, 0.3);
  border-color: #f44336;
  color: #fff;
}

.nro-kb-body {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.nro-kb-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(5, 7, 12, 0.75);
  border: 1.5px solid rgba(255, 140, 0, 0.5);
  border-radius: 9px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nro-kb-input-wrap:focus-within {
  border-color: #ff9800;
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.5);
}

.nro-kb-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 17px;
  padding: 9px 12px;
  min-width: 0;
}

.nro-kb-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.nro-kb-eye,
.nro-kb-clear {
  background: transparent;
  border: none;
  color: #bbb;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.nro-kb-eye:hover,
.nro-kb-clear:hover {
  opacity: 0.8;
}

.nro-kb-btn-submit {
  background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.5);
  transition: transform 0.15s ease, filter 0.2s ease;
}

.nro-kb-btn-submit:active {
  transform: scale(0.96);
  filter: brightness(1.1);
}
