* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #26ecb2;
  --primary-dark: #1fc99a;
  --secondary: #1fc99a;
  --bg-dark: #000000;
  --bg-card: #0a0a0a;
  --bg-input: #1a1a1a;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #333333;
  --success: #22c55e;
  --error: #ef4444;
  --sidebar-width: 80px;
  --gradient-main: linear-gradient(to bottom, #26ecb2, #1fc99a);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
  border-right: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: var(--primary);
}

.sidebar-logo {
  margin-bottom: 2rem;
}

.sidebar-logo svg {
  filter: drop-shadow(0 4px 12px rgba(38, 236, 178, 0.4));
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-btn .mdi {
  font-size: 26px;
  line-height: 1;
}

.nav-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: var(--primary);
  background: rgba(38, 236, 178, 0.15);
}

.nav-btn svg {
  width: 26px;
  height: 26px;
}

.sidebar-footer {
  margin-top: auto;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 3rem;
  overflow-y: auto;
  max-height: 100vh;
}

.panel {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

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

.panel-header {
  margin-bottom: 2rem;
  text-align: center;
}

.panel-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.panel-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Creation Card */
.creation-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  position: relative;
}

.creation-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: var(--primary);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Tabs */
.input-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(38, 236, 178, 0.1);
  border-color: var(--primary);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(38, 236, 178, 0.2);
  border-color: var(--primary);
  color: var(--text-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Input Groups */
.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-group textarea,
.input-group input[type="text"],
.input-group input[type="password"] {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.input-group textarea:focus,
.input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-group textarea::placeholder,
.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.05);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.upload-placeholder svg {
  color: var(--text-muted);
}

.upload-placeholder p {
  color: var(--text-secondary);
  font-weight: 500;
}

.upload-placeholder span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

#upload-preview {
  position: absolute;
  inset: 1rem;
}

#upload-preview img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--error);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.remove-image:hover {
  transform: scale(1.1);
}

/* Step Sections (new world workflow) */
.step-section {
  margin-bottom: 1.5rem;
}

.step-section:last-child {
  margin-bottom: 0;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* Image Actions (generate + upload buttons) */
.image-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.action-btn.primary {
  background: rgba(38, 236, 178, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn.primary:hover {
  background: rgba(38, 236, 178, 0.25);
}

.action-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn.secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
}

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

.or-divider {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* Image Preview Zone */
.image-preview-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.image-preview-zone.has-image {
  border-style: solid;
  border-color: var(--primary);
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
}

.preview-placeholder svg {
  color: var(--text-muted);
}

.preview-placeholder p {
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0;
}

.preview-placeholder span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.preview-image-wrapper {
  position: relative;
  display: inline-block;
  padding: 0.5rem;
}

.preview-image-wrapper img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: contain;
}

/* Options */
.options-row {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-label input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Generate Button */
.generate-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.generate-btn {
  width: auto;
  padding: 0.75rem 2rem;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(38, 236, 178, 0.3);
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(38, 236, 178, 0.4);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Panel Sub-tabs */
.panel-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.panel-tab {
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

.panel-tab:hover {
  color: var(--text-primary);
}

.panel-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.panel-tab-content {
  display: none;
}

.panel-tab-content.active {
  display: block;
}

/* Status Card */
.status-card {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.status-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#status-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-main);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Viewer Container */
.viewer-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}

.viewer-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
}

.viewer-placeholder p {
  font-weight: 500;
}

.viewer-placeholder span {
  font-size: 0.875rem;
}

#world-canvas {
  width: 100%;
  height: 100%;
  display: none;
}

#world-canvas.active {
  display: block;
}

/* Worlds Grid */
.worlds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.worlds-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  text-align: center;
}

.worlds-empty p {
  font-weight: 500;
  margin-top: 0.5rem;
}

.worlds-empty span {
  font-size: 0.875rem;
}

.world-card {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.world-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(38, 236, 178, 0.2);
}

.world-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.world-card-info {
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.world-card-info h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.world-card-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Generating World Card */
.world-card.generating {
  cursor: default;
  opacity: 0.9;
}

.world-card.generating:hover {
  transform: none;
  box-shadow: none;
}

.world-card.failed {
  cursor: default;
  border-color: #ef4444;
  opacity: 0.7;
}

.world-card.failed:hover {
  transform: none;
  box-shadow: none;
  border-color: #ef4444;
}

.generating-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--bg-input) 0%, var(--bg-card) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
}

