/* ═══════════════════════════════════════════════════
   FaceOptik – style.css
   Theme: Dark tech / retro-futuristic
   Font: Share Tech Mono (labels) + DM Sans (body)
═══════════════════════════════════════════════════ */

:root {
  --bg0: #03050a;
  /* Darker space background */
  --bg1: #0a0c14;
  /* Solid dark background for clarity */
  --bg2: #111422;
  --bg3: #1a1f35;
  --border: rgba(0, 255, 200, 0.3);
  --border2: rgba(0, 255, 200, 0.5);
  --accent: #00ffc8;
  --accent2: #00ccff;
  --cyan: #00ffc8;
  --cyan-dim: rgba(0, 255, 200, 0.4);
  --green: #00ffc8;
  --orange: #ffb700;
  --purple: #a855f7;
  /* Tím neon – 2026 accent */
  --amber: #f59e0b;
  /* Cam hổ phách – cảnh báo */
  --violet: #7c3aed;
  /* Violet sâu */
  --text1: #ffffff;
  --text2: #e0e6ed;
  /* Brighter grey */
  --text3: #94a3b8;
  /* Brighter labels */
  --mono: 'Chakra Petch', 'Space Grotesk', sans-serif;
  --hud-mono: 'JetBrains Mono', monospace;
  /* Ultra-thin HUD font */
  --sans: 'DM Sans', sans-serif;
  --radius: 4px;
  /* Sharper corners */
  --topbar-h: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100dvh;
  overflow: hidden;
}

body {
  background: var(--bg0);
  color: var(--text1);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  background-image:
    linear-gradient(rgba(0, 255, 200, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 200, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: center center;
}

/* Vignette / ambient glow */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(3, 5, 10, 0.95) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Noise overlay */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.05"/%3E%3C/svg%3E');
  pointer-events: none;
  z-index: 2;
}

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg1);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 100;
}

.logo {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.logo:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 0 8px rgba(0, 255, 200, 0.6));
  opacity: 0.95;
}



.logo-mark {
  font-size: 18px;
  opacity: 0.8;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 2px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  transition: background 0.4s;
}

.live-dot.on {
  background: var(--green);
  animation: blink 1.2s infinite;
}

.live-dot.rec {
  background: #ef4444;
  animation: blink 0.8s infinite;
}

.stats-mini {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  display: flex;
  gap: 12px;
}

.stat-val {
  color: var(--cyan);
}

.btn-toggle-sidebar {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-toggle-sidebar:hover {
  background: rgba(0, 255, 200, 0.1);
  color: var(--cyan);
  border-color: var(--cyan);
}

.btn-toggle-sidebar.active {
  background: var(--cyan);
  color: #000;
  font-weight: bold;
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.4);
  animation: toggleActivePulse 1.5s infinite alternate;
}

@keyframes toggleActivePulse {
  from {
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.5);
  }

  to {
    box-shadow: 0 0 25px rgba(0, 255, 200, 0.9), 0 0 40px rgba(0, 255, 200, 0.3);
  }
}

.btn-toggle-sidebar.active .icon {
  font-size: 14px;
  text-shadow: none;
}

.btn-toggle-sidebar .icon {
  font-size: 14px;
}

/* ── Layout ──────────────────────────────────────── */
.layout {
  display: flex;
  height: calc(100dvh - var(--topbar-h));
  overflow: hidden;
}

/* ── Camera panel ────────────────────────────────── */
.cam-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  position: relative;
  overflow: hidden;
}

.cam-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
}

#videoEl {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
  /* mirror */
  opacity: 0;
  transition: opacity 0.6s;
}

#videoEl.visible {
  opacity: 1;
}

#videoEl.beauty {
  filter: none;
}

#liveBgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

#overlayCanvas,
#arCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Scan line */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
      transparent 0%,
      var(--accent) 20%,
      #fff9 50%,
      var(--accent) 80%,
      transparent 100%);
  box-shadow: 0 0 10px var(--accent), 0 0 3px #fff;
  top: -4px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.3s;
}

.scan-line.active {
  opacity: 1;
  animation: scanY 1.8s ease-in-out;
}

@keyframes scanY {
  0% {
    top: 2%;
  }

  100% {
    top: 98%;
  }
}

/* Viewport corners */
.vp-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s;
}

.vp-corner.visible {
  opacity: 1;
}

.vp-corner.c-tl {
  top: 12px;
  left: 12px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.vp-corner.c-tr {
  top: 12px;
  right: 12px;
  border-top-width: 2px;
  border-right-width: 2px;
}

.vp-corner.c-bl {
  bottom: 12px;
  left: 12px;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.vp-corner.c-br {
  bottom: 12px;
  right: 12px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

/* Placeholder */
.cam-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, rgba(0, 255, 200, 0.03) 0%, var(--bg0) 70%);
  z-index: 30;
  transition: opacity 0.6s ease-out;
}

.cam-placeholder.hidden {
  opacity: 0;
  pointer-events: none;
}

.cam-placeholder.loading #placeholderBgCanvas {
  opacity: 0.72;
  transition: opacity 0.25s ease;
}

/* ── Scanner HUD ── */
.scanner-hud {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulse glow behind rings */
.scanner-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 200, 0.08) 0%, transparent 70%);
  animation: scannerPulse 3s ease-in-out infinite;
}

@keyframes scannerPulse {

  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.4;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Ring base styles */
.scanner-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  box-sizing: border-box;
}

/* Ring 1 – Outermost, dashed, slow CW */
.ring-1 {
  width: 100%;
  height: 100%;
  border-width: 2px;
  border-color: rgba(0, 255, 200, 0.25);
  border-style: dashed;
  animation: spinCW 12s linear infinite;
  box-shadow: 0 0 15px rgba(0, 255, 200, 0.08), inset 0 0 15px rgba(0, 255, 200, 0.05);
}

/* Tick marks on ring 1 */
.ring-tick {
  position: absolute;
  width: 2px;
  height: 10px;
  background: var(--cyan);
  box-shadow: 0 0 5px var(--cyan);
}

.tick-n {
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
}

.tick-s {
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
}

.tick-e {
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 2px;
}

.tick-w {
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 2px;
}

/* Ring 2 – Medium, solid accent arc, fast CCW */
.ring-2 {
  width: 82%;
  height: 82%;
  border-width: 2.5px;
  border-color: transparent transparent var(--cyan) transparent;
  animation: spinCCW 4s linear infinite;
  filter: drop-shadow(0 0 6px var(--cyan));
}

/* Ring 3 – Inner, thin dotted, medium CW */
.ring-3 {
  width: 65%;
  height: 65%;
  border-width: 1.5px;
  border-color: rgba(0, 255, 200, 0.3);
  border-style: dotted;
  animation: spinCW 6s linear infinite;
}

/* Ring 4 – Innermost arc sweep, fast CW */
.ring-4 {
  width: 50%;
  height: 50%;
  border-width: 3px;
  border-color: var(--cyan) transparent transparent transparent;
  animation: spinCW 2s cubic-bezier(0.6, 0, 0.4, 1) infinite;
  filter: drop-shadow(0 0 10px var(--cyan));
}

