@font-face {
  font-family: 'EG-Dragon-Caps';
  src: url('../fonts/EG_Dragon_Caps.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg-0: #06080d;
  --bg-1: #0b111c;
  --bg-2: #111b2b;
  --surface: rgba(7, 11, 18, 0.82);
  --surface-strong: rgba(11, 17, 27, 0.94);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(212, 175, 55, 0.28);
  --text: rgba(255, 248, 233, 0.94);
  --muted: rgba(255, 248, 233, 0.65);
  --accent: #d4af37;
  --accent-strong: #f2db84;
  --danger: #ff7a7a;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(212, 175, 55, 0.16), transparent 60%),
    radial-gradient(900px 700px at 100% 10%, rgba(75, 135, 255, 0.13), transparent 55%),
    linear-gradient(140deg, var(--bg-0) 0%, var(--bg-1) 42%, var(--bg-2) 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-surface {
  background: linear-gradient(180deg, rgba(14, 20, 32, 0.88), rgba(8, 11, 18, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-header {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 14px 0 18px;
  text-align: center;
  flex-wrap: wrap;
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: rgba(242, 219, 132, 0.78);
}

.app-title {
  margin: 0;
  font-family: 'EG-Dragon-Caps', Georgia, serif;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #24160d;
  text-shadow:
    0 1px 0 rgba(255, 245, 214, 0.55),
    0 0 12px rgba(229, 198, 129, 0.26),
    0 0 26px rgba(185, 142, 74, 0.18),
    1px 2px 0 rgba(19, 11, 7, 0.42);
  filter: drop-shadow(0 3px 8px rgba(214, 182, 116, 0.16));
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.search-pill {
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.search-pill span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.search-pill input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.action-btn,
.filter-btn,
.panel-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.action-btn:hover,
.filter-btn:hover,
.panel-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 219, 132, 0.48);
  background: rgba(212, 175, 55, 0.12);
}

.filter-btn.is-active,
.panel-btn {
  border-color: rgba(242, 219, 132, 0.54);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.12));
  color: #fff6d5;
}

.main-grid {
  flex: 1;
  min-height: 0;
  display: block;
}

.scene-surface {
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scene-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.collection-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.scene-search {
  min-width: 320px;
}

.scene-stage {
  position: relative;
  flex: 1;
  min-height: 540px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    radial-gradient(circle at 50% 0%, rgba(22, 32, 56, 0.2), rgba(2, 4, 8, 0.96) 62%),
    linear-gradient(180deg, rgba(4, 6, 10, 0.94), rgba(2, 3, 7, 0.98));
}

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

.scene-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.72);
  z-index: 2;
}

.scene-overlay.is-hidden {
  display: none;
}

.overlay-card {
  width: min(90%, 420px);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background: rgba(13, 19, 30, 0.94);
  text-align: center;
}

.overlay-card h2 {
  margin: 10px 0 8px;
  font-size: 28px;
  color: #fff6d5;
}

.overlay-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.panel-btn.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.selection-hud {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.selection-hud.is-hidden {
  display: none;
}

.selection-card {
  min-width: min(100%, 680px);
  max-width: min(100%, 1320px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(242, 219, 132, 0.26);
  background: rgba(9, 13, 21, 0.9);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.selection-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.selection-title {
  margin: 8px 0 0;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.08;
  color: #fff8e4;
  white-space: nowrap;
}

.selection-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.selection-actions {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.status-error {
  color: var(--danger);
}

@media (max-width: 1180px) {
  .selection-card {
    max-width: min(100%, 960px);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .app-header {
    flex-direction: column;
    padding-top: 4px;
  }

  .header-actions {
    width: 100%;
  }

  .search-pill {
    min-width: 0;
    width: 100%;
  }

  .scene-stage {
    min-height: 420px;
  }

  .selection-hud {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .selection-card {
    padding: 16px;
  }
}
