:root {
  --primary-gold: #f5cd79;
  --gold-dark: #c59b27;
  --primary-red: #e74c3c;
  --blood-red: #c0392b;
  --bg-dark: #05070c;
  --box-bg: rgba(8, 12, 20, 0.94);
  --box-border: rgba(245, 205, 121, 0.4);
  --text-main: #f5f6fa;
  --text-dim: #a4b0be;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ========================================================
   KHUNG GAME 9:16 CHUẨN MÀN HÌNH DỌC (PORTRAIT CINEMATIC)
   Áp dụng trên cả Điện thoại và Máy tính
   ======================================================== */
#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  max-width: calc(100dvh * 9 / 16);
  aspect-ratio: 9 / 16;
  background: #000;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(245, 205, 121, 0.22);
  border: 1px solid rgba(245, 205, 121, 0.28);
  border-radius: 12px;
  overflow: hidden;
  margin: auto;
}

/* Canvas hiệu ứng thời tiết / mưa */
#rain-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Các lớp hiển thị Media (Hình ảnh & Video) */
.media-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  pointer-events: none;
}

#game-video {
  z-index: 1;
}

#game-image {
  z-index: 2;
}

.media-layer.active {
  opacity: 1;
  pointer-events: auto;
}

/* Hiệu ứng Ken Burns cho ảnh tĩnh */
.ken-burns {
  animation: kenburnsEffect 25s infinite alternate ease-in-out;
}

@keyframes kenburnsEffect {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.06) translate(-1%, -1%); }
  100% { transform: scale(1.1) translate(1%, 0.5%); }
}

/* Lớp phủ điện ảnh (Vignette) */
#cinematic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 40%, rgba(3, 5, 8, 0.5) 75%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
  z-index: 3;
}

/* ========================================================
   THANH ĐIỀU KHIỂN TRÊN CÙNG (TOP BAR)
   ======================================================== */
#top-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 50;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 82%;
}

.control-btn {
  background: rgba(12, 16, 24, 0.85);
  border: 1px solid rgba(245, 205, 121, 0.38);
  color: var(--text-dim);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 5px 9px;
  border-radius: 4px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.control-btn:hover {
  background: rgba(245, 205, 121, 0.25);
  border-color: var(--primary-gold);
  color: #fff;
  box-shadow: 0 0 12px rgba(245, 205, 121, 0.4);
}

.control-btn.btn-lang {
  border-color: rgba(245, 205, 121, 0.5);
  color: var(--primary-gold);
  font-weight: 700;
}

/* ========================================================
   THẺ GHI CHÚ BỐI CẢNH (SCENE CAPTION CARD - ĐÃ ẨN)
   ======================================================== */
#scene-caption-card {
  display: none !important;
  position: absolute;
  top: 46px;
  left: 10px;
  z-index: 35;
  max-width: calc(100% - 20px);
  background: linear-gradient(135deg, rgba(8, 12, 20, 0.94) 0%, rgba(16, 22, 34, 0.90) 100%);
  border-left: 4px solid var(--primary-gold);
  border-top: 1px solid rgba(245, 205, 121, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.75);
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.85), 0 0 20px rgba(245, 205, 121, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#scene-caption-card.active {
  opacity: 1;
  transform: translateY(0);
}

.caption-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff6b6b;
  text-transform: uppercase;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.caption-tag::before {
  content: '■';
  color: var(--primary-gold);
  font-size: 0.6rem;
}

.caption-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.caption-desc {
  font-family: 'Playfair Display', serif;
  font-size: 0.78rem;
  font-style: italic;
  color: #dcdde1;
  line-height: 1.35;
}

/* ========================================================
   MÀN HÌNH MỞ ĐẦU (START SCREEN) - TỐI ƯU 9:16
   ======================================================== */