/* Crosshair */
.scanner-crosshair {
  position: absolute;
  width: 45%;
  height: 45%;
}

.cross-h,
.cross-v {
  position: absolute;
  background: rgba(0, 255, 200, 0.15);
}

.cross-h {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
}

.cross-v {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
}

/* Face silhouette */
.scanner-face {
  position: absolute;
  width: 80px;
  height: 96px;
  color: var(--cyan);
  opacity: 0.7;
  animation: faceBreathe 3s ease-in-out infinite;
}

@keyframes faceBreathe {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.95);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

/* Scanner label */
.scanner-label {
  position: absolute;
  bottom: -30px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
  animation: labelBlink 2s ease infinite;
}

@keyframes labelBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes spinCW {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes spinCCW {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-360deg);
  }
}

/* Scanner text below rings */
.scanner-subtitle {
  font-size: 14px;
  color: var(--text2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 20px;
}

.scanner-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Start button */
.btn-start {
  margin-top: 4px;
  padding: 12px 32px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, #00ffc8, #00b7ff);
  color: #050a0f;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.55), 0 0 40px rgba(0, 183, 255, 0.3);
  text-transform: uppercase;
  position: relative;
  overflow: visible; /* Cho phép vòng loang loãng ra ngoài nút */
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  /* Cho phép click lại nút này */
}

.btn-start-icon {
  font-size: 18px;
  animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 5px var(--cyan);
  }

  50% {
    opacity: 0.5;
    text-shadow: none;
  }
}

/* Hide sweep effect for solid gradient theme */
.btn-start::before {
  display: none;
}

/* Touch ripple pulse effect to draw user's curiosity */
.btn-start::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 30px;
  border: 3.5px solid #00ffc8;
  box-shadow: 0 0 15px rgba(0, 255, 200, 0.75);
  animation: startTouchPulse 1.4s infinite ease-out;
  pointer-events: none;
}

@keyframes startTouchPulse {
  0% {
    transform: scale(0.95, 0.85);
    opacity: 0.95;
    filter: blur(0px);
  }
  75% {
    transform: scale(1.3, 1.7); /* Lan tỏa rộng hơn biên nút */
    opacity: 0;
    filter: blur(1.5px);
  }
  100% {
    transform: scale(1.3, 1.7);
    opacity: 0;
  }
}


.btn-start:hover {
  background: linear-gradient(135deg, #00ffc8, #00b7ff);
  box-shadow: 0 0 30px rgba(0, 255, 200, 0.8), 0 0 50px rgba(0, 183, 255, 0.5);
  transform: translateY(-2px) scale(1.06);
}

.btn-start:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 15px rgba(0, 255, 200, 0.3);
}


/* ── Placeholder Additions ── */
#placeholderBgCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
}

.placeholder-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 20px 15px 12vh;
  /* Đẩy lên cao tương đương 12% màn hình */
  background: transparent;
  /* Xóa nền đen che khuất hạt hiệu ứng */
  pointer-events: none;
  /* Xuyên thủng sự kiện chuột để chạm được vào lưới hạt nền */
}

.placeholder-title {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.placeholder-title span {
  background: repeating-linear-gradient(90deg, var(--cyan) 0px, var(--accent2) 250px, var(--purple) 500px, var(--cyan) 750px) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}




.placeholder-title-icon {
  -webkit-text-fill-color: var(--cyan);
  animation: iconPulse 1.5s ease-in-out infinite;
}

.cyber-typewriter-container {
  min-height: 28px;
  max-width: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.cyber-typewriter {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: #e0ffff;
  text-shadow: 0 0 10px rgba(0, 255, 200, 0.8), 0 0 20px rgba(0, 255, 200, 0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.5;
  min-height: 1.5em;
  margin: 0;
  opacity: 0;
  transform: translateX(-36px);
  white-space: normal;
  will-change: transform, opacity;
}

.cyber-typewriter::after {
  content: "█";
  color: var(--purple);
  text-shadow: 0 0 10px var(--purple);
  animation: blink-caret 0.6s step-end infinite;
  margin-left: 5px;
}

@keyframes blink-caret {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.cyber-typewriter::after {
  content: none;
}

.cyber-typewriter.slide-in {
  animation: introSlide 6.3s cubic-bezier(0.19, 1, 0.22, 1) both;
}

@keyframes introSlide {
  0% {
    opacity: 0;
    transform: translateX(-42px);
    filter: blur(6px);
  }

  12%,
  78% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateX(34px);
    filter: blur(4px);
  }
}

/* Circular HUD Progress */
.hud-loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 10px;
}

.hud-progress-ring {
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6));
}

.hud-ring-value {
  transition: stroke-dashoffset 0.1s linear;
  stroke-linecap: round;
}

.hud-loading-text {
  position: absolute;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text1);
  text-shadow: 0 0 8px var(--cyan);
}

.placeholder-warning {
  padding: 16px 14px;
  color: var(--text3);
  font-size: 0.9rem;
  /* Tăng từ 0.85rem */
  text-align: center;
  max-width: 95%;
  opacity: 0.9;
  white-space: nowrap;
}


.placeholder-warning strong {
  color: #ffca28;
  text-shadow: 0 0 8px rgba(255, 202, 40, 0.5);
}


/* Hint pill */
.hint-pill {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 13, 26, 0.85);
  border: 0.5px solid var(--border2);
  border-radius: 20px;
  padding: 5px 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 25;
}

.hint-pill.show {
  opacity: 1;
}

/* Face detection box */
.face-box {
  position: absolute;
  border: 1px solid rgba(79, 195, 247, 0.6);
  border-radius: 3px;
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 0 16px rgba(79, 195, 247, 0.15), inset 0 0 16px rgba(79, 195, 247, 0.04);
  transition: left 0.1s, top 0.1s, width 0.1s, height 0.1s;
}

.face-box .fc {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
}

.face-box .fc.tl {
  top: -1px;
  left: -1px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.face-box .fc.tr {
  top: -1px;
  right: -1px;
  border-top-width: 2px;
  border-right-width: 2px;
}

.face-box .fc.bl {
  bottom: -1px;
  left: -1px;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.face-box .fc.br {
  bottom: -1px;
  right: -1px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

/* PiP Canvas */
.pip-canvas {
  position: absolute;
  bottom: 24px;
  right: 24px;
  left: auto;
  width: 240px;
  height: 320px;
  background: rgba(7, 9, 16, 0.5);
  border: 1px solid rgba(0, 255, 200, 0.5);
  border-radius: var(--radius);
  z-index: 40;
  box-shadow:
    0 0 10px rgba(0, 255, 200, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.6s;
  will-change: transform;
  transform: translateZ(0);
  /* Force GPU compositing */
}


.pip-canvas.show {
  opacity: 1;
}

/* Send progress bar */
.send-bar {
  height: 2px;
  background: var(--bg3);
  overflow: hidden;
  flex-shrink: 0;
}

.send-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  transition: width 0.15s linear;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: 300px;
  /* Wider for better layout */
  background: var(--bg1);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s ease;
  position: relative;
  z-index: 50;
  /* Ensure it's above noise/vignette */
}

.sidebar.collapsed {
  width: 0;
  border-left: none;
}

.sb-block {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
}

.sb-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 12px;
  opacity: 0.8;
  text-transform: uppercase;
}

/* State chip */
.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 0.5px solid;
}

.state-chip.idle {
  background: #111827;
  border-color: #1e2d4a;
  color: var(--text3);
}

.state-chip.scanning {
  background: #0d2038;
  border-color: var(--cyan-dim);
  color: var(--cyan);
}

.state-chip.done {
  background: #0d2a1a;
  border-color: #1a5c38;
  color: var(--green);
}

.state-chip.warn {
  background: #2a1a0d;
  border-color: #7a4010;
  color: var(--orange);
}

.state-chip.error {
  background: #2a0d0d;
  border-color: #7a1010;
  color: #f87171;
}

.chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.2s infinite;
}

