/* ═══════════════════════════════════════════════
   BioVillage — Dark Theme Styles
   A TypeLabs experiment
   ═══════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #0a0f0a;
  --color-surface: rgba(16, 24, 16, 0.85);
  --color-surface-solid: #101810;
  --color-border: rgba(74, 240, 192, 0.12);
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-text: #e2e8e2;
  --color-text-muted: #7a8a7a;
  --color-primary: #4af0c0;
  --color-primary-dim: rgba(74, 240, 192, 0.15);
  --color-danger: #ff6b8a;
  --color-warning: #f0c846;

  --stat-energy: #f0c846;
  --stat-strength: #e05545;
  --stat-recovery: #4af0c0;
  --stat-stress: #ff6b8a;
  --stat-longevity: #8b5cf6;
  --stat-inflammation: #ff8c42;
  --stat-metabolic: #38bdf8;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --blur: 16px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Canvas ── */
#village-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
  image-rendering: pixelated;
}

#village-canvas:active {
  cursor: grabbing;
}

/* ── UI Overlay ── */
#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

#ui-overlay > * {
  pointer-events: auto;
}

/* ── Top Bar ── */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(10, 15, 10, 0.75);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--color-border-subtle);
  gap: 12px;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  color: var(--color-primary);
  flex-shrink: 0;
}

.logo-area h1 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--color-primary);
  color: #0a0f0a;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.primary-btn:hover {
  background: #5cffd0;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 240, 192, 0.3);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn svg {
  flex-shrink: 0;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(74, 240, 192, 0.3);
}

.invite-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.invite-btn:hover {
  color: var(--color-text);
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.03);
}

.invite-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-border);
}

/* ── Population Badge ── */
.pop-badge {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-primary-dim);
  border: 1px solid rgba(74, 240, 192, 0.2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}

.pop-count {
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

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

/* ── Stat Badge (Clock) ── */
.stat-badge {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Milestone Bar ── */
#milestone-bar {
  padding: 6px 16px 8px;
  background: rgba(10, 15, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.milestone-track {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: visible;
}

.milestone-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #38bdf8);
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.milestone-markers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
}

.milestone-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  transform: translateX(-1px);
}

.milestone-mark::after {
  content: attr(data-label);
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.milestone-mark:hover::after {
  opacity: 1;
}

.milestone-msg {
  margin-top: 6px;
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ── Hidden Utility ── */
.hidden {
  display: none !important;
}

/* ── Welcome Overlay ── */
#welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.welcome-card {
  max-width: 520px;
  width: 90%;
  padding: 40px 36px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
}

.welcome-icon {
  margin-bottom: 20px;
}

.welcome-card h2 {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.welcome-subtitle {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.welcome-steps {
  text-align: left;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-dim);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(74, 240, 192, 0.2);
}

.welcome-step strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.welcome-step span {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.welcome-btn {
  width: 100%;
  justify-content: center;
  padding: 11px 20px;
  font-size: 14px;
}

.welcome-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ── Modal Backdrop ── */
#upload-modal,
#share-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 5, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-content {
  position: relative;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-surface-solid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.modal-content .icon-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  font-size: 18px;
  z-index: 2;
}

/* ── Upload Modal ── */
.upload-header-area h2 {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-desc {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.upload-incentive {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px;
  background: rgba(74, 240, 192, 0.04);
  border: 1px solid rgba(74, 240, 192, 0.1);
  border-radius: var(--radius-md);
}

.incentive-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.incentive-item svg {
  flex-shrink: 0;
}

/* ── Form ── */
#villager-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#villager-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.paste-label {
  font-size: 12px;
}

#villager-form input[type="text"],
#villager-form input[type="number"] {
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

#villager-form input:focus {
  border-color: var(--color-primary);
}

#paste-field {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

#paste-field:focus {
  border-color: var(--color-primary);
}

#paste-field::placeholder {
  color: rgba(122, 138, 122, 0.6);
  font-size: 11px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row label {
  flex: 1;
}

.optional-note {
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.7;
  margin-top: -8px;
}

.submit-btn {
  width: 100%;
  justify-content: center;
  padding: 11px 20px;
  font-size: 14px;
  margin-top: 4px;
}

.upload-footer-note {
  margin-top: 16px;
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.6;
  text-align: center;
  line-height: 1.5;
}

/* ── Parsed Preview ── */
.parsed-preview {
  padding: 12px;
  background: rgba(74, 240, 192, 0.04);
  border: 1px solid rgba(74, 240, 192, 0.12);
  border-radius: var(--radius-sm);
}

.preview-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

#parsed-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.parsed-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(74, 240, 192, 0.08);
  border: 1px solid rgba(74, 240, 192, 0.2);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text);
}

.parsed-tag .tag-name {
  color: var(--color-text-muted);
  font-weight: 400;
}

.parsed-tag .tag-value {
  color: var(--color-primary);
  font-weight: 700;
}

/* ── Profile Card ── */
#profile-card {
  position: fixed;
  top: 80px;
  right: 16px;
  width: 320px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: rgba(16, 24, 16, 0.92);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  z-index: 30;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

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

#profile-card .icon-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  font-size: 16px;
}

#profile-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

#profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

#profile-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

#profile-age {
  font-size: 12px;
  color: var(--color-text-muted);
}

#profile-trait-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 3px;
  line-height: 1.4;
}

