:root {
  --ink: #251821;
  --paper: #fffaf6;
  --pink: #f5a6bd;
  --red: #ee6f94;
  --line: rgba(37, 24, 33, 0.14);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f5b8c9;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  min-height: 100svh;
  overflow: hidden;
}
.noise {
  position: fixed;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
.shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: min(560px, 100%);
  min-height: 640px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  padding: 34px 42px;
  box-shadow: 0 28px 70px rgba(107, 43, 65, 0.22);
  display: flex;
  flex-direction: column;
}
.brand {
  font-family: "Playfair Display", serif;
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.1em;
  color: #000000;
  transform: translate(-15px, -10px);

}
.spark {
  color: var(--red);
  font-size: 18px;
  margin-right: 3px;
}
.gate-copy {
  margin: auto 0 38px;
}
.eyebrow {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.20em;
  font-weight: 500;
  margin: 0;
  color: #9a506a;
  transform: translateX(-12px) translateY(-210px);
  
}
h1 {
  font-size: 50px;
  line-height: 1;
  letter-spacing: -0.065em;
  margin: 0; 
  font-weight: 600;
  font-family: "Playfair Display", serif;
  font-style: italic;
  transform: translateX(-12px) translateY(-190px);
}
p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  color: #755b65;
}
.gate-copy > p:not(.eyebrow) {
  max-width: 300px;
  transform: translateX(-12px) translateY(-150px);
}
label {
  display: block;
  font-size: 11px;
  font-family: "DM Mono";
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0px;
  transform: translateX(-12px) translateY(-155px);
}
.key-row {
  display: flex;
  border-bottom: 1px solid var(--ink);
  gap: 10px;
  transform: translateX(-12px) translateY(-155px);
  
}
.key-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  font: 500 14px "DM Mono";
  outline: 0;
  padding: 13px 0;
  color: var(--ink);
  
}
button {
  font: 700 12px "Plus Jakarta Sans";
  cursor: pointer;
  border: 0;
}
.key-row button {
  background: var(--ink);
  color: white;
  border-radius: 50px;
  padding: 0 18px;
  margin: 5px 0;
}
.key-row button span,
.pill span {
  font-size: 18px;
  margin-left: 7px;
}
.form-note {
  font-size: 11px;
  margin-top: 12px;
  min-height: 20px;
  transform: translateX(-12px) translateY(-155px);
  color:red;
}
.form-note.error {
  color: #cb315c;
}
.gate-footer {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font: 9px "DM Mono";
  letter-spacing: 0.08em;
  color: #a48a93;
  transform: translateX(-12px) translateY(-155px);
}
.booth {
  width: min(1280px, calc(100vw - 40px));
  height: min(840px, calc(100svh - 40px));
  background: #fffaf6;
  border-radius: 30px;
  padding: 28px 34px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 70px rgba(107, 43, 65, 0.22);
  overflow: hidden;
}
.booth header,
.booth footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}
.live {
  font: 10px "DM Mono";
  letter-spacing: 0.12em;
}
.live b {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ea5b84;
  margin-right: 7px;
  box-shadow: 0 0 0 5px #fde3eb;
}
.stage {
  flex: 1;
  position: relative;
  perspective: 1300px;
}
.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: rotateY(-88deg) scale(0.9);
  transform-origin: left center;
  transition:
    opacity 0.32s ease,
    transform 0.72s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: rotateY(0) scale(1);
}
.screen h1 {
  font-size: clamp(45px, 7vw, 84px);
  margin-bottom: 27px;
}
.pill {
  border-radius: 100px;
  background: var(--ink);
  color: white;
  padding: 15px 22px;
  display: inline-flex;
  align-items: center;
}
.tip {
  font-size: 10px;
  margin-top: 22px;
  color: #aa939b;
}
.count {
  font: 800 clamp(150px, 28vw, 350px)/0.7 "Playfair Display";
  color: var(--red);
}
.countdown p {
  margin-top: 48px;
  font-size: 14px;
}
.photo {
  width: 205px;
  height: 270px;
  background: linear-gradient(145deg, #ffe2e9, #f498b4 55%, #ec779e);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  position: relative;
  box-shadow: 12px 17px 0 #f3c2ce;
  transform: rotate(-4deg);
  margin-bottom: 35px;
}
.photo span {
  font: 700 9px "DM Mono";
  letter-spacing: 0.12em;
  text-align: left;
}
.photo small {
  font: 9px "DM Mono";
  letter-spacing: 0.1em;
}
.face {
  font-size: 106px;
  line-height: 1;
  filter: drop-shadow(1px 4px 1px rgba(117, 43, 67, 0.2));
}
.flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
}
.result .eyebrow {
  margin-bottom: 12px;
}
.result h1 {
  font-size: 45px;
}
.actions {
  display: flex;
  gap: 8px;
}
.ghost {
  border: 1px solid var(--ink);
  background: transparent;
  border-radius: 100px;
  padding: 0 18px;
}
.booth footer {
  font: 9px "DM Mono";
  letter-spacing: 0.1em;
  color: #9f8791;
}
@media (max-width: 600px) {
  .shell {
    padding: 12px;
  }
  .card {
    min-height: 620px;
    padding: 28px 25px;
    border-radius: 22px;
  }
  .booth {
    height: calc(100svh - 24px);
    border-radius: 22px;
    padding: 24px 21px;
  }
  .key-row button {
    font-size: 0;
    padding: 0 15px;
  }
  .key-row button span {
    font-size: 20px;
    margin: 0;
  }
  h1 {
    font-size: 43px;
  }
}
.camera-wrap {
  width: min(360px, 72vw);
  aspect-ratio: 4/5;
  border-radius: 180px 180px 18px 18px;
  overflow: hidden;
  position: relative;
  background: #261a21;
  box-shadow: 12px 17px 0 #f3c2ce;
  margin-bottom: 20px;
}
.camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.camera-label {
  position: absolute;
  top: 17px;
  left: 17px;
  right: 17px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font: 9px "DM Mono";
  letter-spacing: 0.11em;
  text-shadow: 0 1px 4px #000;
}
.camera-label span {
  color: #ffd5df;
}
.camera-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 25px;
  color: #fff;
  font-size: 13px;
  line-height: 1.7;
  background: #34232c;
}
.camera h1 {
  font-size: 42px;
  margin-bottom: 17px;
}
.camera .eyebrow {
  margin-bottom: 9px;
}
.countdown .camera-wrap {
  width: min(460px, 80vw);
  aspect-ratio: 16/10;
  border-radius: 22px;
  margin: 0;
  box-shadow: none;
}
.count {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: #fff;
  text-shadow: 0 4px 25px #602438;
}
.countdown p {
  margin-top: 22px;
}
.photo img {
  width: 100%;
  height: 184px;
  object-fit: cover;
  transform: scaleX(-1);
  background: #f7b0c4;
}
@media (max-width: 600px) {
  .camera-wrap {
    width: min(300px, 80vw);
  }
}
.booth[hidden] {
  display: none !important;
}
.rgb-led-text {
  font-family:sans-serif;
  transform: translateX(155px) translateY(0px);
  font-size: 0.6rem; /* Kích thước chữ tùy chỉnh */
  font-weight: 800; /* Chữ đậm để hiệu ứng màu lên rõ nét hơn */
  text-transform: uppercase;
  
  /* Tạo dải màu RGB cầu vồng lặp lại */
  background: linear-gradient(
    90deg, 
    #ff0000, #ff7f00, #ffff00, #00ff00, #00ffff, #0000ff, #8b00ff, #ff0000
  );
  background-size: 500% auto; /* Kéo rộng dải màu để khi chạy hiệu ứng được mượt */
  
  /* Cắt dải màu theo khuôn chữ */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  
  /* Tạo độ sáng Neon / LED quanh chữ */
  filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.8)) 
          drop-shadow(0 0 15px rgba(255, 0, 255, 0.6));
          
  /* Gọi animation chạy màu liên tục */
  animation: rgb-running 4s linear infinite;
}

