/* HKDance 20th Anniversary — Video Landing (demo)
   Brand tokens carried over from the NFC keychain demo-site:
   --bg #0a0a0a · --gold #c9a05c · --gold-light #d4b67a
   Type: Noto Serif TC (editorial, performance-led) */

:root {
  --bg: #0a0a0a;
  --ink: #1a1a1a;
  --paper: #fafaf6;
  --gold: #c9a05c;
  --gold-light: #d4b67a;
  --text-light: rgba(255, 255, 255, 0.85);
  --text-muted: rgba(255, 255, 255, 0.62);
  --border: rgba(201, 160, 92, 0.28);
  --radius: 18px;
  --shell: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-light);
  font-family: "Noto Serif TC", "PingFang HK", "Microsoft JhengHei", serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.7;
  background-image:
    radial-gradient(circle at 85% 8%, rgba(201, 160, 92, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(212, 182, 122, 0.10) 0%, transparent 50%);
  background-attachment: fixed;
}

.poster-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(201, 160, 92, 0.10) 0%, transparent 55%);
}

.page-login .poster-bg::after,
.page-landing .poster-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}

img { max-width: 100%; display: block; }

/* ---------------- LOGIN ---------------- */

.login-stage {
  position: relative;
  z-index: 1;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 40px 20px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  min-height: 100vh;
  justify-content: center;
}

.brand { text-align: center; }
.brand img {
  width: 180px;
  height: auto;
  opacity: 0.96;
}

.title-block { text-align: center; }

.kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.title-main {
  margin: 0;
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
  letter-spacing: 0.02em;
}

.title-sub {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}

.title-rule {
  width: 56px;
  height: 2px;
  margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  backdrop-filter: blur(6px);
}

.login-card h2 {
  margin: 0 0 18px;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.3); }

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 160, 92, 0.2);
}

#codeInput {
  letter-spacing: 0.42em;
  font-size: 20px;
  text-align: center;
}

.btn-enter {
  width: 100%;
  padding: 15px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 6px 20px rgba(201, 160, 92, 0.26);
}

.btn-enter:hover:not(:disabled) { transform: translateY(-2px); }
.btn-enter:disabled { opacity: 0.6; cursor: progress; }

.error-msg {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 13px;
  color: #ffd9d2;
  background: rgba(196, 60, 40, 0.18);
  border: 1px solid rgba(255, 120, 90, 0.34);
  border-radius: 8px;
  text-align: center;
}

.error-msg.show { display: block; }

.login-hint {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-muted);
  text-align: center;
}

.login-hint strong { color: var(--gold-light); letter-spacing: 0.16em; }

.mini-guide {
  width: 100%;
  max-width: 420px;
  padding: 18px 20px;
  background: rgba(201, 160, 92, 0.07);
  border: 1px solid rgba(201, 160, 92, 0.2);
  border-radius: 14px;
}

.mini-guide h3 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  text-transform: uppercase;
}

.mini-guide ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.85;
}

.mini-guide-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.page-foot {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 1.8;
}

/* ---------------- LANDING ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(10, 10, 10, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 160, 92, 0.18);
}

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

.topbar-left img {
  width: 132px;
  height: auto;
  opacity: 0.9;
}

.topbar-tag {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  cursor: pointer;
}

.btn-logout:hover { background: rgba(201, 160, 92, 0.12); }

.landing-stage {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 34px 18px 60px;
}

.greeting { text-align: center; margin-bottom: 30px; }

.greeting h1 {
  margin: 0;
  font-size: clamp(24px, 6.2vw, 38px);
  font-weight: 900;
  color: #fff;
  line-height: 1.28;
}

.greeting .lede {
  margin: 12px auto 0;
  max-width: 620px;
  font-size: 14px;
  color: var(--text-muted);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 18px;
}

.video-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.video-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.video-card:hover,
.video-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(201, 160, 92, 0.55);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  outline: none;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}

.video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  font-size: 20px;
  color: #1a1a1a;
  background: rgba(212, 182, 122, 0.94);
  border-radius: 50%;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

.video-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 11px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  background: rgba(10, 10, 10, 0.76);
  border: 1px solid rgba(201, 160, 92, 0.42);
  border-radius: 999px;
}

.video-meta { padding: 15px 16px 17px; }
.video-meta h3 { margin: 0 0 6px; font-size: 16px; color: #fff; }
.video-meta p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ---------------- GUIDE ---------------- */