/* Profile stat bars */
#profile-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  width: 90px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.stat-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-value {
  width: 30px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Profile biomarker list */
#profile-biomarkers {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 14px;
}

.biomarker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}

.biomarker-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  padding: 2px 0;
}

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

.biomarker-val {
  color: var(--color-text);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ── Profile Reputation Bar ── */
#profile-reputation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

#rep-level {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #f0a060;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

#rep-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

#rep-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f0a060, #4af0c0);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

#rep-score {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Profile Level Ring ── */
#profile-avatar {
  position: relative;
}

#profile-level-ring {
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: conic-gradient(#4af0c0 0%, #f0a060 50%, #4af0c0 100%) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#profile-card.has-progress #profile-level-ring {
  opacity: 1;
}

/* ── Badges Section ── */
#profile-badges {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 12px;
  margin-bottom: 12px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

#badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-item {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge-item:hover {
  transform: scale(1.15);
}

.badge-item.tier-bronze {
  background: rgba(205, 127, 50, 0.15);
  border: 1px solid rgba(205, 127, 50, 0.3);
}

.badge-item.tier-silver {
  background: rgba(192, 192, 220, 0.15);
  border: 1px solid rgba(192, 192, 220, 0.3);
}

.badge-item.tier-gold {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.15);
}

.badge-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 15, 10, 0.95);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 40;
  margin-bottom: 4px;
}

.badge-item:hover .badge-tooltip {
  opacity: 1;
}

.empty-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  font-style: italic;
  opacity: 0.6;
}

/* ── Journey Log ── */
#profile-journey {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 12px;
  margin-bottom: 12px;
}

#journey-entries {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.journey-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 2px solid var(--color-border-subtle);
}

.journey-entry-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.journey-entry-body {
  flex: 1;
  min-width: 0;
}

.journey-entry-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.journey-entry-detail {
  font-size: 9px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.journey-entry-time {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--color-text-muted);
  opacity: 0.5;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Agents Visited ── */
#profile-agents-visited {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 12px;
  margin-bottom: 12px;
}

#agents-visited-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(74, 240, 192, 0.08);
  border: 1px solid rgba(74, 240, 192, 0.2);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: #4af0c0;
  text-transform: capitalize;
}

.agent-chip-icon {
  font-size: 11px;
}

/* ── Badge Celebration Overlay ── */
#badge-celebration {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: celebrationFadeIn 0.4s ease;
}

#badge-celebration.hidden {
  display: none;
}

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

#badge-celebration-content {
  text-align: center;
  animation: celebrationPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebrationPopIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#badge-celebration-icon {
  font-size: 64px;
  margin-bottom: 12px;
  animation: celebrationBounce 0.6s ease 0.3s;
}

@keyframes celebrationBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

#badge-celebration-name {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

#badge-celebration-desc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

#badge-celebration-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.celebration-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(74, 240, 192, 0.1);
  border: 1px solid rgba(74, 240, 192, 0.25);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #4af0c0;
}

.celebration-stat.positive {
  color: #4af0c0;
  border-color: rgba(74, 240, 192, 0.25);
  background: rgba(74, 240, 192, 0.1);
}

.celebration-stat.negative {
  color: #f06060;
  border-color: rgba(240, 96, 96, 0.25);
  background: rgba(240, 96, 96, 0.1);
}

/* ── Share Modal ── */
.share-content {
  text-align: center;
}

.share-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.share-header h2 {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}

.share-desc {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.share-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.share-stat {
  text-align: center;
}

.share-stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
}

.share-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.share-cta-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.share-cta-text {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-url-input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.copy-link-btn {
  padding: 8px 16px;
  background: var(--color-primary);
  color: #0a0f0a;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.copy-link-btn:hover {
  background: #5cffd0;
}

.copy-confirm {
  font-size: 11px;
  color: var(--color-primary);
  margin-top: 6px;
}

.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.share-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.share-social-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-border);
}

.share-challenge {
  padding: 12px;
  background: rgba(74, 240, 192, 0.04);
  border: 1px solid rgba(74, 240, 192, 0.1);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.share-challenge em {
  color: var(--color-text);
}

/* ── Zoom Controls ── */
#zoom-controls {
  position: fixed;
  bottom: 90px;
  right: 16px;
  z-index: 91;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}
.zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(136,212,184,0.25);
  background: rgba(10,26,20,0.85);
  color: #88d4b8;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
  padding: 0;
}
.zoom-btn:hover {
  background: rgba(136,212,184,0.15);
  border-color: rgba(136,212,184,0.5);
}
.zoom-btn:active {
  background: rgba(136,212,184,0.25);
}
.zoom-reset {
  font-size: 14px;
}
@media (max-width: 767px) {
  #zoom-controls {
    bottom: 80px;
    right: 10px;
  }
  .zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* ── Village Chat Bar ── */
#village-chat-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  width: 90%;
  max-width: 480px;
  pointer-events: auto;
}

/* ── Now Playing Strip ── */
.music-strip {
  position: fixed;
  right: 16px;
  bottom: 76px;
  z-index: 89;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 8px 12px;
  border: 1px solid rgba(74, 240, 192, 0.14);
  border-radius: 999px;
  background: rgba(8, 14, 10, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
}

.music-strip__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.music-strip__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(122, 138, 122, 0.9);
}

