/* ==========================================================================
   Universal Psychological Quiz Engine - Core Stylesheet
   Zero external dependencies | Mobile-first (max-width 480px on desktop)
   4 Built-in Commercial Themes: magazine | ink | cinema | healing
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

/* --------------------------------------------------------------------------
   Theme Tokens
   -------------------------------------------------------------------------- */
:root,
body[data-theme="magazine"] {
  --bg-outer: #e7e1d3;
  --bg-page: #f6f3ec;
  --bg-card: #ffffff;
  --bg-subtle: #efeae0;
  --text-primary: #141414;
  --text-secondary: #56524b;
  --text-muted: #8a847a;
  --accent: #ff4d1c;
  --accent-contrast: #ffffff;
  --accent-2: #0047ff;
  --accent-soft: rgba(255, 77, 28, 0.1);
  --accent-2-soft: rgba(0, 71, 255, 0.09);
  --border-color: #141414;
  --border-width: 2px;
  --border-soft: rgba(20, 20, 20, 0.14);
  --radius-lg: 4px;
  --radius-md: 4px;
  --radius-pill: 2px;
  --shadow-card: 4px 4px 0px #141414;
  --shadow-btn: 3px 3px 0px #141414;
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --title-weight: 900;
  --outer-pattern: radial-gradient(rgba(20, 20, 20, 0.12) 1px, transparent 1px);
  --outer-pattern-size: 18px 18px;
}

body[data-theme="ink"] {
  --bg-outer: #e5dfd2;
  --bg-page: #f7f5f0;
  --bg-card: #fcfbf8;
  --bg-subtle: #efece3;
  --text-primary: #22252a;
  --text-secondary: #5b6068;
  --text-muted: #8b8f96;
  --accent: #b83b2a;
  --accent-contrast: #fcfbf8;
  --accent-2: #3d5454;
  --accent-soft: rgba(184, 59, 42, 0.09);
  --accent-2-soft: rgba(61, 84, 84, 0.1);
  --border-color: rgba(34, 37, 42, 0.28);
  --border-width: 1px;
  --border-soft: rgba(34, 37, 42, 0.12);
  --radius-lg: 6px;
  --radius-md: 4px;
  --radius-pill: 2px;
  --shadow-card: 0 6px 24px rgba(34, 37, 42, 0.06);
  --shadow-btn: 0 4px 12px rgba(184, 59, 42, 0.22);
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif CN", "SimSun", Georgia, serif;
  --font-body: "Songti SC", "STSong", "PingFang SC", "Microsoft YaHei", serif;
  --title-weight: 700;
  --outer-pattern: linear-gradient(90deg, rgba(34, 37, 42, 0.03) 1px, transparent 1px);
  --outer-pattern-size: 36px 36px;
}

body[data-theme="cinema"] {
  --bg-outer: #050608;
  --bg-page: #0c0d12;
  --bg-card: #151720;
  --bg-subtle: #1d202b;
  --text-primary: #f4e7cf;
  --text-secondary: #b4a790;
  --text-muted: #7a7060;
  --accent: #d4af6a;
  --accent-contrast: #0c0d12;
  --accent-2: #9b7840;
  --accent-soft: rgba(212, 175, 106, 0.14);
  --accent-2-soft: rgba(212, 175, 106, 0.08);
  --border-color: rgba(212, 175, 106, 0.42);
  --border-width: 1px;
  --border-soft: rgba(212, 175, 106, 0.18);
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-pill: 2px;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-btn: 0 6px 20px rgba(212, 175, 106, 0.25);
  --font-display: "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  --title-weight: 700;
  --outer-pattern: radial-gradient(circle at 50% 0%, rgba(212, 175, 106, 0.12), transparent 55%);
  --outer-pattern-size: 100% 100%;
}

body[data-theme="healing"] {
  --bg-outer: #ede5db;
  --bg-page: #faf6f0;
  --bg-card: #ffffff;
  --bg-subtle: #f3ece3;
  --text-primary: #433c36;
  --text-secondary: #7b7269;
  --text-muted: #a89f96;
  --accent: #7f9c8e;
  --accent-contrast: #ffffff;
  --accent-2: #e2a27c;
  --accent-soft: rgba(127, 156, 142, 0.14);
  --accent-2-soft: rgba(226, 162, 124, 0.16);
  --border-color: rgba(127, 156, 142, 0.35);
  --border-width: 1px;
  --border-soft: rgba(67, 60, 54, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 28px rgba(102, 86, 70, 0.08);
  --shadow-btn: 0 8px 18px rgba(127, 156, 142, 0.28);
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Rounded Mplus 1c", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  --title-weight: 700;
  --outer-pattern: radial-gradient(rgba(127, 156, 142, 0.14) 1.5px, transparent 1.5px);
  --outer-pattern-size: 24px 24px;
}

/* --------------------------------------------------------------------------
   Shell & Desktop Mobile-Frame Layout
   -------------------------------------------------------------------------- */
body {
  background-color: var(--bg-outer);
  background-image: var(--outer-pattern);
  background-size: var(--outer-pattern-size);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.quiz-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-page);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 520px) {
  body {
    padding: 24px 16px;
    align-items: center;
  }
  .quiz-shell {
    min-height: 820px;
    border-radius: calc(var(--radius-lg) + 8px);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
  }
  body[data-theme="cinema"] .quiz-shell {
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
  }
}

/* Theme decorative top strip */
.theme-ribbon {
  height: 5px;
  width: 100%;
  background: var(--accent);
  flex-shrink: 0;
}

body[data-theme="magazine"] .theme-ribbon {
  height: 7px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 68%, var(--accent-2) 68%, var(--accent-2) 100%);
}