/* Face shape display */
.face-shape-big {
  font-family: var(--mono);
  font-size: 36px;
  /* Even bigger */
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 15px var(--cyan), 0 0 30px var(--cyan);
  line-height: 1;
  min-height: 40px;
  text-transform: uppercase;
  letter-spacing: 4px;
  transition: all 0.4s;
  margin-bottom: 8px;
}

.face-shape-vi {
  font-size: 18px;
  color: var(--cyan);
  font-weight: bold;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.face-desc {
  font-size: 14px;
  color: #fff;
  line-height: 1.6;
  margin-bottom: 20px;
  opacity: 1;
  font-weight: 400;
}

/* Meters */
.meter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.meter-lbl {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}

.meter-val {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--cyan);
  font-weight: bold;
  text-shadow: 0 0 5px var(--cyan);
}

.meter-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.meter-fill.accent {
  background: linear-gradient(90deg, var(--cyan), var(--accent));
}

.meter-fill.blue {
  background: var(--cyan);
}

/* Sidebar sections to be collapsed */
.face-analysis,
.glasses-recommendations {
  display: none !important;
}

/* Animations for HUD Panel */
@keyframes panelGrow {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Glasses list */
.glasses-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Tăng khoảng cách */
}

.glasses-list li {
  display: flex;
  flex-direction: column;
  /* Đổi sang dọc */
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.glass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.glass-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  margin-right: 8px;
}

.glass-name {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.glass-match {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  background: rgba(0, 255, 200, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.glass-detail {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

.glass-mat {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.glass-reason {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.4;
}

.glasses-list li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--cyan);
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 0 10px var(--cyan);
}

.glasses-list li:hover {
  background: rgba(0, 255, 200, 0.08);
  transform: translateX(4px) !important;
  border-color: rgba(0, 255, 200, 0.4);
}

.glasses-list li:hover::before {
  opacity: 1;
}

.glasses-list li.show {
  opacity: 1;
  transform: translateX(0);
}

.glasses-list li.rank1 {
  border-color: rgba(0, 255, 200, 0.5);
  background: rgba(0, 255, 200, 0.06);
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.1);
}

li.rank1 .glass-rank {
  color: var(--accent);
}

li.rank1 .glass-match {
  background: rgba(0, 255, 200, 0.2);
  font-weight: bold;
}

.glass-placeholder {
  color: var(--text3);
  font-size: 12px;
}

/* AR button */
.btn-ar {
  width: 100%;
  padding: 10px 12px;
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.ar-icon {
  font-size: 18px;
}

.ar-badge {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg3);
  color: var(--text3);
  border: 0.5px solid var(--border);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Animations ──────────────────────────────────── */
@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

/* ── Scrollbar ───────────────────────────────────── */
.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

/* Sync Button */
.btn-sync {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  color: #ffd700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-sync:hover:not(:disabled) {
  background: rgba(255, 215, 0, 0.1);
  border-style: solid;
  transform: translateY(-1px);
}

.btn-sync:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Reset Button */
.btn-reset {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.4);
  border-radius: 6px;
  color: #ff3c3c;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease forwards;
}

.btn-reset:hover {
  background: rgba(255, 60, 60, 0.2);
  border-color: #ff3c3c;
  box-shadow: 0 0 15px rgba(255, 60, 60, 0.2);
}

.btn-reset span {
  font-size: 18px;
  transition: transform 0.5s ease;
}

.btn-reset:hover span {
  transform: rotate(-180deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Nút Quét Lại cố định dưới camera (Góc trái) ─────────────────── */
.btn-retry-fixed {
  position: absolute;
  top: auto;
  bottom: 50px;
  right: 50px;
  left: auto;
  transform: none;
  z-index: 50;
  padding: 9px 28px;
  background: rgba(0, 255, 200, 0.08);
  border: 1.5px solid rgba(0, 255, 200, 0.65);
  border-radius: 6px;
  color: #00ffc8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  text-transform: uppercase;
  animation: retrySlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
    retryPulse 2s ease-in-out 0.4s infinite;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-retry-fixed:hover {
  background: rgba(0, 255, 200, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(0, 255, 200, 0.5);
}

@keyframes retrySlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes retrySlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes retryPulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.25);
  }

  50% {
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.6);
  }
}

/* ── Responsive for Tablets & Mobiles ──────────────────────── */

/* Tablet (Landscape & Portrait) */
@media (max-width: 1024px) {
  .pip-canvas {
    width: 180px;
    height: 240px;
    bottom: 60px;
    left: 30px;
    right: auto;
  }

  .scanner-hud {
    transform: scale(0.85);
  }

  .topbar {
    padding: 0 12px;
  }

  .btn-retry-fixed {
    right: 20px;
    bottom: 45px;
    top: auto;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --topbar-h: 60px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 6px 10px;
    justify-content: center;
    gap: 4px;
  }

  .logo {
    width: 100%;
    justify-content: center;
    font-size: 14px;
  }

  .top-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .stats-mini {
    font-size: 9px;
    gap: 6px;
  }

  .btn-toggle-sidebar {
    padding: 3px 6px;
    font-size: 10px;
    transform: translateY(-10px);
  }

  .live-indicator {
    font-size: 9px;
  }

  .pip-canvas {
    width: 160px;
    height: 220px;
    bottom: 50px;
    left: 15px;
    right: auto;
    border: 2px solid rgba(0, 255, 200, 0.8);
    /* Làm nét viền đậm hơn trên mobile */
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.5), 0 8px 32px rgba(0, 0, 0, 0.9);
    /* Tăng độ sáng và bóng đổ */
  }

  .scanner-hud {
    transform: scale(0.65);
  }

  .btn-retry-fixed {
    top: auto;
    bottom: 35px;
    right: 15px;
    padding: 6px 16px;
    font-size: 11px;
  }

  .placeholder-warning {
    white-space: normal !important;
    max-width: 90% !important;
    font-size: 0.8rem !important;
  }


  .btn-start {
    padding: 10px 20px;
    font-size: 12px;
  }

  .face-shape-big {
    font-size: 26px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .scanner-hud {
    transform: scale(0.55);
  }

  .pip-canvas {
    width: 90px;
    height: 120px;
  }

  .btn-retry-fixed {
    padding: 6px 12px;
    font-size: 10px;
    top: auto;
    bottom: 30px;
    right: 12px;
  }

  .face-shape-big {
    font-size: 22px;
  }
}

/* ── Tablet & Desktop UI Scaling (Tối ưu cho màn hình ngang/Tablet) ── */
@media (min-width: 768px) {
  .btn-toggle-sidebar {
    padding: 8px 18px;
    font-size: 14px;
  }

  .live-indicator {
    padding: 6px 14px;
    font-size: 14px;
  }

  .stats-mini {
    font-size: 14px;
  }

  .logo {
    font-size: 22px;
  }

  .cyber-typewriter {
    font-size: 26px;
    /* Chữ to hơn hẳn trên tablet để dễ đọc từ xa */
  }

  .btn-start {
    padding: 16px 44px;
    font-size: 18px;
    margin-top: 15px;
    animation: btnStartPulse 2.5s infinite ease-in-out;
    /* Mời gọi khách hàng */
  }

  .placeholder-warning {
    font-size: 1.1rem;
    /* Tăng từ 1rem */
    padding: 10px 20px;
    margin-top: 8px;
  }
}

/* Hiệu ứng nhịp đập cho nút THỬ NGAY trên Tablet */
@keyframes btnStartPulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.4), inset 0 0 10px rgba(0, 255, 200, 0.2);
    border-color: rgba(0, 255, 200, 0.8);
  }

  50% {
    box-shadow: 0 0 45px rgba(0, 255, 200, 0.8), inset 0 0 20px rgba(0, 255, 200, 0.4);
    border-color: rgba(0, 255, 200, 1);
  }
}