.music-strip__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: rgba(226, 232, 226, 0.92);
}

.music-strip__link {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.music-strip__link:hover {
  border-color: rgba(74, 240, 192, 0.25);
  background: rgba(74, 240, 192, 0.08);
  color: #80ffd9;
}

.music-strip__link:focus-visible {
  outline: 2px solid rgba(74, 240, 192, 0.4);
  outline-offset: 2px;
}

#village-chat-form {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(10, 15, 20, 0.88);
  border: 1px solid rgba(74, 240, 192, 0.25);
  border-radius: 24px;
  padding: 4px 4px 4px 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 40px rgba(74, 240, 192, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#village-chat-form:focus-within {
  border-color: rgba(74, 240, 192, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 60px rgba(74, 240, 192, 0.12);
}

#village-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8e2;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  padding: 8px 0;
  min-width: 0;
}

#village-chat-input::placeholder {
  color: rgba(74, 240, 192, 0.35);
  font-style: italic;
}

#village-chat-send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(74, 240, 192, 0.15);
  border: 1px solid rgba(74, 240, 192, 0.25);
  color: #4af0c0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

#village-chat-send:hover {
  background: rgba(74, 240, 192, 0.25);
  transform: scale(1.05);
}

#village-chat-send:active {
  transform: scale(0.95);
}

@media (max-width: 600px) {
  #village-chat-bar {
    bottom: 24px;
    width: 92%;
    max-width: none;
  }
  #village-chat-input {
    font-size: 14px;
  }
}

.kombat-active #village-chat-bar {
  width: 40vw;
}

@media (max-width: 900px) {
  .kombat-active #village-chat-bar {
    width: 100vw;
    opacity: 0.1;
    pointer-events: none;
  }

  .music-strip {
    left: 50%;
    right: auto;
    bottom: 92px;
    width: calc(100vw - 20px);
    max-width: 460px;
    transform: translateX(-50%);
  }
}

/* ── Footer ── */
#site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.5;
  pointer-events: auto;
  z-index: 10;
}

.kombat-active .music-strip {
  display: none;
}

#site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

#site-footer a:hover {
  text-decoration: underline;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  #top-bar {
    padding: 8px 10px;
    gap: 8px;
  }

  .logo-area h1 {
    font-size: 13px;
  }

  .top-actions {
    gap: 6px;
  }

  .invite-btn span:not(svg) {
    display: none;
  }

  #profile-card {
    right: 8px;
    width: calc(100vw - 16px);
    top: 70px;
  }

  .modal-content {
    padding: 20px 16px;
  }

  .music-strip {
    align-items: flex-start;
    gap: 10px;
    bottom: 88px;
    padding: 9px 12px;
  }

  .music-strip__title {
    white-space: normal;
    line-height: 1.35;
  }

  .music-strip__link {
    align-self: center;
  }
}

/* ═══════════════════════════════════════════════
   BIOMARKER KOMBAT — Retro Arcade Aesthetic
   CRT scanlines, pixel fonts, arcade cabinet feel
   ═══════════════════════════════════════════════ */

/* Arcade font variable */
:root {
  --font-arcade: 'Press Start 2P', monospace;
}

/* Split-view layout */
.kombat-active #village-canvas {
  width: 40vw;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.kombat-active #ui-overlay { width: 40vw; }
.kombat-active #site-footer { width: 40vw; }
.kombat-active #top-bar .invite-btn,
.kombat-active #milestone-bar { display: none; }

/* ── KOMBAT Panel ── */
#kombat-panel {
  position: fixed;
  top: 0; right: 0;
  width: 60vw; height: 100vh;
  background: #0a0a14;
  z-index: 50;
  overflow-y: auto; overflow-x: hidden;
  border-left: 2px solid #1a1a3a;
  transform: translateX(0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#kombat-panel.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

/* ── CRT Scanline Overlay ── */
.kombat-crt-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 999;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0.12) 4px
    );
  mix-blend-mode: multiply;
}

/* ── Arcade Screen Base ── */
.arcade-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 24px 20px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(20, 10, 40, 0.8) 0%, transparent 70%),
    linear-gradient(180deg, #08081a 0%, #0c0a1e 40%, #0a1018 100%);
  text-align: center;
  image-rendering: pixelated;
}

/* ── Arcade Marquee Title ── */
.arcade-marquee {
  margin: 12px 0 20px;
  padding: 8px 0;
}

.arcade-title-main {
  font-family: var(--font-arcade);
  font-size: 28px;
  color: #ffd700;
  text-shadow:
    0 0 10px rgba(255, 215, 0, 0.6),
    0 0 30px rgba(255, 215, 0, 0.3),
    3px 3px 0 #8a6a00;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.arcade-title-sub {
  font-family: var(--font-arcade);
  font-size: 32px;
  color: #ff3355;
  text-shadow:
    0 0 10px rgba(255, 51, 85, 0.6),
    0 0 30px rgba(255, 51, 85, 0.3),
    3px 3px 0 #801a2a;
  letter-spacing: 0.1em;
  line-height: 1.3;
  margin-top: 2px;
}

/* ── Matchup Layout ── */
.arcade-matchup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 600px;
  justify-content: center;
}

.arcade-fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 180px;
}

.arcade-sprite {
  image-rendering: pixelated;
  width: 80px;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.3));
}

