/* ==========================================================================
   BẢN WEB — giao diện điện thoại + cổng pháp danh (ghi đè lên live.css)
   ========================================================================== */

/* ---------- Nút mở/đóng bảng điều khiển (chỉ hiện trên điện thoại) ------ */
#btnToggleControls {
  display: none;
}

/* ---------- Cổng pháp danh (overlay chặn toàn trang) -------------------- */
.name-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 2, 1, 0.88);
  backdrop-filter: blur(3px);
}
.name-gate.hidden {
  display: none;
}
.name-gate-card {
  width: 100%;
  max-width: 420px;
  background: #1a0705;
  border: 1.5px solid rgba(244, 193, 80, 0.55);
  border-radius: 20px;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.name-gate-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffd54f;
  text-align: center;
}
.name-gate-desc {
  font-size: 15px;
  line-height: 1.5;
  color: #f5e9c8;
  text-align: center;
}
#inputPhapDanh {
  width: 100%;
  padding: 13px 14px;
  font-size: 18px;
  border-radius: 12px;
  border: 1.5px solid rgba(244, 193, 80, 0.5);
  background: rgba(0, 0, 0, 0.35);
  color: #fff8e1;
  outline: none;
  box-sizing: border-box;
}
#inputPhapDanh:focus {
  border-color: #ffd54f;
}
.name-gate-error {
  min-height: 20px;
  font-size: 14px;
  color: #ffab91;
  text-align: center;
}
#btnClaimPhapDanh {
  padding: 13px;
  font-size: 17px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #ffd54f, #f4c150);
  color: #3a2200;
  cursor: pointer;
}
#btnClaimPhapDanh:disabled {
  opacity: 0.55;
}
.name-gate-active {
  border-top: 1px solid rgba(244, 193, 80, 0.25);
  padding-top: 10px;
  font-size: 13px;
  color: #d7ccc8;
}
.name-gate-active-title {
  font-weight: 700;
  color: #ffd54f;
  margin-bottom: 4px;
}
#nameGateActiveList {
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- Banner chế độ dự phòng (tên chưa kiểm tra trùng) ----------- */
#nameLocalNote {
  display: none;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(26, 7, 5, 0.92);
  border: 1px solid rgba(244, 193, 80, 0.6);
  color: #ffe082;
  font-size: 13px;
  white-space: nowrap;
  max-width: 94vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nameLocalNote.visible {
  display: block;
}

/* ==========================================================================
   ĐIỆN THOẠI (<= 768px, trừ chế độ OBS): sân khấu full màn hình,
   bảng điều khiển ẩn mặc định, bấm nút 🎛️ mới hiện.
   ========================================================================== */
@media (max-width: 768px) {
  body:not(.obs-mode) .app-workspace {
    display: block;
    padding: 0;
    gap: 0;
    height: 100dvh;
  }
  body:not(.obs-mode) .stage-wrapper {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    border: none;
    border-radius: 0;
  }
  /* Bảng điều khiển thành tấm trượt từ dưới lên, ẩn mặc định */
  body:not(.obs-mode) .quick-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 66dvh;
    border-radius: 20px 20px 0 0;
    z-index: 50;
    transform: translateY(105%);
    transition: transform 0.3s ease;
    padding-bottom: 84px;
  }
  body:not(.obs-mode).controls-open .quick-dock {
    transform: translateY(0);
  }
  /* Nút mở/đóng bảng điều khiển, nổi góc dưới phải, nằm trên tấm trượt */
  body:not(.obs-mode) #btnToggleControls {
    display: flex;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 61;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(26, 7, 5, 0.92);
    border: 1.5px solid rgba(244, 193, 80, 0.7);
    color: #ffd54f;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- Số online hiển thị (ảo, 96–256) ---------------------------- */
.fake-online-line {
  font-size: 15px;
  font-weight: 700;
  color: #ffe082;
  text-align: center;
}
.fake-online-pill {
  color: #ffe082;
}
.fake-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 10px #ff3b30;
  animation: fakePulse 1.6s ease-in-out infinite;
}
@keyframes fakePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Khung viền vàng trang trí (chỉ điện thoại, không OBS) -------- */
.fake-frame { display: none; }
@media (max-width: 768px) {
  body:not(.obs-mode) .fake-frame {
    display: block;
    position: fixed;
    inset: 10px;
    z-index: 45;
    pointer-events: none;
    border: 2px solid rgba(244, 193, 80, 0.75);
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(244, 193, 80, 0.35), inset 0 0 24px rgba(0, 0, 0, 0.35);
  }
}