/* ══════════════════════════════════════════════════════════════
   ██ Portrait Kiosk — 16" dọc (1200×1920 và tương tự) ██
   Điều kiện: chiều cao ≥ 1200px VÀ tỉ lệ portrait (width < height)
   ══════════════════════════════════════════════════════════════ */
@media (min-height: 1200px) and (max-aspect-ratio: 5/6) {

  /* ── Topbar: lớn hơn cho dễ bấm ── */
  :root { --topbar-h: 64px; }

  .topbar { padding: 0 24px; }

  .logo { font-size: 26px; letter-spacing: 3px; }

  .btn-toggle-sidebar {
    padding: 10px 20px; font-size: 15px; border-radius: 10px;
  }

  #btnPhotoTryOn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    text-decoration: none;
  }

  .live-indicator { padding: 8px 16px; font-size: 15px; }

  .stats-mini { font-size: 15px; gap: 14px; }

  /* ── Placeholder: cân đối khoảng trống ── */
  .placeholder-bottom {
    padding: 30px 30px 8vh;
    gap: 24px;
  }

  .placeholder-title {
    font-size: 32px;
    letter-spacing: 6px;
  }

  .placeholder-title-icon { font-size: 36px; }

  .cyber-typewriter-container {
    min-height: 44px;
    max-width: 85%;
  }

  .cyber-typewriter {
    font-size: 28px;
    line-height: 1.5;
    letter-spacing: 1px;
  }

  .btn-start {
    padding: 22px 60px;
    font-size: 22px;
    letter-spacing: 3px;
    border-radius: 14px;
    gap: 12px;
    margin-top: 20px;
  }

  .btn-start-icon { font-size: 26px; }

  .placeholder-warning {
    font-size: 1.2rem;
    padding: 18px 24px;
    max-width: 95%;
    line-height: 1.7;
    margin-top: 10px;
    white-space: nowrap;
  }


  /* ── HUD Loading ── */
  .hud-loading-container { margin-top: 16px; }
  .hud-progress-ring { width: 88px; height: 88px; }
  .hud-progress-ring circle { r: 38; cx: 44; cy: 44; }
  .hud-loading-text { font-size: 20px; }

  /* ── Scanner HUD: phóng to cho tỉ lệ ── */
  .scanner-hud {
    width: 360px;
    height: 360px;
  }

  .scanner-label {
    font-size: 14px;
    letter-spacing: 4px;
    bottom: -40px;
  }

  .scanner-subtitle { font-size: 20px; margin-top: 28px; }
  .scanner-hint { font-size: 14px; }
  .scanner-face { width: 110px; height: 130px; }

  /* ── Marquee text ── */
  .marquee-wrapper { font-size: 34px; }

  /* ── Result sidebar: không hiện trên portrait ── */
  .sidebar { display: none; }

  /* ── PiP Canvas ── */
  .pip-canvas {
    width: 280px; height: 380px;
    bottom: 30px; left: 30px;
    right: auto;
  }

  /* ── Retry button ── */
  .btn-retry-fixed {
    padding: 14px 32px;
    font-size: 18px;
    border-radius: 12px;
  }

  /* ── Face result (nếu hiện overlay) ── */
  .face-shape-big { font-size: 48px; letter-spacing: 5px; }
  .face-shape-vi { font-size: 24px; }
  .face-desc { font-size: 18px; line-height: 1.7; }
  .meter-lbl { font-size: 15px; }
  .meter-val { font-size: 16px; }
  .meter-track { height: 10px; border-radius: 5px; }

  /* ── Try-on button ── */
  .btn-try-on-now {
    padding: 18px 36px !important;
    font-size: 24px !important;
    border-radius: 40px !important;
  }

  /* ── Corner decorations: lớn hơn ── */
  .vp-corner { width: 50px; height: 50px; }
  .vp-corner.c-tl { top: 20px; left: 20px; }
  .vp-corner.c-tr { top: 20px; right: 20px; }
  .vp-corner.c-bl { bottom: 20px; left: 20px; }
  .vp-corner.c-br { bottom: 20px; right: 20px; }

  /* ── Try-on sidebar: phóng to toàn bộ cho 1200×1920 ── */
  #tryOnSidebar {
    width: 380px !important;
    padding: 16px !important;
    border-radius: 16px !important;
    top: 30px !important;
    left: 24px !important;
    max-height: 70vh !important;
  }

  /* Tiêu đề sidebar */
  #tryOnSidebar > div:first-child {
    font-size: 16px !important;
    letter-spacing: 2px;
    margin-bottom: 12px !important;
  }

  /* Các item kính đề xuất */
  .try-on-item {
    padding: 12px 14px !important;
    margin-bottom: 8px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
  }

  .try-on-item strong {
    font-size: 17px !important;
  }

  .try-on-item span {
    font-size: 14px !important;
  }

  /* Section headers (PHÙ HỢP NHẤT, GỢI Ý THÊM) */
  #tryOnList > li:not(.try-on-item) {
    font-size: 13px !important;
    padding: 6px 10px !important;
    letter-spacing: 1px !important;
  }

  /* Yêu thích section */
  #sidebarFavSection > div:first-child {
    font-size: 12px !important;
    padding: 5px 10px !important;
  }

  .sidebar-fav-item {
    font-size: 15px !important;
    padding: 8px 10px !important;
  }

  /* Nút Xem thêm + Thoát */
  .btn-show-more,
  .btn-exit-try-on {
    padding: 12px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
    letter-spacing: 2px !important;
  }

  /* Thông báo hết hàng */
  #outOfStockMsg {
    font-size: 14px !important;
    padding: 10px !important;
  }

  /* Scrollbar rộng hơn */
  #tryOnList::-webkit-scrollbar { width: 6px !important; }
}