body[data-theme="cinema"] .theme-ribbon {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

body[data-theme="healing"] .theme-ribbon {
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* --------------------------------------------------------------------------
   Views & Transitions
   -------------------------------------------------------------------------- */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 22px 20px 32px;
  animation: viewFadeIn 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.view.is-active {
  display: flex;
}

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

/* --------------------------------------------------------------------------
   Top Brand Header
   -------------------------------------------------------------------------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.brand-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.issue-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-soft);
  letter-spacing: 0.05em;
}

body[data-theme="magazine"] .issue-pill {
  background: var(--accent-2);
  color: #ffffff;
  border: 1.5px solid #141414;
}

body[data-theme="ink"] .issue-pill {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Cover View
   -------------------------------------------------------------------------- */
.cover-hero {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px 20px 22px;
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
}

body[data-theme="ink"] .cover-hero::after {
  content: "秘卷";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  opacity: 0.85;
}

.cover-emblem-wrap {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: var(--border-width) solid var(--border-soft);
}

body[data-theme="magazine"] .cover-emblem-wrap {
  border-color: var(--border-color);
  background: var(--accent-soft);
}

.cover-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.32;
  font-weight: var(--title-weight);
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.01em;
}

.cover-subtitle {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

.cover-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 14px 0;
}

body[data-theme="magazine"] .cover-divider {
  height: 2px;
  background: var(--border-color);
}

.cover-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  text-align: justify;
}

.cover-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 11px 8px;
  text-align: center;
}

body[data-theme="magazine"] .stat-box {
  border-color: var(--border-color);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.live-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

.live-counter strong {
  color: var(--text-primary);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.unlock-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 12px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border-radius: var(--radius-pill);
}

.unlock-status-badge.is-hidden {
  display: none;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 15px 20px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease, background-color 0.14s ease;
  user-select: none;
}

.btn:active {
  transform: translateY(2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-btn);
}

body[data-theme="magazine"] .btn-primary:active {
  box-shadow: 1px 1px 0px #141414;
  transform: translate(2px, 2px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: var(--border-width) solid var(--border-color);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
}

.btn-ghost:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cover-footnote {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Quiz View
   -------------------------------------------------------------------------- */
.quiz-header {
  margin-bottom: 18px;
}

.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-count {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.progress-count span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.progress-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

body[data-theme="magazine"] .progress-track {
  border: 1.5px solid #141414;
  height: 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-theme="magazine"] .progress-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.question-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.question-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 18px;
  margin-bottom: 18px;
}

.question-card.anim-next {
  animation: slideInRight 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-card.anim-prev {
  animation: slideInLeft 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-text {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.55;
  font-weight: 700;
  color: var(--text-primary);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.option-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--bg-page);
  color: var(--text-primary);
  border: var(--border-width) solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}

.option-btn:active {
  transform: scale(0.99);
}

.option-key {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border: 1px solid var(--border-soft);
}

.option-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body[data-theme="magazine"] .option-btn.is-selected {
  border-color: #141414;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 3px 3px 0px #141414;
}

body[data-theme="magazine"] .option-btn.is-selected .option-key {
  background: #141414;
  color: #ffffff;
  border-color: #141414;
}

body[data-theme="cinema"] .option-btn.is-selected .option-key,
body[data-theme="ink"] .option-btn.is-selected .option-key,
body[data-theme="healing"] .option-btn.is-selected .option-key {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.quiz-nav {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-nav .btn-ghost {
  width: auto;
  min-width: 112px;
}

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

/* --------------------------------------------------------------------------
   Calculating Transition View
   -------------------------------------------------------------------------- */
.calc-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.calc-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--border-soft);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
  margin-bottom: 22px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.calc-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}

.calc-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Result View
   -------------------------------------------------------------------------- */
.result-hero {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 20px 22px;
  text-align: center;
  margin-bottom: 18px;
  position: relative;
}

.result-code {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 14px;
}

.result-badge-wrap {
  width: 108px;
  height: 108px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: var(--border-width) solid var(--border-soft);
}

body[data-theme="magazine"] .result-badge-wrap {
  border-color: var(--border-color);
  background: var(--accent-soft);
}

.result-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--title-weight);
  color: var(--text-primary);
  line-height: 1.25;
}

.result-en {
  margin: 0 0 16px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 700;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.result-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-soft);
}

body[data-theme="magazine"] .result-tag {
  border: 1.5px solid #141414;
  color: #141414;
  background: #fff4ef;
}

.result-quote {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
}

.tracks-bar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-soft);
  text-align: left;
}

.tracks-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tracks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.track-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-2-soft);
  color: var(--accent-2);
}

.report-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.report-card {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
}

body[data-theme="magazine"] .report-card {
  border-color: var(--border-color);
  box-shadow: 3px 3px 0px #141414;
}

.report-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.report-num {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast);
  letter-spacing: 0.05em;
}

.report-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.report-card-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: justify;
  white-space: pre-line;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Modals (Passcode & Poster)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: modalFade 0.2s ease;
}

.modal-backdrop.is-open {
  display: flex;
}

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

.modal-panel {
  width: 100%;
  max-width: 390px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  padding: 24px 20px 20px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.passcode-input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-primary);
  background: var(--bg-page);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  margin-bottom: 10px;
}

.passcode-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.passcode-error {
  min-height: 20px;
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #d93829;
  text-align: center;
}

.is-shaking {
  animation: shake 0.32s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* Poster Modal */
.poster-panel {
  max-width: 400px;
  padding: 18px 16px 16px;
  text-align: center;
}

.poster-img-wrap {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  margin: 10px 0 12px;
}

.poster-img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-touch-callout: default;
  user-select: auto;
}

.poster-tip {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.5;
}
