/* ==========================================================================
   MINIMALIST PIXEL UI SYSTEM — HUD OVERLAY & BENTO DRAWER (DESIGN.md)
   ========================================================================== */

:root {
  /* Surface Tokens */
  --canvas-bg: rgba(18, 18, 20, 0.88);
  --card-bg: rgba(28, 28, 32, 0.92);
  --card-bg-elevated: rgba(38, 38, 44, 0.95);
  --border-structural: rgba(255, 255, 255, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Text Tokens */
  --text-primary: #F7F6F3;
  --text-muted: #A1A1AA;
  --text-dark: #111111;

  /* Button Tokens */
  --btn-base: #27272A;
  --btn-hover: #3F3F46;
  --btn-primary-bg: #F7F6F3;
  --btn-primary-text: #111111;
  --btn-disabled-bg: rgba(255, 255, 255, 0.06);
  --btn-disabled-text: rgba(255, 255, 255, 0.3);

  /* Functional Status Tokens (Muted Pastels) */
  --pastel-green-bg: #EDF3EC;
  --pastel-green-text: #166534;
  --pastel-blue-bg: #E1F3FE;
  --pastel-blue-text: #1E40AF;
  --pastel-yellow-bg: #FBF3DB;
  --pastel-yellow-text: #854D0E;
  --pastel-red-bg: #FDEBEC;
  --pastel-red-text: #991B1B;

  /* Fonts */
  --font-pixel: 'Silkscreen', 'Pixelify Sans', monospace;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Root Layer */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#mobile-ui-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  z-index: 10;
  pointer-events: none;
  font-family: var(--font-sans);
  color: var(--text-primary);
  overflow: hidden;
  box-sizing: border-box;
}

/* Re-enable touch for interactive children */
.pixel-hud-bar,
.mobile-dock,
.bento-drawer-container,
.hud-show-fab,
#pixel-toast,
.student-bio-modal-overlay,
.instruction-modal-overlay {
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   1. Top HUD Bar (.pixel-hud-bar)
   -------------------------------------------------------------------------- */
.pixel-hud-bar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  height: 48px;
  background: var(--canvas-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 20;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.pixel-hud-bar.hidden {
  transform: translateY(-80px);
  opacity: 0;
  pointer-events: none;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  max-height: 36px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}

.brand-logo {
  height: 28px !important;
  max-height: 28px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  display: block;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22C55E;
  box-shadow: 0 0 6px #22C55E;
  animation: pulse-dot 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse-dot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.85);
    opacity: 0.5;
  }
}

/* --------------------------------------------------------------------------
   Tap-to-Place Prompt Fullscreen Overlay (.spawn-prompt-banner)
   -------------------------------------------------------------------------- */
.spawn-prompt-banner {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  background: rgba(6, 8, 14, 0.55); /* Màng phủ tối nhẹ SLAM tracking */
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: none; /* Cho phép touch tap xuyên qua overlay xuống ground plane */
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  box-sizing: border-box;
  padding: 24px 16px;
}

.spawn-prompt-banner.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.prompt-center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 360px;
  width: 100%;
  gap: 18px;
  animation: prompt-float-subtle 3s infinite ease-in-out;
}

@keyframes prompt-float-subtle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Crosshair Reticle with '+' on top */
.prompt-crosshair {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prompt-crosshair-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(96, 165, 250, 0.35);
  animation: crosshair-glow-pulse 2.2s infinite ease-in-out;
}

@keyframes crosshair-glow-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.45);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 30px rgba(96, 165, 250, 0.65);
    border-color: rgba(96, 165, 250, 0.85);
  }
}

.prompt-crosshair-svg {
  width: 56px;
  height: 56px;
  display: block;
}

/* Text group below '+' */
.prompt-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.prompt-badge {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #93C5FD;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(96, 165, 250, 0.35);
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.prompt-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #F7F6F3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  margin: 0;
  line-height: 1.4;
}

.prompt-subtitle {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  color: #D4D4D8;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  max-width: 320px;
  margin: 0;
}

.prompt-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.prompt-action-text {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #93C5FD;
  font-weight: 700;
}

