/* Font Oswald đã chuyển sang <link> trong index.html để khỏi block render */

:root {
  --gold: #d4af37;
  --brown: #815a31;
  --paper: #fdfdfd;
  --stage-w: 1920px;
  --stage-h: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: transparent;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

#app {
  width: var(--stage-w);
  height: var(--stage-h);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  /* Bỏ transition width/height: animate 2 thuộc tính layout gây reflow giật mỗi lần scale */
}
/* Giới hạn phạm vi repaint của từng màn overlay (không áp cho admin cần cuộn) */
body:not(.admin-mode) #app > div {
  contain: layout style paint;
}

body.admin-mode {
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #141211;
}
body.admin-mode #app {
  width: 100%;
  height: auto;
  min-height: 100vh;
  position: relative;
  top: 0;
  left: 0;
  transform: none;
}

.font-oswald { font-family: "Oswald", sans-serif; }
.clip-badge { clip-path: polygon(25% 0, 100% 0, 100% 100%, 0% 100%); }

.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

.nav-fade-mask {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}

/* ---------- OBS Stinger Transition ---------- */
#stinger-transition {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stinger-bar-left,
.stinger-bar-right {
  position: absolute;
  top: 0;
  width: 120vw;
  height: 100%;
  transform: skewX(-12deg) translate3d(-150vw, 0, 0);
  transition: transform 0.45s cubic-bezier(0.86, 0, 0.07, 1);
  will-change: transform; /* đưa lên layer GPU riêng, animation mượt không repaint toàn trang */
}
.stinger-bar-left {
  left: -20vw;
  background: linear-gradient(135deg, #1b1613 0%, #100b08 100%);
  border-right: 10px solid #d97706;
  box-shadow: 25px 0 60px rgba(0, 0, 0, 0.9);
}
.stinger-bar-right {
  right: -20vw;
  background: linear-gradient(135deg, #140f0c 0%, #080504 100%);
  border-left: 10px solid #d97706;
  transform: skewX(-12deg) translate3d(150vw, 0, 0);
  box-shadow: -25px 0 60px rgba(0, 0, 0, 0.9);
}
.stinger-brand {
  position: absolute;
  transform: scale(0.3) rotate(-5deg) translate3d(0, 0, 0);
  opacity: 0;
  /* transition gọn theo transform+opacity thay vì "all" để đỡ tốn kém */
  transition:
    transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  will-change: transform, opacity;
  z-index: 100000;
  text-align: center;
  pointer-events: none;
}

/* ---------- Performance: tôn trọng hệ thống giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Chế độ "nhẹ máy" (perf-lite) ----------
   JS tự bật khi FPS tụt, hoặc OBS/máy yếu. Tắt blur + bóng + ping nặng. */
body.perf-lite .backdrop-blur-sm,
body.perf-lite .backdrop-blur-md,
body.perf-lite .backdrop-blur-xl,
body.perf-lite .backdrop-blur {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.perf-lite .blur-3xl,
body.perf-lite .blur-\[1px\],
body.perf-lite .blur-\[2px\] {
  filter: none !important;
}
body.perf-lite .animate-ping {
  animation: none !important;
}
body.perf-lite .shadow-2xl,
body.perf-lite .shadow-\[0_20px_40px_rgba\(0\,0\,0\,0\.3\)\] {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* ---------- Admin: inputs chuẩn ngón tay cái ---------- */
#admin-editor-workspace input[type="text"],
#admin-editor-workspace input[type="number"],
#admin-editor-workspace textarea {
  min-height: 48px;
  font-size: 16px;
  border-radius: 12px;
  padding: 10px 14px;
}
#admin-editor-workspace input:focus,
#admin-editor-workspace textarea:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
  outline: none;
}
#admin-editor-workspace button { min-height: 40px; }

/* Preset modal scrollbar */
.preset-modal-list::-webkit-scrollbar { width: 6px; }
.preset-modal-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }