/* =========================================================
   創始成員頁面專屬樣式 (founders.html)
   ========================================================= */
body, html {
  height: 100%;
  overflow: hidden;
  user-select: none;
}

#custom-bg-layer {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.35;
  filter: blur(3px) saturate(110%);
  transition: background-image 0.6s ease, opacity 0.5s ease;
}

.top-bar {
  max-width: 2200px;
  z-index: 10;
  pointer-events: auto;
}

/* 主三欄架構 (桌面版) */
.game-ui-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 2200px;
  margin: 0 auto;
  height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr 400px;
  padding: 85px 30px 20px 30px;
  gap: 20px;
  pointer-events: none;
}

.game-ui-container > * {
  pointer-events: auto;
}

@media (min-aspect-ratio: 21/9) {
  .game-ui-container {
    grid-template-columns: 350px 1fr 420px;
    gap: 40px;
  }
}

/* 左側欄：角色選擇列表 */
.left-char-selector {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.char-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
  max-height: calc(100vh - 120px);
}

.char-scroll-list::-webkit-scrollbar {
  width: 4px;
}

.char-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 2px;
}

.category-group-header {
  font-size: 0.8rem;
  color: var(--primary-cyan);
  letter-spacing: 1.5px;
  font-weight: 700;
  margin: 12px 0 6px 0;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(0, 242, 254, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.category-group-header:first-child {
  margin-top: 0;
}

.char-card-item {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.char-card-item:hover {
  border-color: var(--primary-cyan);
  transform: translateX(6px);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.char-card-item.active {
  border-color: var(--primary-cyan);
  background: rgba(0, 242, 254, 0.12);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.3);
}

.char-card-item.placeholder-card {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: dashed;
}

.char-card-item.placeholder-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--panel-border);
}

.char-avatar-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.char-card-item.active .char-avatar-thumb {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 10px var(--primary-cyan);
}

.char-meta-info h3 {
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 2px;
}

.char-meta-info p {
  font-size: 0.75rem;
  color: var(--primary-cyan);
  font-weight: 500;
}

/* 中間：3D 角色視角 */
.center-3d-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.center-3d-viewport:active {
  cursor: grabbing;
}

#modelCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.drag-hint {
  position: absolute;
  bottom: 2%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1.5px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.55);
  padding: 5px 14px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 右側欄：HUD 面板 */
.right-hud-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.founders-hud-card {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.founders-hud-card.animating {
  opacity: 0.2;
  transform: translateY(10px);
}

.hud-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.hud-badge-group {
  position: relative;
}

.hud-avatar {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 2px solid var(--primary-cyan);
  object-fit: cover;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
  cursor: zoom-in;
}

.hud-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--neon-pink);
  position: absolute;
  right: -5px;
  bottom: -5px;
  background: #000;
  object-fit: cover;
  cursor: zoom-in;
}

.hud-name-group h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.hud-role-tag {
  display: inline-block;
  font-size: 0.78rem;
  background: linear-gradient(90deg, var(--accent-blue), var(--primary-cyan));
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.hud-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tech-tag {
  font-size: 0.72rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--primary-cyan);
  padding: 3px 8px;
  border-radius: 6px;
}

.hud-section-title {
  font-size: 0.8rem;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.hud-resume-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-resume-list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.hud-resume-list li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--primary-cyan);
  font-size: 0.6rem;
}

/* 大圖燈箱 */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.9);
  backdrop-filter: blur(15px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 85vw;
  max-height: 80vh;
  border-radius: 16px;
  border: 2px solid var(--primary-cyan);
}

/* 手機版適配 */
@media (max-width: 992px) {
  body, html {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  .center-3d-viewport {
    display: none !important;
  }

  .top-bar {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    padding: 15px 15px 10px 15px;
    flex-direction: column;
    gap: 12px;
  }

  .brand-group h1 {
    font-size: 1.2rem;
  }

  .top-nav-menu {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .top-nav-menu::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    flex-shrink: 0;
  }

  .game-ui-container {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 10px 15px 30px 15px;
    gap: 15px;
  }

  .left-char-selector {
    width: 100%;
    height: auto;
  }

  .category-group-header {
    display: none;
  }

  .char-scroll-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }

  .char-scroll-list::-webkit-scrollbar {
    height: 3px;
  }

  .char-card-item {
    flex: 0 0 auto;
    width: 160px;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 10px;
  }

  .char-card-item:hover {
    transform: none;
  }

  .char-avatar-thumb {
    width: 38px;
    height: 38px;
  }

  .char-meta-info h3, .char-meta-info p {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .char-meta-info p {
    font-size: 0.7rem;
  }

  .right-hud-panel {
    width: 100%;
    height: auto;
  }

  .hud-card {
    padding: 18px;
    border-radius: 16px;
  }

  .hud-avatar {
    width: 60px;
    height: 60px;
  }

  .hud-logo {
    width: 24px;
    height: 24px;
  }

  .hud-name-group h2 {
    font-size: 1.3rem;
  }

  .hud-role-tag {
    font-size: 0.72rem;
  }
}