.arcade-fighter-name {
  font-family: var(--font-arcade);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.arcade-fighter-nick {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #7a8a9a;
  letter-spacing: 0.04em;
}

.arcade-pwr {
  font-family: var(--font-arcade);
  font-size: 10px;
  color: #e0e0e0;
  letter-spacing: 0.05em;
}

/* ── Segmented HP Bar ── */
.arcade-hp-bar {
  display: flex;
  gap: 2px;
  height: 10px;
}

.arcade-hp-seg {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── VS Badge ── */
.arcade-vs-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.arcade-vs-star {
  font-size: 10px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.arcade-vs-text {
  font-family: var(--font-arcade);
  font-size: 18px;
  color: #ff3355;
  text-shadow:
    0 0 10px rgba(255, 51, 85, 0.6),
    2px 2px 0 #801a2a;
  letter-spacing: 0.1em;
}

/* ── Coin Insert Area ── */
.arcade-coin-area {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.arcade-insert-coin {
  font-family: var(--font-arcade);
  font-size: 9px;
  color: #ffd700;
  letter-spacing: 0.15em;
  animation: coin-blink 1.2s step-end infinite;
}

@keyframes coin-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.arcade-prompt-btns {
  display: flex;
  gap: 12px;
}

/* ── Arcade Buttons ── */
.arcade-btn {
  font-family: var(--font-arcade);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  image-rendering: pixelated;
}

.arcade-btn-fight {
  background: #ff3355;
  color: #fff;
  border-color: #ff6680;
  box-shadow:
    0 0 15px rgba(255, 51, 85, 0.4),
    inset 0 -3px 0 rgba(0,0,0,0.3);
}

.arcade-btn-fight:hover {
  background: #ff4466;
  box-shadow:
    0 0 25px rgba(255, 51, 85, 0.6),
    inset 0 -3px 0 rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.arcade-btn-fight:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.3);
}

.arcade-btn-skip {
  background: rgba(255,255,255,0.05);
  color: #7a8a9a;
  border-color: rgba(255,255,255,0.15);
}

.arcade-btn-skip:hover {
  background: rgba(255,255,255,0.1);
  color: #e2e8e2;
}

/* ── Version Footer ── */
.arcade-version {
  font-family: var(--font-arcade);
  font-size: 7px;
  color: #3a3a5a;
  letter-spacing: 0.1em;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════
   ARENA SCREEN
   ═══════════════════════════════════════════════ */

.kombat-arena {
  min-height: 100vh;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

/* Arena Header */
.arena-header {
  text-align: center;
  padding: 8px 0 12px;
  border-bottom: 2px solid #1a1a3a;
  margin-bottom: 12px;
}

.arena-title {
  font-family: var(--font-arcade);
  font-size: 12px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  letter-spacing: 0.15em;
}

/* HUD Row */
.arena-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.arena-p1, .arena-p2 {
  flex: 1;
}

.arena-name {
  font-family: var(--font-arcade);
  font-size: 9px;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.arena-pwr {
  font-family: var(--font-arcade);
  font-size: 9px;
  color: #ffd700;
}

.arena-p2 {
  text-align: right;
}

.arena-p2 .arena-hp-row {
  justify-content: flex-end;
}

/* Score Block */
.arena-score-block {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px 8px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.arena-score {
  font-family: var(--font-arcade);
  font-size: 16px;
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: center;
}

.arena-score-sep {
  font-family: var(--font-arcade);
  font-size: 14px;
  color: #555;
}

/* Battle Stage */
.arena-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px 24px 8px;
  margin-bottom: 12px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(30, 15, 50, 0.6) 0%, transparent 70%),
    linear-gradient(180deg, transparent 0%, rgba(10, 5, 20, 0.4) 100%);
  border-bottom: 3px solid #1a1a3a;
  min-height: 120px;
}

.arena-sprite {
  image-rendering: pixelated;
  width: 96px;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.2));
  z-index: 1;
}

.arena-sprite-left {
  animation: fighter-idle-left 0.8s steps(2) infinite;
}

.arena-sprite-right {
  animation: fighter-idle-right 0.8s steps(2) infinite;
}

@keyframes fighter-idle-left {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes fighter-idle-right {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* FIGHT! Flash */
.arena-fight-flash {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-arcade);
  font-size: 28px;
  color: #ff3355;
  text-shadow:
    0 0 20px rgba(255, 51, 85, 0.8),
    0 0 40px rgba(255, 51, 85, 0.4),
    4px 4px 0 #801a2a;
  animation: fight-flash-in 0.3s ease-out;
  z-index: 10;
  letter-spacing: 0.15em;
}

.fight-flash-hide {
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes fight-flash-in {
  0% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ── Rounds ── */
.arena-rounds {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
}

.arcade-round {
  background: rgba(255,255,255,0.02);
  border: 1px solid #1a1a3a;
  padding: 10px 12px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  transform: translateY(0);
}

.arcade-round.round-enter {
  opacity: 0;
  transform: translateY(12px);
}

.round-win-left {
  border-left: 3px solid #ff6a00;
  background: rgba(255, 106, 0, 0.04);
}

.round-win-right {
  border-right: 3px solid #4488ff;
  background: rgba(68, 136, 255, 0.04);
}

.round-tie {
  border-left: 3px solid #ffd700;
  background: rgba(255, 215, 0, 0.04);
}

.arcade-round-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.arcade-round-icon {
  font-size: 12px;
}

.arcade-round-name {
  font-family: var(--font-arcade);
  font-size: 7px;
  color: #e2e8e2;
  letter-spacing: 0.06em;
}

.arcade-round-score {
  margin-left: auto;
  font-family: var(--font-arcade);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.arcade-round-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8a9aaa;
  line-height: 1.5;
}

/* ── Result Banner ── */
.arcade-result {
  text-align: center;
  padding: 20px 12px;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.arcade-result.round-enter {
  opacity: 0;
  transform: translateY(16px);
}

.arcade-result-banner {
  margin-bottom: 16px;
}

.arcade-result-label {
  font-family: var(--font-arcade);
  font-size: 10px;
  letter-spacing: 0.3em;
  margin-bottom: 8px;
  animation: coin-blink 0.8s step-end infinite;
}

.arcade-result-winner {
  font-family: var(--font-arcade);
  font-size: 16px;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-shadow: 0 0 12px currentColor;
}

.arcade-result-score {
  font-family: var(--font-arcade);
  font-size: 24px;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.arcade-result-sub {
  font-family: var(--font-arcade);
  font-size: 7px;
  color: #7a8a9a;
  letter-spacing: 0.08em;
}

.arcade-close-btn {
  margin-top: 16px;
}

/* ═══════════════════════════════════════════════
   KOMBAT Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .kombat-active #village-canvas,
  .kombat-active #ui-overlay,
  .kombat-active #site-footer {
    width: 100vw;
    opacity: 0.1;
    pointer-events: none;
  }

  #kombat-panel {
    width: 100vw;
  }

  .arcade-title-main { font-size: 20px; }
  .arcade-title-sub { font-size: 24px; }
  .arcade-sprite { width: 60px; }
  .arcade-matchup { gap: 10px; }
  .arcade-vs-text { font-size: 14px; }
  .arena-sprite { width: 72px; }
  .arena-stage { padding: 12px 16px 8px; }
  .arena-fight-flash { font-size: 20px; }
  .arena-name { font-size: 7px; }
  .arena-pwr { font-size: 7px; }
  .arena-score { font-size: 18px; }
  .arena-hud { gap: 4px; }
  .arcade-hp-bar { width: 80px !important; }
  .arcade-hp-seg { width: 6px; height: 8px; }
}

/* ===== PWA Install Banner ===== */
#pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #1a1040 0%, #2a1860 100%);
  border-top: 2px solid #4af0c080;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
#pwa-install-banner.visible {
  transform: translateY(0);
}
#pwa-install-banner .pwa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(74, 240, 192, 0.2);
}
#pwa-install-banner .pwa-text {
  flex: 1;
  min-width: 0;
}
#pwa-install-banner .pwa-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #4af0c0;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#pwa-install-banner .pwa-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin: 0;
  line-height: 1.4;
}
#pwa-install-banner .pwa-install-btn {
  background: #4af0c0;
  color: #0a0a12;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}
#pwa-install-banner .pwa-install-btn:hover {
  transform: scale(1.04);
  background: #60ffda;
}
#pwa-install-banner .pwa-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
  transition: color 0.15s;
}
#pwa-install-banner .pwa-close-btn:hover {
  color: #fff;
}

/* Standalone mode tweaks — when running as installed app */
@media (display-mode: standalone) {
  #top-bar {
    padding-top: env(safe-area-inset-top, 0px);
  }
  #site-footer {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  /* Hide install banner in standalone mode */
  #pwa-install-banner {
    display: none !important;
  }
}