#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 32%, rgba(20, 26, 40, 0.94) 0%, rgba(5, 7, 12, 0.99) 100%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 24px 16px 36px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-switch-box {
  display: inline-flex;
  align-items: center;
  background: rgba(12, 16, 24, 0.8);
  border: 1px solid rgba(245, 205, 121, 0.35);
  border-radius: 24px;
  padding: 3px;
  margin-bottom: 12px;
  gap: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.lang-toggle-btn {
  background: transparent;
  border: none;
  color: #a4b0be;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.lang-toggle-btn:hover {
  color: #fff;
}

.lang-toggle-btn.active {
  background: linear-gradient(135deg, #d49a24 0%, #f5cd79 100%);
  color: #0b0f19;
  box-shadow: 0 0 14px rgba(245, 205, 121, 0.5);
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge-dossier {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 2.5px;
  color: #ff6b6b;
  background: rgba(192, 57, 43, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.6);
  padding: 4px 12px;
  border-radius: 3px;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(231, 76, 60, 0.3);
}

.orientation-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 205, 121, 0.12);
  border: 1px dashed var(--primary-gold);
  color: var(--primary-gold);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.game-logo-main {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.75rem, 5.8vw, 2.35rem);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.2;
  background: linear-gradient(180deg, #ffffff 0%, #f5cd79 50%, #d49a24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,0.9)) drop-shadow(0 0 25px rgba(245, 205, 121, 0.35));
  margin-bottom: 8px;
  text-transform: uppercase;
}

.game-tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.92rem;
  color: #ced6e0;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  line-height: 1.45;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  padding: 0 6px;
}

.game-logo-part {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(245, 205, 121, 0.12);
  border: 1px solid var(--primary-gold);
  padding: 5px 16px;
  border-radius: 4px;
  letter-spacing: 2.5px;
  color: var(--primary-gold);
  margin-bottom: 14px;
  box-shadow: 0 0 16px rgba(245, 205, 121, 0.25);
}

.disclaimer-banner {
  width: 100%;
  max-width: 460px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.18) 0%, rgba(16, 22, 34, 0.92) 100%);
  border: 1px solid rgba(231, 76, 60, 0.55);
  border-left: 4px solid #e74c3c;
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 0 0 16px rgba(231, 76, 60, 0.2);
  backdrop-filter: blur(10px);
  text-align: left;
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.disclaimer-icon {
  font-size: 1rem;
}

.disclaimer-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ff6b6b;
  text-transform: uppercase;
}

.disclaimer-text {
  font-size: 0.82rem;
  color: #dfe4ea;
  line-height: 1.45;
}

.name-input-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  margin-bottom: 16px;
}

.name-input-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary-gold);
  text-transform: uppercase;
  text-align: left;
}

.name-input-box {
  background: rgba(12, 16, 24, 0.9);
  border: 1px solid rgba(245, 205, 121, 0.45);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 4px;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.name-input-box:focus {
  border-color: #fff;
  box-shadow: 0 0 15px rgba(245, 205, 121, 0.5), inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.btn-start {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 50%, #d49a24 100%);
  border: 1px solid var(--primary-gold);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 13px 26px;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(192, 57, 43, 0.65), 0 0 20px rgba(245, 205, 121, 0.35);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 300px;
}

.btn-start::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -60%; }
  30%, 100% { left: 140%; }
}

.btn-start:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 40px rgba(192, 57, 43, 0.8), 0 0 25px rgba(245, 205, 121, 0.5);
  border-color: #fff;
}

/* ========================================================
   HỘP THOẠI VISUAL NOVEL (DIALOGUE CONTAINER) - TỐI ƯU 9:16
   ======================================================== */