.hud-center-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-badge {
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 4px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.status-badge.green {
  background: var(--pastel-green-bg);
  color: var(--pastel-green-text);
}

.status-badge.blue {
  background: var(--pastel-blue-bg);
  color: var(--pastel-blue-text);
}

.status-badge.yellow {
  background: var(--pastel-yellow-bg);
  color: var(--pastel-yellow-text);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-icon-btn {
  width: 36px;
  height: 36px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.hud-icon-btn:active {
  transform: scale(0.92);
  background: var(--btn-hover);
}

.hud-icon-btn.muted {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.38);
  color: #F87171;
}

.hud-icon-btn svg.hidden,
.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   2. Show HUD FAB (.hud-show-fab)
   -------------------------------------------------------------------------- */
.hud-show-fab {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  background: var(--canvas-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.hud-show-fab.hidden {
  transform: scale(0.5);
  opacity: 0;
  pointer-events: none;
}

.hud-show-fab:active {
  transform: scale(0.92);
}

/* --------------------------------------------------------------------------
   3. Pixel Toast Notification (#pixel-toast)
   -------------------------------------------------------------------------- */
#pixel-toast {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 58px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--card-bg-elevated);
  border: 1px solid var(--border-structural);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  pointer-events: none;
}

#pixel-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#pixel-toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

.toast-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   4. Shutter Flash Overlay (.shutter-flash-overlay)
   -------------------------------------------------------------------------- */
.shutter-flash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

.shutter-flash-overlay.flash {
  animation: flash-anim 0.35s ease-out forwards;
}

@keyframes flash-anim {
  0% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   5. Bento Grid Control Drawer (.bento-drawer-container)
   -------------------------------------------------------------------------- */
.bento-drawer-container {
  position: absolute;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px);
  left: 10px;
  right: 10px;
  max-width: 520px;
  max-height: calc(100dvh - 120px);
  box-sizing: border-box;
  margin: 0 auto;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-structural);
  border-radius: 12px;
  padding: 12px;
  z-index: 25;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.bento-drawer-container.closed {
  transform: translateY(120%) scale(0.96);
  opacity: 0;
  pointer-events: none;
}

.bento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.bento-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bento-nav-tabs::-webkit-scrollbar {
  display: none;
}

.bento-tab-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.bento-tab-btn:hover,
.bento-tab-btn.active {
  color: var(--text-primary);
  background: var(--btn-base);
  border-color: var(--border-structural);
}

.bento-close-btn {
  width: 28px;
  height: 28px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bento-close-btn:active {
  transform: scale(0.92);
  color: var(--text-primary);
}

.bento-body {
  flex: 1;
  min-height: 0;
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-structural) transparent;
  padding-right: 2px;
}

.bento-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bento-panel.hidden {
  display: none;
}

/* Single Spawn Notice Banner */
.single-spawn-notice {
  background: rgba(225, 243, 254, 0.08);
  border: 1px solid rgba(225, 243, 254, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-icon {
  color: #60A5FA;
  display: flex;
  align-items: center;
}

.notice-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Model Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 8px;
}

.model-card {
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.model-card.placed {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 24, 0.6);
}

.model-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.model-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-primary);
}

.model-subtitle {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
}

.model-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spawn-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-structural);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.spawn-btn:active {
  transform: scale(0.95);
}

.spawn-btn.disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
  border-color: transparent;
  cursor: not-allowed;
}