.generating-placeholder.failed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-card) 100%);
  color: #ef4444;
}

.generating-placeholder span {
  font-size: 0.875rem;
  font-weight: 500;
}

.generating-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.status-badge.generating {
  background: rgba(38, 236, 178, 0.15);
  color: var(--primary);
  animation: pulse 2s ease-in-out infinite;
}

.status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

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

.refresh-btn,
.save-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover,
.save-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Settings Card */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.settings-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.settings-info svg {
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

.settings-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.settings-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.settings-info code {
  background: rgba(139, 92, 246, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 60px;
  }

  .nav-btn span {
    display: none;
  }

  .main-content {
    padding: 1.5rem;
  }

  .options-row {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ==================== Graph / Map Panel ==================== */

.panel.panel-map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 50; /* sidebar is z-index 100 so it stays on top */
  padding: 0;
  margin: 0;
  max-width: none;
  overflow: hidden;
  animation: none; /* no slide-in for fullscreen canvas */
}

/* Link mode top bar — floats above canvas, offset past sidebar */
.graph-header {
  position: absolute;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 60;
}

.link-mode-bar {
  display: none;
  align-items: center;
  gap: 1.5rem;
  background: rgba(38, 236, 178, 0.06);
  border-bottom: 1px solid rgba(38, 236, 178, 0.25);
  padding: 0.75rem 1.5rem;
  flex-wrap: wrap;
}

.link-mode-bar.active {
  display: flex;
}

.link-mode-world-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  padding: 0.4rem 1rem 0.4rem 0.5rem;
}

.link-mode-world-card img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.link-mode-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.link-mode-label {
  font-size: 0.65rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.link-mode-info strong {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.link-mode-cancel {
  margin-left: auto;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.link-mode-cancel:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.link-mode-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hint-plus {
  color: var(--primary);
  font-weight: 700;
}

/* Graph canvas — fills visible area (right of sidebar) */
.graph-container {
  position: absolute;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: #000;
}

.map-zoom-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 10;
}

.map-zoom-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(38, 236, 178, 0.4);
  background: rgba(0, 0, 0, 0.75);
  color: #26ecb2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  backdrop-filter: blur(6px);
}

.map-zoom-btn:hover {
  background: rgba(38, 236, 178, 0.15);
  border-color: #26ecb2;
}

.map-zoom-btn .mdi {
  font-size: 20px;
}

#world-graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Link button on world cards */
.world-card-footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(38, 236, 178, 0.15);
}

.world-link-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.55rem;
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.world-link-btn:hover {
  background: var(--primary);
  color: #000;
}

/* Explore Panel (Fullscreen 3D Viewer) */
.explore-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.explore-panel.active {
  opacity: 1;
  visibility: visible;
}

.explore-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.explore-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

#explore-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Loading overlay */
.explore-loading {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity 0.3s ease;
}

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

.explore-loading-content {
  text-align: center;
  color: white;
}

.explore-loading-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.explore-progress-bar {
  width: 300px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.explore-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.2s ease;
}

.explore-loading-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* NFT Info overlay in explore panel */
.explore-nft-info {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 24px;
  padding: 0.5rem 1rem;
  z-index: 10;
}

.explore-nft-info.hidden {
  display: none;
}

.explore-nft-badge {
  color: #10b981;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.explore-nft-address {
  color: var(--primary);
  font-family: monospace;
  font-size: 0.8rem;
  text-decoration: none;
  opacity: 0.9;
}

.explore-nft-address:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Minted badge in world cards (sidebar) */
.minted-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ===== Build panel — new builder selection layout ===== */

.build-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
}

.build-mascot {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.builder-selection {
  padding: 1rem 1.25rem;
}

.builder-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.builder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: center;
}

.builder-card:not(:disabled):hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(38, 236, 178, 0.15);
}

.builder-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.builder-card-img-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-input);
}

.builder-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.builder-coming-soon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.builder-card-label {
  display: block;
  padding: 0.5rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* World Labs form back header */

.worldlabs-form-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: border-color 0.15s, color 0.15s;
}

.back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* My Games panel header */

#panel-mygames .panel-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}