#dialogue-container {
  position: absolute;
  bottom: 14px;
  left: 3%;
  width: 94%;
  min-height: 125px;
  max-height: 42%;
  background: var(--box-bg);
  border: 1px solid var(--box-border);
  border-radius: 8px;
  padding: 14px 16px 30px 16px;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(245, 205, 121, 0.08);
  cursor: pointer;
  display: none;
  animation: fadeInUp 0.35s ease;
  overflow-y: auto;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.speaker-tag {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

/* Các nhãn nhân vật (Speaker Tags) */
.tag-nam { background: #1e3799; color: #fff; border-left: 4px solid #4a69bd; }
.tag-hoang { background: #b71540; color: #fff; border-left: 4px solid #e55039; }
.tag-sep { background: #2c3e50; color: #f1c40f; border-left: 4px solid #f39c12; }
.tag-sokha { background: #d35400; color: #fff; border-left: 4px solid #e67e22; }
.tag-lan { background: #16a085; color: #fff; border-left: 4px solid #2ecc71; }
.tag-axuong { background: #4b6584; color: #fc5c65; border-left: 4px solid #eb3b5a; }
.tag-gang { background: #5c0d12; color: #ff7675; border-left: 4px solid #d63031; }
.tag-narrator { background: rgba(245, 205, 121, 0.15); color: var(--primary-gold); border-left: 4px solid var(--primary-gold); font-style: italic; }

/* Bổ sung nhãn nhân vật Chương II: Việc Nặng Lương Thấp */
.tag-tam { background: #8e44ad; color: #fff; border-left: 4px solid #e056fd; }        /* Tâm: Tím quyến rũ */
.tag-chibinh { background: #2c3e50; color: #f5cd79; border-left: 4px solid #d49a24; } /* Chí Bình: Xanh đen quyền lực, chữ vàng */
.tag-tieukhoai { background: #d35400; color: #fff; border-left: 4px solid #f39c12; }  /* Tiểu Khoái: Cam lanh chanh */
.tag-daikhoai { background: #303952; color: #ff7675; border-left: 4px solid #c0392b; }/* Đại Khoái: Xám thép hằm hằm */
.tag-bome { background: #57606f; color: #dfe4ea; border-left: 4px solid #a4b0be; }    /* Bố Mẹ Hoàng: Xám bạc mê muội */
.tag-khach { background: #16a085; color: #fff; border-left: 4px solid #1abc9c; }      /* Phụ nữ trên xe: Xanh mơ mộng */

.dialogue-text {
  font-size: 1.02rem;
  line-height: 1.6;
  color: #f5f6fa;
  min-height: 48px;
  font-weight: 400;
  word-break: break-word;
}

.click-prompt {
  position: absolute;
  bottom: 8px;
  right: 14px;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(245, 205, 121, 0.75);
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  animation: pulsePrompt 1.8s infinite ease-in-out;
  user-select: none;
}

@keyframes pulsePrompt {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 0.95; transform: translateY(2px); }
}

/* ========================================================
   BẢNG LỰA CHỌN TƯƠNG TÁC (CHOICES MODAL) - TỐI ƯU 9:16
   ======================================================== */
#choices-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 12, 0.88);
  z-index: 60;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.choices-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-gold);
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  text-align: center;
  text-shadow: 0 0 16px rgba(245, 205, 121, 0.5);
  text-transform: uppercase;
  max-width: 90%;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 440px;
  max-height: 72vh;
  overflow-y: auto;
}

.choice-btn {
  background: rgba(16, 22, 34, 0.95);
  border: 1px solid rgba(245, 205, 121, 0.35);
  color: #f5f6fa;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
}

.choice-badge {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid var(--primary-gold);
  color: var(--primary-gold);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: rgba(245, 205, 121, 0.1);
}

.choice-btn:hover {
  background: linear-gradient(90deg, rgba(245, 205, 121, 0.3), rgba(192, 57, 43, 0.4));
  border-color: #fff;
  transform: translateX(6px);
  box-shadow: 0 10px 25px rgba(245, 205, 121, 0.35);
}

/* ========================================================
   MÀN HÌNH BAD ENDING / GAME OVER
   ======================================================== */
#bad-end-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(140, 20, 20, 0.92) 0%, rgba(10, 2, 4, 0.98) 100%);
  z-index: 80;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  overflow-y: auto;
  animation: fadeIn 0.6s ease;
}

.bad-end-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: #ff4757;
  letter-spacing: 2px;
  margin-bottom: 14px;
  text-shadow: 0 0 30px rgba(255, 71, 87, 0.9);
}

.bad-end-desc {
  font-size: 0.95rem;
  max-width: 440px;
  line-height: 1.6;
  color: #dfe4ea;
  margin-bottom: 24px;
}

.btn-retry {
  background: #c0392b;
  border: 1px solid #ff6b81;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 12px 30px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(192, 57, 43, 0.8);
  transition: all 0.3s ease;
}

.btn-retry:hover {
  background: #e74c3c;
  transform: scale(1.04);
  box-shadow: 0 14px 35px rgba(231, 76, 60, 0.9);
}

/* ========================================================
   MÀN HÌNH KẾT THÚC CHƯƠNG II (GRAND FINALE)
   ======================================================== */
#ending-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(16, 22, 38, 0.98) 0%, #05070a 100%);
  z-index: 90;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.6s ease;
}

.ending-badge {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff7675;
  background: rgba(192, 57, 43, 0.25);
  border: 1px solid rgba(231, 76, 60, 0.6);
  padding: 5px 16px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  box-shadow: 0 0 16px rgba(231, 76, 60, 0.35);
}

.ending-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  font-weight: 900;
  letter-spacing: 2px;
  color: #e74c3c;
  margin-bottom: 6px;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(231, 76, 60, 0.85);
}

.ending-story-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--primary-gold);
  margin-bottom: 16px;
  text-shadow: 0 0 16px rgba(245, 205, 121, 0.6);
}

.ending-callout {
  margin: 16px 0 28px;
  padding: 20px 24px;
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid rgba(245, 205, 121, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  max-width: 420px;
  width: 100%;
}

.ending-quote {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  color: var(--primary-gold);
  text-shadow: 0 0 20px rgba(245, 205, 121, 0.5);
  margin-bottom: 8px;
}

.ending-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 1px;
  line-height: 1.4;
}

.ending-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
  justify-content: center;
  align-items: center;
}

.btn-ending-log {
  background: rgba(14, 20, 32, 0.9);
  border: 1px solid var(--primary-gold);
  color: var(--primary-gold);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}

.btn-ending-log:hover {
  background: rgba(245, 205, 121, 0.25);
  color: #fff;
  border-color: #fff;
  transform: translateY(-2px);
}

/* ========================================================
   MÀN HÌNH NHẬT KÝ ĐỐI THOẠI (LOG MODAL)
   ======================================================== */
#log-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 460px;
  height: 80%;
  max-height: 640px;
  background: rgba(8, 12, 20, 0.96);
  border: 1px solid var(--box-border);
  border-radius: 8px;
  z-index: 80;
  display: none;
  flex-direction: column;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(245, 205, 121, 0.3);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  line-height: 1.55;
  font-size: 0.9rem;
}

.log-speaker {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--primary-gold);
  margin-right: 8px;
}

.log-text {
  color: var(--text-main);
}

/* ========================================================
   CÁC NÚT ĐIỀU KHIỂN VIDEO (SKIP & UNMUTE)
   ======================================================== */
.video-skip-btn {
  position: absolute;
  top: 54px;
  right: 12px;
  z-index: 55;
  background: rgba(14, 20, 32, 0.85);
  border: 1px solid rgba(245, 205, 121, 0.55);
  color: var(--primary-gold);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), 0 0 10px rgba(245, 205, 121, 0.2);
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.video-skip-btn:hover {
  background: rgba(245, 205, 121, 0.25);
  border-color: #fff;
  color: #fff;
  transform: scale(1.04);
}

#mobile-unmute-btn {
  position: absolute;
  top: 54px;
  left: 12px;
  z-index: 55;
  background: rgba(12, 16, 24, 0.85);
  border: 1px solid rgba(245, 205, 121, 0.55);
  color: var(--primary-gold);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), 0 0 10px rgba(245, 205, 121, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

#mobile-unmute-btn:hover {
  background: rgba(245, 205, 121, 0.25);
  color: #fff;
  transform: scale(1.04);
}

#mobile-play-prompt {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 62;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.play-pulse-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5cd79 0%, #d49a24 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 25px rgba(245, 205, 121, 0.7);
  animation: playPulse 1.8s infinite ease-in-out;
  margin-bottom: 12px;
}