.remove-btn {
  width: 32px;
  height: 32px;
  background: var(--pastel-red-bg);
  color: var(--pastel-red-text);
  border: 1px solid rgba(153, 27, 27, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.remove-btn:active {
  transform: scale(0.92);
}

.despawn-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(153, 27, 27, 0.4);
  background: var(--pastel-red-bg);
  color: var(--pastel-red-text);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.despawn-btn:active {
  transform: scale(0.95);
  background: #f8d7da;
}

/* ==========================================================================
   ONLINE BLUE ARCHIVE CHARACTER ROSTER & SCHALEDB STYLES
   ========================================================================== */
.roster-tab-switcher {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-structural);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.roster-tab-btn {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-family: var(--font-pixel);
  font-size: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.roster-tab-btn.active {
  background: var(--btn-base);
  color: var(--text-primary);
  border-color: var(--border-structural);
}

.roster-search-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.roster-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  transition: border-color 0.15s ease;
}

.roster-search-input:focus {
  border-color: #60A5FA;
}

.roster-school-filters {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding-bottom: 4px;
  scrollbar-width: none;
  min-width: 0;
  width: 100%;
}

.roster-school-filters::-webkit-scrollbar {
  display: none;
}

.school-chip {
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.school-chip:hover,
.school-chip.active {
  background: rgba(96, 165, 250, 0.2);
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.5);
}

.online-roster-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: clamp(220px, 42vh, 380px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-structural) transparent;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.online-student-card {
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.online-student-card.has-glb {
  border-color: rgba(52, 211, 153, 0.3);
}

.online-student-card:hover {
  background: rgba(45, 45, 55, 0.9);
}

.student-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  overflow: hidden;
}

.student-avatar-wrap {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-structural);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.student-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.student-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.student-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.student-name-text {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.student-tags-row {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex-wrap: wrap;
}

.tag-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-school {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-role {
  background: rgba(96, 165, 250, 0.15);
  color: #93C5FD;
}

.tag-3d-ready {
  background: rgba(52, 211, 153, 0.15);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.tag-3d-none {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.3);
}

.student-actions-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.btn-student-info {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-student-info:hover {
  color: #60A5FA;
  border-color: #60A5FA;
}

.btn-online-spawn {
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.15);
  color: #34D399;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-online-spawn:hover {
  background: #34D399;
  color: #0b2217;
}

.btn-online-spawn.downloading {
  background: rgba(96, 165, 250, 0.2);
  color: #93C5FD;
  border-color: #60A5FA;
  cursor: wait;
}

/* Student Bio Modal */
.student-bio-modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  background: rgba(4, 6, 12, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
  overflow: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.student-bio-modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}

.student-bio-card {
  background: var(--card-bg-elevated);
  border: 1px solid var(--border-structural);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  box-sizing: border-box;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.student-bio-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-structural);
  background: rgba(0, 0, 0, 0.3);
  min-width: 0;
}

.student-bio-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.student-bio-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 8px;
  border: 2px solid rgba(96, 165, 250, 0.5);
  object-fit: cover;
  flex-shrink: 0;
}

.student-bio-body {
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.student-stat-pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.student-bio-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-line;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.student-bio-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-structural);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.student-bio-footer button,
.student-bio-footer a {
  pointer-events: auto;
  cursor: pointer;
}

/* Control Slider Groups */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-primary);
}

.control-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* Pixel Range Input */
.pixel-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  outline: none;
}

.pixel-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--text-primary);
  border: 1px solid var(--text-dark);
  border-radius: 3px;
  cursor: pointer;
}

/* Matrix Display Box */
.matrix-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #4ADE80;
  display: flex;
  justify-content: space-between;
}

/* Quick Action Buttons inside Panels */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.panel-action-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 10px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.panel-action-btn:active {
  transform: scale(0.95);
  background: var(--btn-hover);
}

.panel-action-btn.danger {
  background: var(--pastel-red-bg);
  color: var(--pastel-red-text);
  border-color: rgba(153, 27, 27, 0.3);
}

/* --------------------------------------------------------------------------
   6. Bottom Mobile Dock (.mobile-dock)
   -------------------------------------------------------------------------- */