/* Keyframes di chuyển dải màu từ trái sang phải */
@keyframes rgb-running {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 300% center;
  }
}
.gate[hidden],
.booth[hidden] {
    display: none !important;
}

/* Live Preview v0.3.0: camera-only screen. */
.live-preview-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  margin: 22px 0 16px;
  border-radius: 24px;
  background: #261a21;
}
.trial-timer {
  padding: 7px 12px;
  border-radius: 100px;
  background: #fde3eb;
  color: #9a3154;
  font: 10px "DM Mono", monospace;
  letter-spacing: 0.08em;
}
.trial-timer[hidden] { display: none !important; }
.trial-timer strong { color: var(--ink); }
.live-preview-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform-origin: center;
  transition: transform 0.3s ease;
}
.live-preview-stage .camera-label { z-index: 2; }
.live-preview-stage .camera-error { z-index: 3; text-align: center; }
.camera-error[hidden] { display: none !important; }
.camera-info {
  position: absolute;
  left: 17px;
  bottom: 17px;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: min(310px, calc(100% - 34px));
  padding: 13px 15px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 13px;
  background: rgba(25,14,21,.72);
  color: #fff;
  backdrop-filter: blur(8px);
}
.camera-info[hidden] { display: none !important; }
.camera-info div { display: flex; justify-content: space-between; gap: 15px; }
.camera-info span { color: #ffd5df; font: 9px "DM Mono", monospace; letter-spacing: .1em; }
.camera-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 10px "DM Mono", monospace; }
.camera-source {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.camera-source[hidden] { display: none !important; }
.camera-source label {
  margin: 0;
  transform: none;
  white-space: nowrap;
}
.camera-source select {
  min-width: 0;
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #fff;
  color: var(--ink);
  font: 11px "DM Mono", monospace;
}
.preview-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.preview-button {
  min-width: 125px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  background: transparent;
  color: var(--ink);
}
.preview-button:hover,
.preview-button.active { background: var(--ink); color: #fff; }
.preview-button span { margin-left: 5px; font-family: "DM Mono", monospace; }
.live-preview-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  background: #000;
}
.live-preview-stage:fullscreen video { object-fit: cover; }
.live-preview-stage:fullscreen .camera-label,
.live-preview-stage:fullscreen .camera-info { display: none !important; }
@media (max-width: 600px) {
  .trial-timer { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 4; white-space: nowrap; }
  .live-preview-stage { margin: 18px 0 12px; border-radius: 18px; }
  .preview-controls { gap: 7px; margin-bottom: 12px; }
  .camera-source { align-items: stretch; flex-direction: column; gap: 6px; }
  .preview-button { min-width: calc(50% - 5px); flex: 1; padding: 11px 10px; }
}