/* ─── CHALLENGE LINK SYSTEM ──────────────────────────────── */

.challenge-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #e05545;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  margin-top: 10px;
}
.challenge-link-btn:hover {
  filter: brightness(1.1);
}
.challenge-link-btn:active {
  transform: scale(0.98);
}

.copied-msg {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #4af0c0;
  text-align: center;
  margin-top: 6px;
  animation: pulse 1.5s infinite;
}

#profile-challenge-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ─── FIGHT RESULT OVERLAY ──────────────────────────────── */

.fight-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
@media (min-width: 640px) {
  .fight-result-overlay {
    align-items: center;
  }
}

.fight-result-content {
  background: #1a1830;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.3s ease-out;
}
@media (min-width: 640px) {
  .fight-result-content {
    border-radius: 16px;
    padding-bottom: 24px;
  }
}

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

.fight-result-header {
  text-align: center;
  margin-bottom: 16px;
}
.fight-result-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffd700;
  letter-spacing: 2px;
  margin: 0;
}
.fight-result-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: #4af0c0;
  margin: 6px 0 0;
}

.fight-result-matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.fight-result-fighter {
  text-align: center;
  flex: 1;
}
.fight-result-vs {
  text-align: center;
  padding: 0 10px;
}
.fight-vs-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #e05545;
  margin: 0;
}

.fight-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 auto 6px;
}
.fight-avatar-winner {
  background: rgba(74, 240, 192, 0.15);
  border: 2px solid #4af0c0;
  color: #4af0c0;
}
.fight-avatar-loser {
  background: rgba(224, 85, 69, 0.15);
  border: 2px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.4);
}
.fight-avatar-challenger {
  background: rgba(224, 85, 69, 0.15);
  border: 2px solid rgba(224, 85, 69, 0.5);
  color: #e05545;
}