.mobile-dock {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  max-width: 520px;
  margin: 0 auto;
  height: 52px;
  background: var(--canvas-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  z-index: 20;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-dock.hidden {
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
}

.dock-btn {
  flex: 1;
  height: 40px;
  margin: 0 3px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-pixel);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.dock-btn:active {
  transform: scale(0.95);
  background: var(--btn-hover);
}

.dock-btn.primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 700;
}

.dock-btn.active {
  border-color: var(--pastel-blue-bg);
  background: var(--btn-hover);
}

/* --------------------------------------------------------------------------
   8. Remote Console Log Overlay Panel (.remote-console-floating)
   -------------------------------------------------------------------------- */
.remote-console-floating {
  position: absolute;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 12px;
  right: 12px;
  height: 190px;
  max-height: 45vh;
  background: rgba(10, 10, 14, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  z-index: 25;
  pointer-events: auto;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.remote-console-floating.hidden {
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
}

.remote-console-header {
  height: 32px;
  background: rgba(22, 22, 28, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.remote-console-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.remote-console-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.console-mini-btn {
  height: 22px;
  padding: 0 8px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.console-mini-btn:hover,
.console-mini-btn:active {
  background: var(--btn-hover);
  color: var(--text-primary);
}

.remote-console-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 3px;
  -webkit-overflow-scrolling: touch;
}

.console-log-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  word-break: break-all;
  white-space: pre-wrap;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
  padding-bottom: 2px;
}

.console-log-line.log {
  color: #F7F6F3;
}

.console-log-line.warn {
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.08);
}

.console-log-line.error {
  color: #F87171;
  background: rgba(248, 113, 113, 0.12);
}

.console-log-line.info {
  color: #60A5FA;
}

.log-timestamp {
  font-size: 9px;
  color: #71717A;
  user-select: none;
  flex-shrink: 0;
}

.log-tag {
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: bold;
  flex-shrink: 0;
}

.log-tag.log {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.log-tag.warn {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
}

.log-tag.error {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

.log-tag.info {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
}

.log-content {
  flex: 1;
}

/* --------------------------------------------------------------------------
   9. AR Instruction / Onboarding Guide Modal (.instruction-modal-overlay)
   -------------------------------------------------------------------------- */
.instruction-modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  background: rgba(10, 10, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
  overflow: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.instruction-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.instruction-card {
  width: 100%;
  max-width: min(440px, calc(100vw - 32px));
  max-height: calc(100% - 32px);
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-structural);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 auto;
  box-sizing: border-box;
  animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from {
    transform: scale(0.94) translateY(12px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.instruction-header {
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.instruction-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.instruction-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-structural) transparent;
}

.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.instruction-step:hover {
  background: var(--btn-hover);
  border-color: rgba(96, 165, 250, 0.3);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93C5FD;
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content strong {
  display: block;
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.step-content p {
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
  word-break: break-word;
}

.step-content strong.highlight,
.step-content p strong {
  color: #93C5FD;
  font-weight: 600;
}

.instruction-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.instruction-ack-btn {
  width: 100%;
  height: 38px;
  background: var(--btn-primary-bg);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  color: var(--btn-primary-text);
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.instruction-ack-btn:hover,
.instruction-ack-btn:active {
  transform: scale(0.97);
  background: #FFFFFF;
}

/* Quick mouth preset buttons */
.quick-mouth-presets {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.quick-mouth-presets::-webkit-scrollbar {
  display: none;
}

.quick-mouth-presets .bento-tab-btn {
  flex: 1;
  min-width: 60px;
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.quick-mouth-presets .bento-tab-btn:hover,
.quick-mouth-presets .bento-tab-btn:active {
  background: var(--btn-hover);
  border-color: rgba(96, 165, 250, 0.5);
  color: #93C5FD;
  transform: scale(0.96);
}

.pixel-btn-sm {
  flex: 1;
  min-width: 60px;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 6px 4px;
  background: rgba(0, 255, 200, 0.08);
  border: 1px solid rgba(0, 255, 200, 0.25);
  border-radius: 4px;
  color: #00ffc8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pixel-btn-sm:active {
  transform: scale(0.95);
  background: rgba(0, 255, 200, 0.2);
}

/* Mobile Screen Tuning (< 480px) */
@media (max-width: 480px) {
  .pixel-hud-bar {
    left: 8px;
    right: 8px;
    height: 44px;
    padding: 0 8px;
  }

  .brand-logo {
    height: 24px;
    max-width: 105px;
  }

  .hud-center-status {
    gap: 4px;
  }

  .status-badge {
    font-size: 8px;
    padding: 3px 6px;
  }

  .hud-icon-btn {
    width: 32px;
    height: 32px;
  }

  .mobile-dock {
    left: 6px;
    right: 6px;
    height: 48px;
    padding: 0 3px;
  }

  .dock-btn {
    height: 38px;
    margin: 0 1px;
    font-size: 8px;
    gap: 2px;
    padding: 0 2px;
  }

  .dock-btn svg {
    width: 13px;
    height: 13px;
  }

  .bento-drawer-container {
    left: 6px;
    right: 6px;
    padding: 8px 10px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 52px);
    max-height: calc(100dvh - 110px);
  }

  .bento-body {
    max-height: calc(100dvh - 165px);
  }

  .online-student-card {
    padding: 6px 8px;
    gap: 6px;
  }

  .student-avatar-wrap {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .btn-online-spawn {
    padding: 5px 8px;
    font-size: 9px;
  }

  .bento-tab-btn {
    padding: 5px 6px;
    font-size: 8.5px;
  }

  .student-bio-card {
    max-width: calc(100vw - 16px);
    max-height: 90vh;
  }

  .student-bio-header {
    padding: 10px 12px;
  }

  .student-bio-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .student-bio-body {
    padding: 12px;
    gap: 8px;
  }

  .student-bio-footer {
    padding: 8px 12px;
    gap: 6px;
  }

  .student-bio-footer button,
  .student-bio-footer a {
    font-size: 9.5px;
    padding: 6px 10px !important;
  }

  /* Instruction Modal Mobile Tuning */
  .instruction-modal-overlay {
    padding: 10px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .instruction-card {
    max-width: calc(100vw - 20px);
    width: 100%;
    max-height: calc(100% - 20px);
    border-radius: 10px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .instruction-header {
    height: 42px;
    min-height: 42px;
    padding: 0 12px;
  }

  .instruction-title {
    font-size: 10px;
  }

  .instruction-body {
    padding: 10px 12px;
    gap: 6px;
  }

  .instruction-step {
    padding: 7px 9px;
    gap: 8px;
  }

  .step-num {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .step-content strong {
    font-size: 9px;
  }

  .step-content p {
    font-size: 10px;
    line-height: 1.35;
  }

  .instruction-footer {
    padding: 8px 12px;
  }

  .instruction-ack-btn {
    height: 36px;
    font-size: 9px;
  }
}

/* ==========================================================================
   Model Variant Selection Modal & Multi-Model Costume Selector
   ========================================================================== */
.model-variant-modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
  overflow: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.model-variant-modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}

.model-variant-card {
  background: var(--card-bg-elevated);
  border: 1px solid var(--border-structural);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  box-sizing: border-box;
}

.model-variant-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-structural);
  background: rgba(0, 0, 0, 0.3);
  min-width: 0;
}

.variant-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.variant-header-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
  border: 2px solid rgba(96, 165, 250, 0.5);
  object-fit: cover;
}

.variant-modal-student-name {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.variant-modal-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.model-variant-body {
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.variant-prompt-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 9.5px;
  color: #93C5FD;
  background: rgba(59, 130, 246, 0.12);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

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

.variant-card-item {
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
}

.variant-card-item:hover {
  background: var(--btn-hover);
  border-color: rgba(96, 165, 250, 0.4);
}

.variant-card-item.active-in-ar {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.08);
}

.variant-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.variant-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.variant-item-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-primary);
}

.variant-item-file {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-variant-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-structural);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Bio modal variant chips */
.bio-variants-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.bio-variant-chip {
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.bio-variant-chip:hover {
  background: var(--btn-hover);
  border-color: #60A5FA;
}

.bio-variant-chip.selected {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60A5FA;
  color: #93C5FD;
}

.tag-models-count {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.btn-choose-variant {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #93C5FD !important;
  border-color: rgba(96, 165, 250, 0.4) !important;
}

.btn-choose-variant:hover {
  background: #2563EB !important;
  color: #FFFFFF !important;
}

@media (max-width: 480px) {
  .model-variant-card {
    max-width: calc(100vw - 16px);
    max-height: 90vh;
  }
}

/* --------------------------------------------------------------------------
   7. Credits & Attribution Bento Grid (.credits-wrapper)
   -------------------------------------------------------------------------- */
.credits-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.credits-header-card {
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.credits-app-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.credits-app-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #60A5FA;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credits-desc-text {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.credits-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.credit-grid-card {
  background: var(--btn-base);
  border: 1px solid var(--border-structural);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
  box-sizing: border-box;
}

.credit-grid-card:hover {
  background: var(--btn-hover);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.credit-grid-card:active {
  transform: scale(0.98);
}

.credit-grid-card.full-width {
  grid-column: span 2;
}

.credit-grid-card.primary-card {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
}

.credit-card-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.credit-card-badge.accent-demo {
  background: #E1F3FE;
  color: #1E40AF;
}

.credit-card-badge.accent-po {
  background: #EDF3EC;
  color: #166534;
}

.credit-card-badge.accent-game {
  background: #FBF3DB;
  color: #854D0E;
}

.credit-card-badge.accent-fankit {
  background: #FDEBEC;
  color: #991B1B;
}

.credit-card-badge.accent-git {
  background: rgba(255, 255, 255, 0.15);
  color: #F7F6F3;
}

.credit-card-badge.accent-tech {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
}

.credit-card-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-primary);
  margin-top: 2px;
}

.credit-card-link {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #60A5FA;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.credit-card-desc {
  font-family: var(--font-sans);
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.3;
}

.credit-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-structural);
  border-radius: 4px;
  color: var(--text-primary);
}

@media (max-width: 360px) {
  .credits-bento-grid {
    grid-template-columns: 1fr;
  }
  .credit-grid-card.full-width {
    grid-column: span 1;
  }
}