.guide {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid rgba(201, 160, 92, 0.2);
}

.guide > h2 {
  margin: 0 0 22px;
  font-size: 22px;
  color: #fff;
  text-align: center;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 14px;
}

.guide-step {
  position: relative;
  padding: 20px 18px 18px;
  background: rgba(255, 255, 255, 0.038);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
}

.guide-num {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
}

/* class selector */
.select-wrap { position: relative; }
.select-wrap select {
  width: 100%;
  min-height: 48px;
  padding: 12px 40px 12px 15px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-wrap select:focus {
  outline: none;
  border-color: rgba(201, 160, 92, 0.75);
  box-shadow: 0 0 0 3px rgba(201, 160, 92, 0.16);
}
.select-wrap select option { background: #141414; color: #f4efe6; }
.select-caret {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gold-light);
  font-size: 13px;
  line-height: 1;
}

.guide-step h3 { margin: 0 0 8px; font-size: 15px; color: #fff; }
.guide-step p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.72; }

.guide-qr {
  width: 132px;
  height: 132px;
  margin: 14px auto 6px;
  border-radius: 10px;
  border: 1px solid rgba(201, 160, 92, 0.35);
}

.guide-qr-cap {
  margin-top: 0 !important;
  font-size: 11px !important;
  letter-spacing: 0.1em;
  color: var(--gold-light) !important;
  text-align: center;
}

.guide-faq {
  margin-top: 22px;
  padding: 22px 20px;
  background: rgba(201, 160, 92, 0.06);
  border: 1px solid rgba(201, 160, 92, 0.18);
  border-radius: 14px;
}

.guide-faq h3 {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--gold-light);
  letter-spacing: 0.08em;
}

.guide-faq dt {
  margin-top: 12px;
  font-size: 14px;
  color: #fff;
  font-weight: 700;
}

.guide-faq dt:first-of-type { margin-top: 0; }

.guide-faq dd {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.75;
}

.guide-note {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.8;
}

.guide-note p { margin: 0; }
.guide-note-sub { color: rgba(255, 255, 255, 0.68); margin-top: 4px !important; }

/* ---------------- PLAYER OVERLAY ---------------- */

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
}

.player-overlay[hidden] { display: none; }
.player-overlay.show { display: flex; }

.player-shell {
  width: 100%;
  max-width: 960px;
  background: #000;
  border: 1px solid rgba(201, 160, 92, 0.28);
  border-radius: 14px;
  overflow: hidden;
}

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.05);
}

.player-title { font-size: 14px; color: #fff; }

.player-close {
  width: 40px;
  height: 40px;
  font-size: 17px;
  color: var(--gold-light);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 auto;
}

.player-frame { aspect-ratio: 16 / 9; background: #000; }
.player-frame iframe,
.player-frame video { width: 100%; height: 100%; border: 0; display: block; }

.player-caption {
  padding: 11px 14px 14px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* ---------------- MOBILE ---------------- */

@media (max-width: 640px) {
  .login-stage { padding: 30px 16px 44px; gap: 20px; }
  .brand img { width: 148px; }
  .landing-stage { padding: 26px 14px 46px; }
  .video-grid { grid-template-columns: 1fr; gap: 14px; }
  .guide-steps { grid-template-columns: 1fr; }
  .topbar-left img { width: 104px; }
  .topbar { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .player-overlay { padding: 0; }
  .player-shell { border-radius: 0; border: 0; }

  /* tap targets >= 44px on touch */
  .btn-enter { min-height: 50px; }
  .btn-logout { min-height: 44px; padding: 10px 18px; }
  .field input { min-height: 48px; font-size: 16px; }
  .player-close { width: 44px; height: 44px; }
  .video-card { padding-bottom: 2px; }
  .guide-faq dt { padding-top: 2px; }
}

@media (min-width: 900px) {
  .greeting { margin-bottom: 38px; }
}