/* --- Marquee Text --- */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 70% !important;
  max-width: 700px !important;
  display: flex;
  align-items: center;
  margin: 0 auto;
  position: relative; /* Định vị các lớp che phủ mờ ở 2 đầu */
}

/* Lớp phủ mờ 2 đầu bằng gradient tĩnh thay thế cho mask-image để tối ưu hóa render (giúp chữ chạy 60fps/120fps mượt mà) */
.marquee-container::before,
.marquee-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 5;
  pointer-events: none;
}

.marquee-container::before {
  left: 0;
  background: linear-gradient(to right, #020810 0%, transparent 100%);
}

.marquee-container::after {
  right: 0;
  background: linear-gradient(to left, #020810 0%, transparent 100%);
}

.marquee-wrapper {
  display: inline-flex;
  animation: marqueeSlide 45s linear infinite;
  font-family: 'Chakra Petch', 'Space Grotesk', 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  background: repeating-linear-gradient(90deg, var(--cyan) 0px, var(--accent2) 250px, var(--purple) 500px, var(--cyan) 750px);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
  text-transform: uppercase;

  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  perspective: 1000px;
  transform: translate3d(0, 0, 0);
  text-rendering: geometricPrecision; /* Chống lệch/nhấp nhô pixel khi dựng chữ chuyển động */
}



.marquee-content {
  padding-right: 50px;
}

@keyframes marqueeSlide {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes glowPulse {
  0% {
    filter: drop-shadow(0 0 5px rgba(0, 255, 200, 0.4));
  }

  100% {
    filter: drop-shadow(0 0 15px rgba(0, 255, 200, 0.9)) drop-shadow(0 0 25px rgba(168, 85, 247, 0.6));
  }
}

/* Layout dòng thông tin sản phẩm trong Catalog */
.catalog-card-meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 6px;
}
.catalog-card-price {
  font-size: 13px !important;
  font-style: normal !important;
  margin: 0 !important;
}
.catalog-card-name {
  font-size: 14px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-height: auto !important;
  margin: 0 0 4px 0 !important;
  line-height: 1.4 !important;
}

/* Đảm bảo bảng màu tròng kính cố định ở góc dưới bên trái trên Desktop khi nằm trong sidebar DOM */

/* Đảm bảo bảng màu tròng kính cố định ở góc dưới bên trái trên Desktop khi nằm trong sidebar DOM */
#lensColorPanel {
  position: fixed !important;
  bottom: 20px !important;
  left: 20px !important;
  z-index: 100 !important;
}

/* Styling for photochromic button LED effect */
#btnPhotochromic.active {
  position: relative !important;
  overflow: hidden !important;
  border: none !important;
  background: transparent !important;
  color: #ffc832 !important;
  box-shadow: 0 0 10px rgba(255, 200, 50, 0.4) !important;
  z-index: 1 !important;
}
#btnPhotochromic.active::after {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 250px !important;
  height: 250px !important;
  background: conic-gradient(#ffd700, rgba(255, 215, 0, 0.15), #ffd700) !important;
  animation: borderRotateCenter 1.5s linear infinite !important;
  z-index: -2 !important;
  transform-origin: center !important;
}
#btnPhotochromic.active::before {
  content: "" !important;
  position: absolute !important;
  inset: 2px !important;
  border-radius: 8px !important;
  background: linear-gradient(to right, #2f2205 0%, #2f2205 var(--photochromic-progress, 0%), var(--surface, #12141c) var(--photochromic-progress, 0%)) !important;
  z-index: -1 !important;
}

/* ══════════════════════════════════════════════════════════════
   ██ GENERAL PORTRAIT LAYOUT (Giao diện màn hình đứng) ██
   Đảm bảo không ảnh hưởng tới giao diện nằm ngang hiện tại.
   ══════════════════════════════════════════════════════════════ */