@keyframes playPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 15px rgba(245, 205, 121, 0.5); }
  50% { transform: scale(1.08); box-shadow: 0 0 35px rgba(245, 205, 121, 0.9); }
  100% { transform: scale(0.95); box-shadow: 0 0 15px rgba(245, 205, 121, 0.5); }
}

.play-triangle {
  font-size: 24px;
  color: #0b0f19;
  margin-left: 3px;
}

.play-prompt-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--primary-gold);
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* ========================================================
   MÀN HÌNH CHỜ ĐIỆN ẢNH (CINEMATIC SCENE LOADER)
   ======================================================== */
#scene-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(12, 17, 27, 0.94) 0%, rgba(4, 6, 11, 0.98) 100%);
  z-index: 75;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#scene-loader.active {
  opacity: 1;
  pointer-events: auto;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
  width: 100%;
  max-width: 320px;
}

.loader-radar-box {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2px;
}

.loader-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--primary-gold);
  border-right-color: rgba(245, 205, 121, 0.35);
  animation: loaderSpin 1.1s linear infinite;
}

.loader-ring-inner {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: #e74c3c;
  border-left-color: rgba(231, 76, 60, 0.45);
  animation: loaderSpinReverse 0.85s linear infinite;
}

.loader-center-dot {
  width: 10px;
  height: 10px;
  background: var(--primary-gold);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--primary-gold), 0 0 25px rgba(245, 205, 121, 0.8);
  animation: pulseGlow 1.5s infinite ease-in-out;
}