.fight-fighter-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}
.winner-name {
  color: #4af0c0;
}
.fight-fighter-power {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  margin: 2px 0 0;
}

.fight-challenge-btn {
  margin-top: 0;
  margin-bottom: 10px;
}

.fight-share-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.fight-share-btn {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.fight-share-btn:hover {
  background: rgba(255,255,255,0.1);
}

.fight-close-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  padding: 8px;
  cursor: pointer;
  transition: color 0.15s;
}
.fight-close-btn:hover {
  color: rgba(255,255,255,0.6);
}

/* ─── CHALLENGE LANDING ──────────────────────────────── */

.challenge-landing-overlay {
  z-index: 70;
  background: rgba(0,0,0,0.8);
}

.challenge-landing-header {
  text-align: center;
  margin-bottom: 16px;
}
.challenge-landing-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #e05545;
  letter-spacing: 1px;
  margin: 8px 0 0;
}

.challenge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(224, 85, 69, 0.3);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.challenge-card-info {
  flex: 1;
}
.challenge-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.challenge-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #8b5cf6;
  margin: 2px 0 0;
}
.challenge-card-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.challenge-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
}
.challenge-stat-val {
  color: #e05545;
  font-weight: 700;
}

.challenge-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-bottom: 14px;
}
.challenge-accept-btn {
  width: 100%;
  margin-bottom: 8px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════
   v4 STYLES
   ═══════════════════════════════════════════════ */

/* Music Button */
.music-btn {
  position: relative;
  opacity: 0.5;
  transition: opacity 0.3s, color 0.3s;
}

.music-btn.active {
  opacity: 1;
  color: var(--color-primary);
}

.music-btn.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: musicPulse 1.5s ease-in-out infinite;
}

@keyframes musicPulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.3); }
}

/* v4 Tag */
.v4-tag {
  display: inline-block;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Protocol Panel */
#protocol-panel,
#sanctuary-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  z-index: 900;
  background: rgba(10, 15, 10, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#protocol-panel.hidden,
#sanctuary-panel.hidden {
  display: none;
}

.protocol-panel-inner,
.sanctuary-panel-inner {
  padding: 20px;
}

.protocol-panel-header,
.sanctuary-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.protocol-panel-title-row,
.sanctuary-panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.protocol-panel-header h2,
.sanctuary-panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.protocol-desc,
.sanctuary-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Protocol Cards */
.protocol-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.protocol-card {
  background: rgba(42, 106, 170, 0.08);
  border: 1px solid rgba(74, 138, 202, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
}

.protocol-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.protocol-owner {
  font-weight: 700;
  font-size: 14px;
}

.protocol-forks {
  font-size: 11px;
  color: var(--color-text-muted);
}

.protocol-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.protocol-section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 8px;
}

.protocol-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.protocol-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.protocol-section li {
  font-size: 11px;
  color: var(--color-text);
  padding: 2px 0;
  opacity: 0.85;
}

.protocol-section li::before {
  content: '\2022 ';
  color: var(--color-primary);
  opacity: 0.5;
}

.fork-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px 12px;
  background: rgba(74, 240, 192, 0.1);
  border: 1px solid rgba(74, 240, 192, 0.25);
  border-radius: 6px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.fork-btn:hover {
  background: rgba(74, 240, 192, 0.2);
}

.protocol-empty {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 30px 10px;
}

/* Achievement Cards */
.achievement-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  opacity: 0.5;
  transition: opacity 0.3s;
}

.achievement-card.earned {
  opacity: 1;
  background: rgba(234, 179, 8, 0.06);
  border-color: rgba(234, 179, 8, 0.2);
}

.achievement-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.achievement-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.achievement-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.achievement-desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

.achievement-status {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.achievement-card.earned .achievement-status {
  color: #eab308;
}

/* Mobile adjustments for panels */
@media (max-width: 500px) {
  #protocol-panel,
  #sanctuary-panel {
    width: 100vw;
  }
  .protocol-sections {
    grid-template-columns: 1fr;
  }
}

/* ─── WIMMY PANEL ───────────────────────────────────────── */
#wimmy-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 15, 20, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: wimmyFadeIn 0.4s ease;
}
#wimmy-panel.hidden { display: none; }

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

.wimmy-panel-inner {
  background: linear-gradient(170deg, rgba(15, 30, 35, 0.97), rgba(10, 25, 30, 0.98));
  border: 1px solid rgba(136, 212, 184, 0.2);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 420px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(136, 212, 184, 0.08);
}

.wimmy-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(136, 212, 184, 0.12);
}

.wimmy-panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wimmy-panel-title-row h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #a8d8c0;
  margin: 0;
}

.wimmy-subtitle {
  font-size: 10px;
  color: rgba(136, 212, 184, 0.5);
  font-weight: 500;
}

.wimmy-dialogue-content {
  min-height: 120px;
}

.wimmy-text {
  margin-bottom: 20px;
}

.wimmy-text p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(220, 230, 225, 0.9);
  margin: 0 0 8px 0;
}

.wimmy-pause {
  opacity: 0.85;
}

.wimmy-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wimmy-choice-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: rgba(136, 212, 184, 0.08);
  border: 1px solid rgba(136, 212, 184, 0.2);
  border-radius: 10px;
  color: #c8e8d8;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  text-decoration: none;
}