@media (orientation: portrait) {
  /* Xếp dọc layout camera và sidebar kết quả (nếu hiển thị) */
  .layout {
    flex-direction: column;
  }

  /* Khung video camera chiếm phía trên */
  .cam-panel {
    flex: 1;
    width: 100%;
    height: 55vh;
  }

  /* Dashboard ẩn đi trên mobile/màn đứng để nhường diện tích cho camera */
  .sidebar {
    display: none !important;
  }

  /* Đưa menu chọn kính gợi ý nằm ngang sát cạnh dưới cùng màn hình dọc (Phóng to khung và chữ, tránh che khuất) */
  #tryOnSidebar {
    position: absolute !important;
    top: auto !important;
    bottom: 70px !important;
    left: 50px !important;
    right: 50px !important;
    transform: none !important;
    width: calc(100% - 100px) !important;
    max-width: calc(100% - 100px) !important;
    height: auto !important;
    max-height: 90vh !important;
    border-radius: 16px !important;
    padding: 16px 20px 0px 20px !important;


    display: none !important;
    grid-template-areas: 
      "title"
      "list"
      "color" !important;
    grid-template-rows: auto auto auto !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    backdrop-filter: blur(12px) !important;
    border: 2px solid rgba(0, 255, 200, 0.35) !important;
    background: rgba(5, 10, 15, 0.85) !important;
    animation: panelGlow 3s infinite !important;
    box-sizing: border-box !important;
  }

  /* Kích hoạt hiển thị dạng grid khi active */
  #tryOnSidebar.active {
    display: grid !important;
  }

  /* Chỉnh tiêu đề gợi ý nằm trên đầu khung chọn kính */
  #tryOnSidebar h3 {
    grid-area: title !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    letter-spacing: 2.5px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    width: calc(100% - 240px) !important;
    line-height: 38px !important;
    text-align: center !important;
    color: var(--accent) !important;
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.7) !important;
  }

  /* Cấu hình danh sách kính chạy cuộn ngang */
  #tryOnList {
    grid-area: list !important;
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: 100% !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px 0 12px 0 !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(0,255,200,0.35) transparent !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #tryOnList::-webkit-scrollbar {
    height: 4px !important;
    display: block !important;
  }
  #tryOnList::-webkit-scrollbar-track {
    background: transparent !important;
  }
  #tryOnList::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 200, 0.35) !important;
    border-radius: 4px !important;
  }
  #tryOnList::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 200, 0.7) !important;
  }

  /* Ẩn các nhãn tiêu đề phân loại bên trong danh sách cuộn ngang */
  #tryOnSidebar #tryOnList > li:not(.try-on-item) {
    display: none !important;
  }

  /* Các thẻ gọng kính hiển thị dạng thẻ dẹt nằm ngang, to rõ và tự động xuống dòng */
  #tryOnSidebar .try-on-item {
    position: relative !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    width: 245px !important;
    height: 185px !important;
    margin: 0 !important;
    padding: 3px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
    line-height: 1.3 !important;
    gap: 0 !important;
    border: 1px solid rgba(0, 255, 200, 0.25) !important;
    background: rgba(11, 16, 27, 0.9) !important;
    transition: all 0.25s ease-in-out !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    /* anti-aliasing hardware acceleration for sharp rounded borders */
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-mask-image: -webkit-radial-gradient(white, black) !important;
  }
  #tryOnSidebar .try-on-item .item-img-wrap {
    position: relative !important;
    width: 100% !important;
    height: 105px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border-bottom: none !important;
    border-top-left-radius: 11px !important;
    border-top-right-radius: 11px !important;
    overflow: hidden !important;
  }
  #tryOnSidebar .try-on-item .item-img-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    padding: 6px;
    box-sizing: border-box !important;
  }
  #tryOnSidebar .try-on-item .item-img-wrap::before {
    content: "👓";
    font-size: 24px;
    opacity: 0.15;
    position: absolute;
    display: none;
  }
  #tryOnSidebar .try-on-item .item-img-wrap.no-img::before {
    display: block !important;
  }
  #tryOnSidebar .try-on-item .item-star-badge {
    position: absolute !important;
    bottom: auto !important;
    right: auto !important;
    top: 8px !important;
    left: 8px !important;
    font-size: 18px !important;
    color: #ffd700 !important;
    z-index: 3 !important;
    animation: starBlink 1.4s infinite ease-in-out !important;
    transform-origin: center center !important;
  }

  #tryOnSidebar .try-on-item .item-info-wrap {
    padding: 6px 12px 8px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100% !important;
    flex-grow: 1 !important;
    box-sizing: border-box !important;
  }
  #tryOnSidebar .try-on-item:hover {
    background: rgba(16, 26, 43, 0.95) !important;
    border-color: rgba(0, 255, 200, 0.5) !important;
    transform: translateY(-2px) translateZ(0) !important;
    box-shadow: 0 4px 12px rgba(0, 255, 200, 0.15) !important;
  }
  #tryOnSidebar .try-on-item.no-data {
    border-color: rgba(255, 165, 0, 0.35) !important;
  }
  #tryOnSidebar .try-on-item.no-data:hover {
    border-color: rgba(255, 165, 0, 0.65) !important;
    background: rgba(30, 24, 16, 0.95) !important;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.15) !important;
  }
  #tryOnSidebar .try-on-item.selected {
    border: none !important;
    background: transparent !important;
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.65) !important;
    z-index: 1 !important;
  }
  #tryOnSidebar .try-on-item.no-data.selected {
    border: none !important;
    background: transparent !important;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.65) !important;
    z-index: 1 !important;
  }
  #tryOnSidebar .try-on-item.selected::before {
    content: "" !important;
    position: absolute !important;
    inset: 2px !important;
    border-radius: 10px !important;
    background: rgba(11, 16, 27, 0.98) !important;
    z-index: -1 !important;
  }
  #tryOnSidebar .try-on-item.selected::after {
    content: "" !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: conic-gradient(#00ffc8, rgba(0, 255, 200, 0.15), #00ffc8) !important;
    animation: borderRotate 1.5s linear infinite !important;
    z-index: -2 !important;
    transform-origin: center !important;
  }
  #tryOnSidebar .try-on-item.no-data.selected::after {
    background: conic-gradient(#ffa500, rgba(255, 165, 0, 0.15), #ffa500) !important;
  }
  #tryOnSidebar .try-on-item .item-title-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 5px !important;
    width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
  #tryOnSidebar .try-on-item .item-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    width: auto !important;
    max-width: 40% !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    flex-shrink: 1 !important;
  }
  #tryOnSidebar .try-on-item .item-mat {
    font-size: 13px !important;
    color: rgba(0, 255, 200, 0.5) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    width: auto !important;
    max-width: 60% !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    flex-shrink: 1 !important;
  }

  #tryOnSidebar .try-on-item .item-price-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    width: 100% !important;
    margin-top: 2px !important;
  }
  #tryOnSidebar .try-on-item .item-price {
    font-size: 15px !important;
    font-weight: 700 !important;
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
  }
  #tryOnSidebar .try-on-item .item-match {
    font-size: 13px !important;
    color: #00ffc8 !important;
    font-weight: bold !important;
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
  }
  #tryOnSidebar .try-on-item .item-warn {
    font-size: 11px !important;
    color: rgba(255, 165, 0, 0.8) !important;
    display: block !important;
    width: 100% !important;
    margin-top: 4px !important;
  }
  #tryOnSidebar .try-on-item br {
    display: none !important;
  }
  #tryOnSidebar .try-on-item.fav-item span.item-star {
    display: inline-block !important;
    width: auto !important;
    margin-right: 4px !important;
    vertical-align: middle !important;
    font-size: 15px !important;
    color: #ffd700 !important;
  }
  #tryOnSidebar .try-on-item .fav-remove-inline {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    background: rgba(255, 60, 60, 0.15) !important;
    border-radius: 50% !important;
    color: rgba(255, 100, 100, 0.8) !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: all 0.2s !important;
    z-index: 10 !important;
  }

  #tryOnSidebar .try-on-item .fav-remove-inline:hover {
    background: rgba(255, 60, 60, 0.3) !important;
    color: #ff3c3c !important;
  }
  @keyframes starBlink {
    0%, 100% {
      transform: scale(0.95);
      filter: drop-shadow(0 0 2px #ffd700);
      text-shadow: 0 0 4px rgba(255, 215, 0, 0.7);
      opacity: 0.75;
    }
    50% {
      transform: scale(1.25);
      filter: drop-shadow(0 0 6px #ffd700) drop-shadow(0 0 10px #ffaa00);
      text-shadow: 0 0 10px #ffd700, 0 0 18px #ffaa00;
      color: #ffffff !important;
      opacity: 1;
    }
  }

  @keyframes cyberShine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
  }

  @keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  @keyframes cyberPulse {
    0% {
      transform: scale(1);
      box-shadow: 0 0 12px rgba(0, 255, 200, 0.3);
      border-color: rgba(0, 255, 200, 0.6);
    }
    50% {
      transform: scale(1.04);
      box-shadow: 0 0 22px rgba(0, 255, 200, 0.65), 0 0 8px rgba(0, 255, 200, 0.25);
      border-color: #00ffc8;
    }
    100% {
      transform: scale(1);
      box-shadow: 0 0 12px rgba(0, 255, 200, 0.3);
      border-color: rgba(0, 255, 200, 0.6);
    }
  }

  .btn-show-more {
    position: absolute !important;
    top: 11px !important; /* Slightly shift up to align center with the larger 44px height */
    right: 20px !important;
    width: 150px !important;
    height: 44px !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    z-index: 102 !important;

    /* Outstanding Sci-Fi Hologram Moving Gradient */
    border: 1.5px solid #00ffc8 !important;
    background: linear-gradient(135deg, rgba(0, 255, 200, 0.25), rgba(0, 183, 255, 0.55), rgba(168, 85, 247, 0.45), rgba(0, 255, 200, 0.25)) !important;
    background-size: 300% 300% !important;
    color: #ffffff !important;
    text-shadow: 0 0 6px #00ffc8, 0 0 12px rgba(0, 255, 200, 0.6) !important;
    box-shadow: 0 0 16px rgba(0, 255, 200, 0.45), 0 0 6px rgba(0, 183, 255, 0.2) !important;
    animation: gradientShift 4s ease infinite, cyberPulse 2s ease-in-out infinite !important;
    transition: all 0.2s ease-in-out !important;
  }
  .btn-show-more:hover {
    transform: scale(1.08) !important;
    background: linear-gradient(135deg, rgba(0, 255, 200, 0.45), rgba(0, 183, 255, 0.75), rgba(168, 85, 247, 0.65), rgba(0, 255, 200, 0.45)) !important;
    background-size: 200% 200% !important;
    box-shadow: 0 0 25px rgba(0, 255, 200, 0.8), 0 0 45px rgba(168, 85, 247, 0.6) !important;
    text-shadow: 0 0 10px #00ffc8, 0 0 20px #ffffff !important;
    border-color: #ffffff !important;
    animation: gradientShift 1.5s ease infinite !important; /* speed up gradient shifting */
  }

  /* PD Bar — đối xứng với XEM THÊM, góc trên bên trái */
  #pdBar {
    position: absolute !important;
    top: 11px !important;
    left: 20px !important;
    width: 185px !important;
    height: 44px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    border-radius: 8px !important;
    background: rgba(0, 255, 200, 0.08) !important;
    border: 1.5px solid rgba(0, 255, 200, 0.32) !important;
    z-index: 102 !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    padding: 0 6px !important;
    box-sizing: border-box !important;
  }
  #pdBar:hover {
    border-color: rgba(0, 255, 200, 0.65) !important;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.2) !important;
  }
  #pdBar .pd-bar-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: rgba(0, 255, 200, 0.6) !important;
    font-family: 'JetBrains Mono', monospace !important;
    letter-spacing: 0.5px !important;
    margin-right: 1px !important;
    text-transform: uppercase !important;
  }
  #pdBar .pd-bar-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 16px !important;
    border-radius: 5px !important;
    border: 1px solid rgba(0, 255, 200, 0.35) !important;
  }
  #pdBar .pd-bar-val {
    font-size: 19px !important;
    min-width: 26px !important;
    text-shadow: 0 0 8px rgba(0, 255, 200, 0.6) !important;
  }
  #pdBar .pd-bar-val.flash {
    text-shadow: 0 0 20px rgba(0, 255, 200, 1), 0 0 8px rgba(0, 255, 200, 0.7) !important;
  }
  #pdBar .pd-bar-unit {
    font-size: 14px !important;
    color: rgba(0, 255, 200, 0.55) !important;
  }


  .btn-exit-try-on {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
    width: 90px !important;
    height: 38px !important;
    margin: 0 0 0 auto !important; /* Push to the absolute right side of the flex row */
    font-size: 12px !important;
    font-weight: bold !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    z-index: 102 !important;
    align-self: center !important;
    
    background: transparent !important;
    border: 1px solid rgba(255, 60, 60, 0.4) !important;
    color: rgba(255, 100, 100, 0.9) !important;
    transition: all 0.2s ease-in-out !important;
  }
  .btn-exit-try-on:hover {
    background: rgba(255, 60, 60, 0.18) !important;
    color: #ff4444 !important;
    border-color: #ff4444 !important;
    box-shadow: 0 0 10px rgba(255, 60, 60, 0.45) !important;
    transform: scale(1.03) !important;
  }

  /* Bảng màu tròng kính nằm trong menu gợi ý, thiết kế trong suốt và phóng to thêm */
  #lensColorPanel {
    grid-area: color !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 101 !important;
    padding: 0 0 4px 0 !important;
    margin-top: 6px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    animation: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #lensColorPanel::before {
    display: none !important;
  }
  #lensColorPanel > div {
    display: flex !important;
    flex-wrap: nowrap !important; /* keep inline on same row */
    justify-content: flex-start !important; /* start align and let button push right */
    align-items: center !important;
    gap: 12px 16px !important;
    padding-right: 0 !important;
  }

  #lensColorPanel > div > div {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px 10px !important;
  }
  #lensColorPanel .lens-color-btn {
    width: 36px !important;
    height: 36px !important;
  }
  #lensColorPanel .lens-color-btn span {
    font-size: 16px !important;
  }
  #lensColorPanel #btnPhotochromic {
    padding: 8px 18px !important;
    font-size: 14px !important;
    border-radius: 18px !important;
  }
  #lensColorPanel #btnPhotochromic span {
    font-size: 16px !important;
  }
  #lensColorPanel span[style*="text-transform"] {
    font-size: 14px !important;
    letter-spacing: 1.5px !important;
  }
  #lensColorPanel div[style*="width:1px"] {
    height: 28px !important;
  }

  /* Định dạng catalog dạng 3 cột để hiển thị sản phẩm cân đối trên di động */
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px 14px !important;
  }

  .catalog-inner {
    max-width: 100% !important;
    width: 100% !important;
    padding: 60px 45px 16px 45px !important;
  }

  /* Phóng to toàn bộ cỡ chữ, thanh tìm kiếm và nút bấm trong Catalog */
  .catalog-header {
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 56px !important;
  }
  .catalog-card {
    border: 1px solid rgba(0, 255, 200, 0.25) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 255, 200, 0.05) !important;
  }
  .catalog-title {
    font-size: 45px !important;
    font-weight: 800 !important;
    letter-spacing: 2px !important;
    color: var(--accent) !important;
    margin: 0 auto !important;
    animation: neonBreatheText 3s infinite ease-in-out !important;
  }
  .catalog-search {
    position: absolute !important;
    right: 122px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    flex: none !important;
    width: 200px !important;
    font-size: 15px !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
    margin: 0 !important;
  }
  .catalog-search::placeholder {
    font-size: 13px !important;
  }
  .catalog-close {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 15px !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    margin: 0 !important;
  }
  .catalog-style-tabs {
    gap: 16px !important;
    padding: 12px 0 24px 0 !important;
  }
  .catalog-style-tab {
    font-size: 22px !important;
    padding: 16px 32px !important;
    border-radius: 36px !important;
  }
  .catalog-style-tab .tab-count {
    font-size: 16px !important;
  }
  .catalog-mat-tabs {
    gap: 14px !important;
    padding: 16px 0 !important;
  }
  .catalog-mat-tab {
    font-size: 18px !important;
    padding: 12px 24px !important;
    border-radius: 14px !important;
  }
  .catalog-mat-tab .tab-count {
    font-size: 14px !important;
  }
  .catalog-card-img {
    aspect-ratio: 2.2/1 !important;
    padding: 8px 8px 4px 8px !important;
  }
  .catalog-card-info {
    padding: 12px 10px !important;
  }
  .catalog-card-meta-row {
    margin-bottom: 12px !important;
  }
  .catalog-card-name {
    font-size: 17px !important;
    line-height: 1.35 !important;
  }
  .catalog-card-price {
    font-size: 15px !important;
  }
  .catalog-card-actions {
    gap: 12px !important;
  }
  .catalog-btn-try {
    font-size: 15px !important;
    height: 44px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .catalog-btn-fav {
    font-size: 26px !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transition: all 0.3s ease-in-out !important;
    /* Tối ưu hóa chống răng cưa khi bo góc */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
  }
  .catalog-btn-fav:not(.fav-active) {
    animation: favAttentionBlink 1.8s infinite ease-in-out !important;
  }
  .catalog-btn-fav.fav-active {
    position: relative !important;
    overflow: hidden !important;
    color: #ffd700 !important;
    background: transparent !important;
    border: none !important;
    animation: favPulse 0.45s ease-out !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.75) !important;
    z-index: 1 !important;
  }
  .catalog-btn-fav.fav-active::after {
    content: "" !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: conic-gradient(#ffd700, rgba(255, 215, 0, 0.15), #ffd700) !important;
    animation: borderRotate 1.5s linear infinite !important;
    z-index: -2 !important;
    transform-origin: center !important;
  }
  .catalog-btn-fav.fav-active::before {
    content: "" !important;
    position: absolute !important;
    inset: 2px !important;
    border-radius: 6px !important;
    background: #0c101d !important;
    z-index: -1 !important;
  }

  @keyframes favAttentionBlink {
    0%, 100% {
      transform: scale(1);
      box-shadow: 0 0 4px rgba(255, 200, 50, 0.15);
      border-color: rgba(255, 200, 50, 0.25) !important;
      background: rgba(255, 200, 50, 0.04) !important;
      color: rgba(255, 200, 50, 0.45) !important;
    }
    50% {
      transform: scale(1.08);
      box-shadow: 0 0 16px rgba(255, 200, 50, 0.65);
      border-color: rgba(255, 200, 50, 0.8) !important;
      background: rgba(255, 200, 50, 0.15) !important;
      color: #ffd700 !important;
    }
  }

  @keyframes neonBreatheText {
    0%, 100% {
      text-shadow: 0 0 8px rgba(0, 255, 200, 0.25), 0 0 20px rgba(0, 255, 200, 0.08);
      opacity: 0.82;
      transform: scale(1);
    }
    50% {
      text-shadow: 0 0 24px rgba(0, 255, 200, 0.85), 0 0 45px rgba(0, 255, 200, 0.4);
      opacity: 1;
      transform: scale(1.02);
    }
  }
  @keyframes borderRotate {
    100% { transform: rotate(360deg); }
  }

  @keyframes borderRotateCenter {
    0% {
      transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
      transform: translate(-50%, -50%) rotate(360deg);
    }
  }

  #btnPhotochromic.active::before {
    border-radius: 16px !important;
  }
}

