/* ============================================================
   CK48 Reunion 30 — 3D Banquet Scene Styling
   ============================================================ */

:root {
  --bq-bg: #0b0f19;
  --bq-card-bg: rgba(18, 24, 38, 0.88);
  --bq-card-border: rgba(255, 215, 0, 0.25);
  --bq-gold: #f59e0b;
  --bq-gold-light: #fbbf24;
  --bq-text: #f8fafc;
  --bq-text-muted: #94a3b8;
  --bq-accent: #e11d48;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bq-bg);
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--bq-text);
  user-select: none;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ================= Top HUD Bar ================= */
.banquet-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  gap: 12px;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.hud-glass {
  background: var(--bq-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-brand__logo {
  height: 34px;
  width: auto;
  border-radius: 6px;
}

.hud-brand__info h1 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-brand__info h1 .badge-30 {
  background: linear-gradient(135deg, #d97706, #fbbf24);
  color: #111;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.hud-brand__info p {
  font-size: 12px;
  color: var(--bq-text-muted);
}

/* Quick Nav / Buttons */
.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  pointer-events: auto;
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--bq-gold);
  color: var(--bq-gold-light);
  transform: translateY(-1px);
}

.hud-btn.active {
  background: linear-gradient(135deg, #b45309, #d97706);
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.hud-select {
  background: rgba(18, 24, 38, 0.9);
  color: #f1f5f9;
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  pointer-events: auto;
}

.hud-select:focus {
  border-color: var(--bq-gold);
}

/* ================= Bottom Controls Bar ================= */
.banquet-bottom-bar {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  max-width: 95vw;
  overflow-x: auto;
  padding: 6px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--bq-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.view-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.view-btn.active {
  color: #111;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.bottom-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}

/* Floating Helper Tip - hidden to avoid overlapping bottom bar and chatter box */
.hud-tip {
  display: none !important;
}

/* ================= Orientation Hint (引導手機轉橫向) ================= */
/* 預設不顯示；只在「觸控裝置 + 直向」才出現，桌機、已經橫向的手機都看不到。
   轉成橫向後 media query 會自動不匹配、整個隱藏，不需要額外的 JS 監聽 orientationchange。 */
.orientation-hint {
  display: none;
}

@media (hover: none) and (orientation: portrait) {
  .orientation-hint:not(.dismissed) {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 110;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px;
    text-align: center;
    background: rgba(9, 13, 22, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

.orientation-hint__icon {
  font-size: 48px;
  animation: orientationHintSpin 1.8s ease-in-out infinite;
}

@keyframes orientationHintSpin {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
}

.orientation-hint__text {
  font-size: 16px;
  color: #f8fafc;
  line-height: 1.6;
  max-width: 320px;
}

.orientation-hint__text strong {
  color: #fbbf24;
}

.orientation-hint__dismiss {
  margin-top: 6px;
  padding: 10px 22px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
}

/* ================= Table Details Modal / Drawer ================= */
.table-drawer {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--bq-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bq-card-border);
  border-radius: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.table-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, transparent 100%);
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.drawer-title .class-tag {
  background: #d97706;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.drawer-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Stats Cards in Drawer */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.stat-box .num {
  font-size: 18px;
  font-weight: 800;
  color: var(--bq-gold-light);
  line-height: 1.2;
}

.stat-box.stat-green .num {
  color: #34d399;
}

.stat-box.stat-yellow .num {
  color: #fbbf24;
}

.stat-box.stat-gray .num {
  color: #94a3b8;
}

.stat-box .label {
  font-size: 11px;
  color: var(--bq-text-muted);
  margin-top: 3px;
  white-space: nowrap;
}

/* Attendance Progress Bar */
.progress-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--bq-text-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-track.stacked {
  display: flex;
}

.progress-segment {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-segment.reg {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-segment.pending {
  background: #f59e0b;
}

.progress-segment.missing {
  background: #334155;
}

/* Filter Tabs in Drawer */
.drawer-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--bq-text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.filter-tab.active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: #f59e0b;
  color: #111;
  font-weight: 800;
}

/* Privacy Masking Notice Box */
.privacy-alert {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #fef08a;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Classmate List (Masked Names) */
.members-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.members-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.members-group-title {
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0 2px 0;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.members-group-title.title-reg {
  color: #34d399;
}

.members-group-title.title-pending {
  color: #fbbf24;
}

.members-group-title.title-missing {
  color: #94a3b8;
}

.member-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: #e2e8f0;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.member-chip.status-registered {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-weight: 600;
}

.member-chip.status-pending {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fef08a;
}

.member-chip.status-missing {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.action-btn--primary {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff;
}

.action-btn--primary:hover {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.nav-tables-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.nav-table-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-table-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Loading Overlay */
.loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #090d16;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

.loading-text {
  font-size: 15px;
  color: #e2e8f0;
  letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hud-brand__info p {
    display: none;
  }
  .hud-brand h1 {
    font-size: 13px;
  }
  .hud-select {
    max-width: 110px;
    font-size: 12px;
    padding: 6px 8px;
  }
  .table-drawer {
    top: 60px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
  }
  .banquet-bottom-bar {
    bottom: 10px;
  }
  .view-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* 使用者反饋「系統訊息遮蔽操控手把」：聊天氣泡框原本只在 <=768px 隱藏，但虛擬搖桿
   (.mobile-walk-controls) 的顯示條件是 <=900px 或觸控裝置——橫向手機常落在
   769~900px 之間，兩個條件沒對齊，聊天框會蓋住搖桿。改成跟搖桿用同一組條件。 */
@media (max-width: 900px), (hover: none) {
  .banquet-chatter-box {
    display: none !important;
  }
}

/* ================= 3D Speech Bubbles Layer ================= */
#speech-bubbles-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.speech-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid var(--bq-gold);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #f8fafc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(245, 158, 11, 0.25);
  pointer-events: none;
  max-width: 290px;
  min-width: 130px;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}

.speech-bubble.visible {
  opacity: 1;
  transform: translate(-50%, -115%) scale(1);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 9px 8px 0;
  border-style: solid;
  border-color: rgba(18, 24, 38, 0.94) transparent;
  display: block;
  width: 0;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 11px 9px 0;
  border-style: solid;
  border-color: var(--bq-gold) transparent;
  display: block;
  width: 0;
}

.speech-bubble__author {
  font-size: 11px;
  font-weight: 700;
  color: var(--bq-gold-light);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.speech-bubble__text {
  font-size: 13px;
  font-weight: 500;
}

.speech-bubble__promo-link {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fef08a;
  font-size: 11px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.speech-bubble__promo-link:hover {
  background: var(--bq-gold);
  color: #111;
}

/* ================= Bottom-Left Banquet Chatter Stream ================= */
.banquet-chatter-box {
  position: absolute;
  bottom: 80px;
  left: 18px;
  z-index: 10;
  max-width: 340px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  overflow: hidden;
  transition: all 0.3s ease;
}

.banquet-chatter-box.minimized .chatter-body {
  display: none;
}

.chatter-header {
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--bq-gold-light);
}

.chatter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatter-btn {
  background: none;
  border: none;
  color: var(--bq-text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.chatter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chatter-body {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
}

.chatter-quote {
  font-weight: 500;
  margin-bottom: 8px;
}

.chatter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chatter-tag {
  font-size: 11px;
  color: var(--bq-text-muted);
}

.chatter-action {
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ================= Swordsman Avatar & Walking HUD ================= */
.swordsman-banner {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: 16px;
  padding: 10px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 15;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.25);
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
  animation: bannerSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 32px);
  text-align: center;
}

.swordsman-banner.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

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

.swordsman-banner__badge {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 1px;
}

.swordsman-banner__text {
  font-size: 12px;
  color: #e2e8f0;
}

.swordsman-banner__text strong {
  color: #38bdf8;
}

/* 使用者反饋「橫幅訊息壓在畫面正中央」：橫向手機螢幕高度常常只有 360~430px，
   76px 的 top 偏移加上橫幅本身的高度，在矮螢幕上比例會吃掉快一半畫面，
   看起來就像壓在正中間。矮螢幕改縮小字體/間距、整個往上貼齊 HUD 正下方。 */
@media (max-height: 500px) and (hover: none) {
  .swordsman-banner {
    top: 8px;
    padding: 6px 14px;
    gap: 1px;
  }
  .swordsman-banner__badge {
    font-size: 11px;
  }
  .swordsman-banner__text {
    font-size: 9px;
  }
}

/* Mobile On-Screen Virtual Walk Controls */
.mobile-walk-controls {
  position: absolute;
  bottom: 84px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 12;
}

/* 使用者反饋：轉向該用拖曳視角（已有的手勢），移動用圓盤搖桿——拖哪個方向就往哪個
   方向平移，不用再猜「左右鍵是轉身還是平移」。knob 的位移由 JS 直接設 transform。 */
.joystick-base {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.05s linear;
}

.joystick-base.active .joystick-knob {
  background: #f59e0b;
  transition: none;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

/* Renamed from the former duplicate ".action-btn" (mobile walk D-pad circular buttons)
   so it no longer collides with the unrelated ".action-btn" / ".action-btn--primary"
   rule above (drawer footer "前往校友連結" link), which this class's later cascade
   position was overriding and squashing into a 50x50 circle. */
.walk-action-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.walk-action-btn:active {
  background: #f59e0b;
  color: #111;
  transform: scale(0.9);
}

/* Hide mobile controls on desktop with mouse, show on touch or narrow screens */
@media (min-width: 901px) and (hover: hover) {
  .mobile-walk-controls {
    display: none;
  }
}

/* ================= Cutscene & 48 Slash Effects ================= */
.cutscene-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.5s ease;
}

.cutscene-overlay.hidden {
  display: none;
}

/* While Cutscene is playing, hide ALL gameplay HUD and controls completely */
body.cutscene-active .banquet-hud,
body.cutscene-active .banquet-bottom-bar,
body.cutscene-active .hud-tip,
body.cutscene-active .banquet-chatter-box,
body.cutscene-active .swordsman-banner,
body.cutscene-active .mobile-walk-controls,
body.cutscene-active .interactive-action-prompt {
  display: none !important;
}

/* Interactive Action Prompt (Near Wall or Curtain) */
.interactive-action-prompt {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.interactive-action-prompt.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

/* 手機上翻牆/斬幕提示跟虛擬搖桿擠在同一個 bottom:84px，提示訊息蓋住操控手把點不到。
   提示改放到搖桿正上方；搖桿本體（.joystick-base）從 bottom:84px 往上疊 120px，
   頂到 bottom:204px，提示框要整個清開這個範圍才不會壓到搖桿。
   注意：這個覆寫規則一定要寫在上面 base .interactive-action-prompt 規則「之後」——
   之前放在前面，被後面同層級選擇器的 bottom:84px 蓋回去，手機上其實從沒真的生效過。 */
@media (max-width: 900px), (hover: none) {
  .interactive-action-prompt {
    bottom: 220px;
  }
}

/* 橫向手機螢幕很矮（高度常常只有 360~430px），220px 的底部留空加上搖桿本身
   就快佔滿整個畫面高度，提示框跟歡迎橫幅會擠在畫面中段。矮螢幕改把提示框
   移到上方（HUD 正下方），跟底部搖桿澈底分層，不用再猜底部可以留多少空間。 */
@media (max-height: 500px) and (hover: none) {
  .interactive-action-prompt {
    bottom: auto;
    top: 64px;
  }
  .interactive-action-prompt.hidden {
    transform: translateX(-50%) translateY(-12px);
  }
}

.interactive-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.95));
  border: 2px solid #f59e0b;
  border-radius: 30px;
  padding: 12px 28px;
  color: #fef08a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.45);
  animation: promptPulse 1.8s infinite ease-in-out;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.interactive-action-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, rgba(45, 27, 105, 0.98), rgba(20, 28, 55, 0.98));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 28px rgba(245, 158, 11, 0.65);
}

.interactive-action-btn:active {
  transform: scale(0.97);
}

@keyframes promptPulse {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.35);
    border-color: #f59e0b;
  }
  50% {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 28px rgba(245, 158, 11, 0.75);
    border-color: #fef08a;
  }
}



.view-btn.highlight-btn {
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
  font-weight: 700;
}

.view-btn.highlight-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #fff;
  border-color: #f59e0b;
}