.wimmy-choice-btn:hover {
  background: rgba(136, 212, 184, 0.15);
  border-color: rgba(136, 212, 184, 0.35);
  transform: translateY(-1px);
}

.wimmy-choice-secondary {
  background: transparent;
  border-color: rgba(136, 212, 184, 0.1);
  color: rgba(168, 216, 192, 0.6);
  font-size: 12px;
}

.wimmy-choice-secondary:hover {
  background: rgba(136, 212, 184, 0.05);
  color: rgba(168, 216, 192, 0.8);
}

.wimmy-breathe-btn {
  background: rgba(136, 212, 184, 0.15);
  border-color: rgba(136, 212, 184, 0.3);
  color: #a8d8c0;
  text-align: center;
  font-weight: 600;
}

.wimmy-breathe-btn:hover {
  background: rgba(136, 212, 184, 0.25);
  border-color: #88d4b8;
}

/* Breathwork UI */
.wimmy-breathwork {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.wimmy-breath-phase {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #a8d8c0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.wimmy-breath-circle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
}

.wimmy-breath-circle {
  border-radius: 50%;
  opacity: 0.6;
  transition: all 0.1s linear;
  box-shadow: 0 0 30px rgba(136, 212, 184, 0.3);
}

.wimmy-breath-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #c8e8d8;
}

.wimmy-breath-cycle {
  font-size: 11px;
  color: rgba(168, 216, 192, 0.5);
  font-weight: 500;
}

/* Breathwork result stats */
.wimmy-result-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.wimmy-stat-bonus {
  background: rgba(136, 212, 184, 0.08);
  border: 1px solid rgba(136, 212, 184, 0.15);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #a8d8c0;
  font-weight: 600;
}

.wimmy-stat-up {
  color: #4af0c0;
  margin-right: 2px;
}

@media (max-width: 500px) {
  .wimmy-panel-inner {
    padding: 20px;
    border-radius: 12px;
    max-height: 85vh;
  }
  .wimmy-result-stats {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════════
   KUSH CHAMBER PANEL
   ═══════════════════════════════════════════════════════════════ */

#kush-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 25, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: kushFadeIn 0.4s ease;
}
#kush-panel.hidden { display: none; }

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

.kush-panel-inner {
  background: linear-gradient(170deg, rgba(26, 10, 46, 0.97), rgba(15, 5, 30, 0.98));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 440px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(139, 92, 246, 0.1), 0 0 120px rgba(139, 92, 246, 0.05);
}

.kush-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.kush-panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kush-panel-title-row h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #c4b5fd;
  margin: 0;
}

.kush-subtitle {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.5);
  font-weight: 500;
}

.kush-dialogue-content {
  min-height: 120px;
}

.kush-text {
  margin-bottom: 20px;
}

.kush-text p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(220, 215, 240, 0.9);
  margin: 0 0 8px 0;
}

.kush-pause {
  opacity: 0.75;
}

.kush-desc {
  font-size: 15px;
  font-weight: 500;
  color: rgba(240, 235, 255, 0.95) !important;
  font-style: italic;
}

.kush-ritual-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: rgba(196, 181, 253, 0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 16px !important;
}

.kush-ritual {
  color: rgba(196, 181, 253, 0.8) !important;
  font-size: 13px;
}