/* ── Retry button in Try-On Mode (Move to Top Right) ── */
.btn-retry-fixed.in-tryon {
  top: 30px !important;
  bottom: auto !important;
  right: 50px !important;
  left: auto !important;
}

@media (max-width: 1024px) {
  .btn-retry-fixed.in-tryon {
    right: 20px !important;
    top: 20px !important;
    bottom: auto !important;
  }
}

@media (max-width: 768px) {
  .btn-retry-fixed.in-tryon {
    top: 15px !important;
    bottom: auto !important;
    right: 15px !important;
    padding: 6px 16px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  .btn-retry-fixed.in-tryon {
    top: 12px !important;
    bottom: auto !important;
    right: 12px !important;
    padding: 6px 12px !important;
    font-size: 10px !important;
  }
}

/* ── AI Recommendation Match Badge ── */
.match-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(2, 8, 16, 0.88); /* Nền tối mờ ảo */
  border: 2px solid var(--cyan); /* Viền màu Cyan rực sáng */
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  width: 38px;
  height: 38px;
  border-radius: 50%; /* Khung tròn */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 255, 200, 0.5), inset 0 0 6px rgba(0, 255, 200, 0.25);
  z-index: 5;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  text-shadow: 0 0 4px rgba(0, 255, 200, 0.8);
  letter-spacing: -0.5px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@media (max-width: 480px) {
  .match-badge {
    width: 34px;
    height: 34px;
    font-size: 11.5px;
    top: 4px;
    right: 4px;
  }
}