@keyframes loaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loaderSpinReverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50% { transform: scale(1.25); opacity: 1; }
}

.loader-badge {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff7675;
  background: rgba(192, 57, 43, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.45);
  padding: 3px 12px;
  border-radius: 3px;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.25);
}

.loader-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary-gold);
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(245, 205, 121, 0.5);
}

.loader-status-sub {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.loader-track {
  width: 220px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  margin-top: 4px;
}

.loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, transparent, var(--primary-gold), #fff, var(--primary-gold), transparent);
  box-shadow: 0 0 12px var(--primary-gold);
  animation: loaderTrackAnim 1.4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loaderTrackAnim {
  0% { transform: translateX(-150%); }
  100% { transform: translateX(350%); }
}

/* ========================================================
   RESPONSIVE CHO ĐIỆN THOẠI DI ĐỘNG (MOBILE FULL-BLEED)
   ======================================================== */
@media (max-width: 600px) and (orientation: portrait) {
  body {
    align-items: stretch;
  }

  #game-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    aspect-ratio: auto;
  }
}

/* Khi người dùng lỡ xoay ngang trên điện thoại */
@media (orientation: landscape) and (max-height: 550px) {
  body {
    align-items: center;
    justify-content: center;
  }

  #game-container {
    height: 100dvh;
    max-width: calc(100dvh * 9 / 16);
    aspect-ratio: 9 / 16;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.95);
  }

  .orientation-tip {
    display: inline-flex !important;
  }
}

/* Bổ sung nhãn nhân vật Chương II: Việc Nặng Lương Thấp (Cuối file style.css) */
.tag-tam { background: #8e44ad; color: #fff; border-left: 4px solid #e056fd; }        /* Tâm: Tím quyến rũ */
.tag-chibinh { background: #2c3e50; color: #f5cd79; border-left: 4px solid #d49a24; } /* Chí Bình: Xanh đen quyền lực, chữ vàng */
.tag-tieukhoai { background: #d35400; color: #fff; border-left: 4px solid #f39c12; }  /* Tiểu Khoái: Cam lanh chanh */
.tag-daikhoai { background: #303952; color: #ff7675; border-left: 4px solid #c0392b; }/* Đại Khoái: Xám thép hằm hằm */
.tag-bome { background: #57606f; color: #dfe4ea; border-left: 4px solid #a4b0be; }    /* Bố Mẹ Hoàng: Xám bạc mê muội */
.tag-khach { background: #16a085; color: #fff; border-left: 4px solid #1abc9c; }      /* Phụ nữ trên xe: Xanh mơ mộng */