/* Aura ring */
.kush-aura-ring {
  text-align: center;
  padding: 28px 20px;
  margin-bottom: 20px;
  position: relative;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--aura-color, #8b5cf6) 8%, transparent), transparent 70%);
  border: 1px solid color-mix(in srgb, var(--aura-color, #8b5cf6) 20%, transparent);
  animation: kushAuraPulse 3s ease-in-out infinite;
}

@keyframes kushAuraPulse {
  0%, 100% { box-shadow: 0 0 20px color-mix(in srgb, var(--aura-color, #8b5cf6) 10%, transparent); }
  50% { box-shadow: 0 0 40px color-mix(in srgb, var(--aura-color, #8b5cf6) 20%, transparent), 0 0 80px color-mix(in srgb, var(--aura-color, #8b5cf6) 5%, transparent); }
}

.kush-aura-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: var(--aura-color, #8b5cf6);
  margin-bottom: 6px;
  text-shadow: 0 0 20px color-mix(in srgb, var(--aura-color, #8b5cf6) 40%, transparent);
}

.kush-aura-tone {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(196, 181, 253, 0.6);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 500;
}

/* Result stats */
.kush-result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.kush-stat-bonus {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #c4b5fd;
  font-weight: 600;
}

.kush-stat-up {
  color: #a78bfa;
  margin-right: 2px;
}

.kush-stat-down {
  color: #4af0c0;
  margin-right: 2px;
}

/* Choice buttons */
.kush-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kush-choice-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  color: #dcd5f0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  text-decoration: none;
}

.kush-choice-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.kush-accept-btn {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  text-align: center;
  font-weight: 600;
}

.kush-accept-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: #8b5cf6;
}

.kush-explore-btn {
  background: transparent;
  border-color: rgba(139, 92, 246, 0.15);
  color: rgba(196, 181, 253, 0.7);
  text-align: center;
  font-size: 12px;
}

.kush-explore-btn:hover {
  background: rgba(139, 92, 246, 0.08);
  color: #c4b5fd;
}

.kush-choice-secondary {
  background: transparent;
  border-color: rgba(139, 92, 246, 0.1);
  color: rgba(196, 181, 253, 0.5);
  font-size: 12px;
}

.kush-choice-secondary:hover {
  background: rgba(139, 92, 246, 0.05);
  color: rgba(196, 181, 253, 0.7);
}

/* Loading animation */
.kush-loader {
  display: flex;
  justify-content: center;
  padding: 30px 0;
}

.kush-loader-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), rgba(139, 92, 246, 0.1));
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);
  animation: kushOrbPulse 1.5s ease-in-out infinite;
}

@keyframes kushOrbPulse {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

@media (max-width: 500px) {
  .kush-panel-inner {
    padding: 20px;
    border-radius: 12px;
    max-height: 85vh;
  }
  .kush-aura-name {
    font-size: 14px;
  }
  .kush-result-stats {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Proto Transfer Modal
   ═══════════════════════════════════════════════════════════════ */

#proto-transfer-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}

#proto-transfer-modal.hidden {
  display: none;
}

.proto-transfer-content {
  background: #1a1a2e;
  border: 1px solid rgba(74, 240, 192, 0.2);
  border-radius: 16px;
  padding: 32px;
  max-width: 440px;
  width: 100%;
  position: relative;
  animation: protoSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.proto-transfer-content .icon-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

.proto-step {
  text-align: center;
}

.proto-step.hidden {
  display: none;
}

.proto-transfer-icon {
  margin: 0 auto 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proto-success-icon svg {
  filter: drop-shadow(0 0 12px rgba(74, 240, 192, 0.4));
}

.proto-spinner svg {
  animation: protoSpin 0.8s linear infinite;
}

@keyframes protoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.proto-step h2 {
  font-family: var(--font-mono);
  font-size: 20px;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}

.proto-desc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* Data preview */
.proto-data-preview {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
  text-align: left;
}

.proto-preview-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px;
}

#proto-data-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proto-data-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(74, 240, 192, 0.1);
  color: #4af0c0;
  border: 1px solid rgba(74, 240, 192, 0.15);
}

.proto-data-chip.identity {
  background: rgba(240, 200, 70, 0.1);
  color: #f0c846;
  border-color: rgba(240, 200, 70, 0.15);
}

/* Consent checkboxes */
.proto-consent-checks {
  text-align: left;
  margin-bottom: 20px;
}

.proto-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
}

.proto-check input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #4af0c0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.proto-check span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

/* Email input */
.proto-email-field {
  margin-bottom: 20px;
}

.proto-email-field input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.proto-email-field input:focus {
  border-color: #4af0c0;
}

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

/* Buttons */
.proto-step .primary-btn {
  width: 100%;
  margin-bottom: 8px;
}

.proto-step .primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.text-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 8px;
  transition: color 0.15s;
}

.text-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.proto-visit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

/* Mobile */
@media (max-width: 480px) {
  .proto-transfer-content {
    padding: 24px 20px;
  }
  .proto-step h2 {
    font-size: 18px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TYPE LABS HQ PANEL
   ═══════════════════════════════════════════════════════════════ */

#typelabs-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 20, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: typelabsFadeIn 0.4s ease;
}
#typelabs-panel.hidden { display: none; }

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

.typelabs-panel-inner {
  background: linear-gradient(170deg, rgba(15, 15, 25, 0.97), rgba(10, 10, 18, 0.98));
  border: 1px solid rgba(200, 168, 120, 0.18);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 420px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(200, 168, 120, 0.06);
}

.typelabs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(200, 168, 120, 0.12);
}

.typelabs-panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.typelabs-panel-title-row h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #e8d8c0;
  margin: 0;
}

.typelabs-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: rgba(200, 168, 120, 0.5);
  margin-left: 4px;
}

.typelabs-dialogue-content {
  min-height: 80px;
}

.typelabs-text {
  margin-bottom: 20px;
}

.typelabs-greeting {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #e8d8c0;
  line-height: 1.8;
  margin: 0 0 8px 0;
}

.typelabs-pause {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: rgba(200, 168, 120, 0.5);
  margin: 8px 0 0 0;
}

.typelabs-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.typelabs-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(200, 168, 120, 0.25);
}

.typelabs-btn-primary {
  background: rgba(200, 168, 120, 0.15);
  color: #e8d8c0;
}
.typelabs-btn-primary:hover {
  background: rgba(200, 168, 120, 0.25);
  border-color: rgba(200, 168, 120, 0.4);
}

.typelabs-btn-secondary {
  background: rgba(40, 40, 60, 0.5);
  color: rgba(200, 168, 120, 0.6);
}
.typelabs-btn-secondary:hover {
  background: rgba(60, 60, 80, 0.5);
  color: rgba(200, 168, 120, 0.8);
}

.typelabs-input-wrap {
  margin: 12px 0;
}

.typelabs-input {
  width: 100%;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 10px 14px;
  background: rgba(20, 20, 35, 0.8);
  border: 1px solid rgba(200, 168, 120, 0.2);
  border-radius: 8px;
  color: #e8d8c0;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.typelabs-input:focus {
  border-color: rgba(200, 168, 120, 0.45);
}
.typelabs-input::placeholder {
  color: rgba(200, 168, 120, 0.3);
}

@media (max-width: 480px) {
  .typelabs-panel-inner {
    padding: 20px;
  }
  .typelabs-panel-title-row h2 {
    font-size: 10px;
  }
}