/* ── Letter-by-letter waving breath animation ── */
.breath-letters span {
  display: inline-block;
  animation: letterBreathe 2s ease-in-out infinite;
}

@keyframes letterBreathe {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 2px rgba(0, 255, 200, 0.35));
    opacity: 0.8;
  }
  50% {
    transform: translateY(-6px) scale(1.18); /* Nhô cao và phóng to nhẹ tạo độ đặc sắc */
    filter: drop-shadow(0 0 12px rgba(0, 255, 200, 0.95)) drop-shadow(0 0 22px rgba(0, 183, 255, 0.6));
    opacity: 1;
  }
}

/* ── Nút Highlight THỬ QUA ẢNH (Photo Try-On CTA) ── */
@keyframes photoBtnGlow {
  0%, 100% {
    border-color: rgba(0, 255, 200, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.35), inset 0 0 6px rgba(0, 255, 200, 0.1);
    transform: scale(1);
  }
  50% {
    border-color: #00ffc8;
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.75), 0 0 32px rgba(168, 85, 247, 0.35), inset 0 0 10px rgba(0, 255, 200, 0.2);
    transform: scale(1.03);
  }
}

#btnPhotoTryOn {
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.16) 0%, rgba(168, 85, 247, 0.16) 100%) !important;
  border: 1.5px solid rgba(0, 255, 200, 0.55) !important;
  color: #00ffc8 !important;
  font-weight: 700 !important;
  text-shadow: 0 0 8px rgba(0, 255, 200, 0.5);
  animation: photoBtnGlow 2.4s infinite ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#btnPhotoTryOn .icon {
  font-size: 13.5px;
  filter: drop-shadow(0 0 6px rgba(0, 255, 200, 0.8));
  display: inline-block;
  transition: transform 0.25s ease;
}

#btnPhotoTryOn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 200, 0.32) 0%, rgba(168, 85, 247, 0.32) 100%) !important;
  border-color: #00ffc8 !important;
  box-shadow: 0 0 25px rgba(0, 255, 200, 0.9), 0 0 40px rgba(168, 85, 247, 0.5) !important;
  transform: scale(1.06) translateY(-1px);
}

#btnPhotoTryOn:hover .icon {
  transform: scale(1.22) rotate(-6deg);
}

/* ── Nút Làm Mới (Hard Refresh App) ── */
.btn-refresh-app {
  border-color: rgba(0, 255, 200, 0.45) !important;
  color: #00ffc8 !important;
  background: rgba(0, 255, 200, 0.08) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer;
}

.btn-refresh-app:hover {
  background: rgba(0, 255, 200, 0.22) !important;
  box-shadow: 0 0 15px rgba(0, 255, 200, 0.6) !important;
  transform: translateY(-1px);
}

.btn-refresh-app:active {
  transform: rotate(180deg) scale(0.92);
}

/* ── Nút Cứu Nguy Khi Camera Bị Treo Ở 95% ── */
.btn-rescue-reload {
  margin-top: 14px;
  padding: 8px 16px;
  background: rgba(255, 60, 80, 0.16);
  border: 1px solid rgba(255, 80, 100, 0.7);
  border-radius: 20px;
  color: #ff6b6b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: bold;
  cursor: pointer;
  animation: pulseRescue 1.5s infinite;
  transition: all 0.2s ease;
  z-index: 50;
}

.btn-rescue-reload:hover {
  background: rgba(255, 60, 80, 0.35);
  box-shadow: 0 0 14px rgba(255, 60, 80, 0.7);
  color: #fff;
  transform: scale(1.04);
}

@keyframes pulseRescue {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}