/* ==========================================================================
   TÀI LIỆU UI GAME PORTRAIT — GIAO DIỆN DỄ ĐỌC, TẬP TRUNG SỰ CHÚ Ý
   ========================================================================== */

:root {
  --bg-page: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-subtle: #eef2f9;
  --bg-sidebar: #0f172a;
  --text-sidebar: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
}

[data-theme="dark"] {
  --bg-page: #0b1120;
  --bg-surface: #151f32;
  --bg-subtle: #1e293b;
  --bg-sidebar: #070b14;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #283548;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.2);
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.35);
  --warn-text: #fde68a;
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ==================== BỐ CỤC CHÍNH ==================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 290px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 40;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.brand-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.brand-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.search-box {
  position: relative;
  margin: 16px 0;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.7;
}

.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 10px 12px 10px 36px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.search-box input::placeholder {
  color: #94a3b8;
}

.search-box input:focus {
  border-color: #60a5fa;
  background: rgba(255, 255, 255, 0.11);
}

.nav-section {
  margin-bottom: 18px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
  padding: 6px 10px;
}

.nav-screens-container {
  flex: 1;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: none;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 3px;
}

.special-nav {
  justify-content: flex-start;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.nav-item.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.nav-count {
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==================== TOPBAR ==================== */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 62px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.breadcrumb {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-banner {
  background: linear-gradient(90deg, #1d4ed8, #7c3aed);
  color: #ffffff;
  padding: 11px 28px;
  font-size: 13.5px;
}

.editor-banner code {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ==================== NÚT BẤM CHUNG ==================== */
.btn {
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-ghost.active-edit {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.13);
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-full {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 16px;
}

.mobile-menu-btn {
  display: none;
}

/* ==================== PHẦN TỔNG QUAN MÀN HÌNH (HERO) ==================== */
.content-view {
  padding: 26px 32px 60px;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

.screen-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.screen-badge {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 99px;
}

.screen-hero h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.screen-summary {
  color: var(--text-secondary);
  font-size: 15.5px;
  max-width: 960px;
  margin-bottom: 18px;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.highlight-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 14px;
}

.highlight-box strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

/* Khung Checklist các thành phần bắt buộc của màn hình / popup */
.checklist-banner {
  margin-top: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.checklist-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 10px;
}

.checklist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checklist-chip {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 13px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.checklist-chip:hover,
.checklist-chip.is-focused {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.checklist-chip.is-missing {
  border-style: dashed;
  color: var(--text-secondary);
  cursor: default;
}

.checklist-chip.is-missing:hover {
  border-color: var(--border-color);
  background: var(--bg-surface);
  transform: none;
}

.checklist-chip.is-missing .checklist-check {
  background: #94a3b8;
}

.checklist-chip.is-absent,
.checklist-chip.is-absent:hover {
  border-color: #f59e0b;
}

.checklist-chip.is-absent .checklist-check {
  background: #f59e0b;
}

.checklist-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ==================== BỐ CỤC SPLIT-VIEW CHO MÀN HÌNH DỌC ==================== */
.split-workspace {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* Cột ảnh cao bằng cột chú thích để ảnh dính khi cuộn */
.phone-column {
  align-self: stretch;
}

.phone-sticky-wrap {
  position: sticky;
  top: 84px;
  /* Khung điện thoại vừa chiều cao màn hình: 300px là thanh trên, tab, nút và chú thích */
  max-width: max(190px, calc((100vh - 300px) / 2.1667 + 22px));
  margin: 0 auto;
}

/* Tabs chuyển trạng thái của cùng 1 Screen */
.state-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.state-tab {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.state-tab.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.phone-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 99px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.play-mode-btn {
  background: #ecfdf5;
  color: #15803d;
  border-color: #86efac;
}

[data-theme="dark"] .play-mode-btn {
  background: rgba(22, 163, 74, 0.16);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}

.play-mode-btn.is-playing {
  background: linear-gradient(135deg, #16a34a, #059669);
  color: #ffffff !important;
  border-color: #16a34a;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

/* Khung Điện Thoại Portrait — viền nằm ngoài ảnh, không che thanh tài nguyên phía trên */
.phone-frame {
  background: #0f172a;
  padding: 18px 11px 14px;
  border-radius: 36px;
  box-shadow: var(--shadow-md), 0 0 0 2px rgba(148, 163, 184, 0.25);
  position: relative;
}

.phone-notch {
  width: 64px;
  height: 5px;
  background: #334155;
  border-radius: 99px;
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
}

.screenshot-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #1e293b;
  user-select: none;
}

.screenshot-stage.edit-cursor {
  cursor: crosshair;
}

.screenshot-stage img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==================== LỚP HOTSPOTS & HIỆU ỨNG SPOTLIGHT ==================== */
.hotspot-layer {
  position: absolute;
  inset: 0;
}

.hotspot-box {
  position: absolute;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 1.5px var(--pin-color, #22c55e);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  z-index: 5;
}

/* Khi đang tập trung vào 1 phần tử: làm tối toàn bộ phần còn lại của bức ảnh! */
.hotspot-layer.has-focus .hotspot-box:not(.is-focused) {
  opacity: 0.18;
}

.hotspot-box.is-focused {
  z-index: 12;
  border-style: solid;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 6px var(--pin-color, #2563eb),
    0 0 0 9999px rgba(8, 13, 26, 0.66);
}

.pin-badge {
  position: absolute;
  top: -11px;
  left: -11px;
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--pin-color, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 12.5px;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease;
}

/* Tự động đẩy số vào trong nếu vùng chọn nằm sát mép màn hình để không bị cắt mất */
.pin-badge.edge-left {
  left: 2px;
}

.pin-badge.edge-right {
  left: auto;
  right: 2px;
}

.pin-badge.edge-top {
  top: 2px;
}

/* Huy hiệu nhỏ báo nút này có liên kết bay sang màn hình khác */
.jump-indicator {
  position: absolute;
  bottom: -10px;
  right: -8px;
  background: #0f172a;
  color: #fde047;
  border: 1.5px solid #fde047;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
}

.hotspot-box.edge-box-right .jump-indicator {
  right: 2px;
}

/* Nút nổi xuất hiện ngay trên ảnh khi chọn 1 vùng có liên kết ở chế độ đọc Doc */
.floating-jump-btn {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: linear-gradient(135deg, #16a34a, #059669);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 99px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  z-index: 30;
  display: none;
  animation: popFloat 0.2s ease-out;
}

.floating-jump-btn.pos-below {
  bottom: auto;
  top: calc(100% + 8px);
}

.hotspot-box.is-focused .floating-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Chế độ Bấm Thử Như Game (Play Prototype Mode) */
.hotspot-layer.play-prototype-mode .hotspot-box:not(.has-link) {
  opacity: 0;
  pointer-events: none;
}

.hotspot-layer.play-prototype-mode .hotspot-box.has-link {
  border: 2.5px solid #4ade80;
  background: rgba(74, 222, 128, 0.14);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35), inset 0 0 12px rgba(74, 222, 128, 0.25);
  animation: pulseClickable 1.6s infinite ease-in-out;
}

.hotspot-layer.play-prototype-mode .hotspot-box.has-link:hover {
  background: rgba(74, 222, 128, 0.28);
  transform: scale(1.02);
}

.hotspot-layer.play-prototype-mode .pin-badge {
  display: none;
}

/* Nút bay tới màn hình đích bên trong thẻ mô tả */
.card-jump-btn {
  margin-top: 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.card-jump-btn:hover {
  transform: translateX(3px);
  filter: brightness(1.08);
}

/* Hiệu ứng chuyển cảnh (Fly / Popup / Back) ngay trong khung điện thoại */
@keyframes animZoomFly {
  0% {
    opacity: 0.25;
    transform: scale(0.84) translateY(16px);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes animPopupIn {
  0% {
    opacity: 0.3;
    transform: scale(0.76);
  }
  70% {
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes animSlideBack {
  0% {
    opacity: 0.3;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseClickable {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(74, 222, 128, 0.12);
  }
}

@keyframes popFloat {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.screenshot-stage.trans-zoom {
  animation: animZoomFly 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.screenshot-stage.trans-popup {
  animation: animPopupIn 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.screenshot-stage.trans-back {
  animation: animSlideBack 0.28s ease-out;
}

.hotspot-box:hover .pin-badge,
.hotspot-box.is-focused .pin-badge {
  transform: scale(1.18);
}

.draw-rect {
  position: absolute;
  border: 2.5px dashed #fde047;
  background: rgba(250, 204, 21, 0.22);
  border-radius: 10px;
  pointer-events: none;
  z-index: 20;
}

.image-caption {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 0 8px;
}

/* ==================== CỘT PHẢI: THẺ GIẢI THÍCH ==================== */
.role-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 6px 13px;
  border-radius: 99px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
}

.filter-pill.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.reading-hint {
  background: var(--accent-soft);
  color: var(--text-primary);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  margin-bottom: 16px;
}

.cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hotspot-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-left: 6px solid var(--card-color, #2563eb);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.hotspot-card:hover,
.hotspot-card.is-focused {
  transform: translateY(-2px);
  border-color: var(--card-color, #2563eb);
  box-shadow: var(--shadow-md);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-color, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.card-title {
  font-size: 17.5px;
  font-weight: 700;
}

.role-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
}

.card-section {
  margin-bottom: 10px;
}

.card-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.card-section p {
  color: var(--text-primary);
  font-size: 15px;
  white-space: pre-line;
}

.newbie-tip {
  margin-top: 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
}

/* ==================== TRANG SƠ ĐỒ LUỒNG & TỪ ĐIỂN ==================== */
.page-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
}

.page-header-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.page-header-card p {
  color: var(--text-secondary);
}

.event-overview {
  margin-bottom: 18px;
  padding: 18px 20px;
  scroll-margin-top: 72px;
}

.event-overview h1 {
  margin-bottom: 3px;
}

.event-route {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.event-route.event-route-grouped {
  display: grid;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.event-route-grouped .event-route {
  margin-top: 0;
}

.event-route-label {
  margin: 0 0 5px;
  color: var(--text-secondary);
  font-size: 13px;
}

.event-step {
  flex: 1 1 0;
  min-width: 0;
  min-height: 68px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.event-step strong,
.event-step span {
  display: block;
}

.event-step strong {
  font-size: 16px;
  line-height: 1.3;
}

.event-step span {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.event-step:hover {
  border-color: var(--accent);
}

.event-step.active {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.event-step.active span {
  color: #e0edff;
}

.event-step:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.event-arrow {
  flex: 0 0 auto;
  align-self: center;
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.event-related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.event-rules {
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
}

.event-rules summary {
  padding: 10px 0 2px;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.event-rules dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr));
  gap: 8px;
  margin-top: 8px;
}

.event-rules dl > div {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-subtle);
}

.event-rules dt {
  font-weight: 700;
}

.event-rules dd {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 13px;
}

.rule-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin-top: 8px;
  list-style: none;
}

.rule-images li {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.rule-images img {
  width: 38px;
  height: 48px;
  object-fit: contain;
}

.event-layout {
  grid-template-columns: minmax(230px, 310px) minmax(0, 1fr);
  grid-template-areas:
    "phone intro"
    "phone notes";
  grid-template-rows: auto 1fr;
  gap: 0 24px;
}

.event-layout .screen-hero {
  grid-area: intro;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.event-layout .screen-hero h2 {
  margin-bottom: 2px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.event-layout .phone-column {
  grid-area: phone;
  align-self: stretch;
}

.event-layout .notes-column {
  grid-area: notes;
}

.event-screen-details {
  margin-top: 8px;
  font-size: 13px;
}

.event-screen-details summary {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.event-screen-details p {
  margin-top: 6px;
  color: var(--text-secondary);
}

.flow-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flow-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.flow-screen-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s, transform 0.15s;
}

.flow-screen-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.flow-screen-btn small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.flow-screen-btn strong {
  font-size: 15.5px;
}

.flow-arrow {
  text-align: center;
  padding: 6px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
}

/* ==================== XEM TOÀN BỘ MÀN HÌNH ==================== */
.gallery-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.gallery-jump-count {
  color: var(--text-muted);
  font-weight: 600;
}

.gallery-section {
  margin-bottom: 28px;
  scroll-margin-top: 80px;
}

.gallery-section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 12px;
}

.gallery-section-head h2 {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.gallery-section-group,
.gallery-section-count {
  font-size: 13px;
  color: var(--text-muted);
}

.gallery-section-count {
  margin-left: auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.gallery-thumb {
  aspect-ratio: 9 / 19.5;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 2px 2px;
  min-width: 0;
}

.gallery-card-body strong {
  font-size: 13.5px;
  line-height: 1.3;
}

.gallery-card-body small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.gallery-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.gallery-absent {
  color: #d97706;
  font-weight: 700;
}

.gallery-empty {
  color: var(--text-muted);
}

@media (max-width: 460px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.glossary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.glossary-card h3 {
  font-size: 16.5px;
  color: var(--accent);
  margin-bottom: 8px;
}

.glossary-card p {
  color: var(--text-secondary);
  font-size: 14.5px;
}

/* ==================== MODAL & LIGHTBOX ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 26, 0.72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  background: var(--bg-surface);
  color: var(--text-primary);
  width: 100%;
  max-width: 600px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 80vh;
  overflow-y: auto;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.spacer {
  flex: 1;
}

.lightbox-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  max-width: 92vw;
}

.lightbox-caption {
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}

/* Chừa chỗ cho hàng nút dưới ảnh */
#lightboxModal.with-footer #lightboxImg {
  max-height: calc(90vh - 70px);
}

#lightboxImg {
  max-height: 90vh;
  max-width: 92vw;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: #ffffff;
  color: #0f172a;
  border: none;
  padding: 9px 16px;
  border-radius: 99px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .split-workspace {
    grid-template-columns: 1fr;
  }

  .event-layout {
    grid-template-areas: "intro" "phone" "notes";
    grid-template-rows: none;
    row-gap: 12px;
  }

  .event-layout .screen-hero {
    margin-bottom: 0;
  }

  .event-layout .phone-sticky-wrap {
    max-width: 310px;
  }

  .phone-sticky-wrap {
    position: static;
    max-width: 380px;
    margin: 0 auto;
  }

  .flow-row {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: -300px;
    transition: left 0.22s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
  }

  .content-view {
    padding: 18px 16px 48px;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .event-overview {
    padding: 14px;
  }

  .event-route {
    gap: 4px;
    padding: 5px;
  }

  .event-step {
    padding-inline: 6px;
  }

  .event-step strong {
    font-size: 13px;
  }

  .event-step span {
    font-size: 11px;
  }

  .event-arrow {
    font-size: 16px;
  }
}
