/* **************************************************
**** UPDATE: 2026-04-03 (Music setup framing + chip selectors + mobile layout fix + player jump + better checkbox row + studio workflow banner)
*************************************************** */

:root {
  --bg: #08111d;
  --panel: #101826;
  --panel-2: #0c1b2e;
  --line: #2d4562;
  --text: #ffffff;
  --muted: #b8c7da;
  --accent: #67b3ff;
  --accent-2: #3f8cff;
  --ok: #22c55e;
  --danger: #ef4444;
  --radius: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #08111d, #050b14);
  color: var(--text);
  overflow-x: hidden;
}

body {
  min-width: 0;
}

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: #050b14;
  border-bottom: 1px solid #1c2a3c;
}

.brand {
  font-weight: bold;
  font-size: 20px;
  line-height: 1.1;
  word-break: break-word;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav a {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  border-radius: 16px;
  background: #0c1b2e;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #16304d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.nav a.active {
  border-color: #4d8fe0;
  box-shadow:
    0 0 0 1px rgba(103, 179, 255, 0.20),
    0 0 20px rgba(63, 140, 255, 0.18);
}

.nav .nav-icon {
  font-size: 30px;
  line-height: 1;
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.card {
  width: 100%;
  background: #0c1b2e;
  border-radius: 18px;
  border: 1px solid #1c2a3c;
  overflow: hidden;
}

.card-header {
  padding: 16px;
  border-bottom: 1px solid #1c2a3c;
}

.card-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-body {
  padding: 16px;
}

.field {
  margin-bottom: 18px;
  min-width: 0;
}

.field label {
  font-size: 15px;
  font-weight: 800;
  color: #d7e3f4;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.field-step-label {
  display: flex;
  align-items: center;
  gap: 14px;
}

.field input,
.field textarea,
.field select,
.picker-search {
  width: 100%;
  max-width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #2d4562;
  background: #08172a;
  color: #ffffff;
  font-size: 16px;
  box-sizing: border-box;
}

.field input::placeholder,
.field textarea::placeholder,
.picker-search::placeholder {
  color: #b8c7da;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.picker-search:focus {
  border-color: var(--accent);
  background: #0c1c31;
  outline: none;
}

.field textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.4;
}

.field-step-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  flex-shrink: 0;
}

.field-step-badge.red {
  background: #7f1d1d;
}

.field-step-badge.green {
  background: #166534;
}

.generate-box {
  margin: 20px 0;
  padding: 18px 14px;
  border-radius: 18px;
  background: #0c1b2e;
  border: 1px solid #1c2a3c;
}

.generate-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
}

.generate-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.generate-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.step-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  flex-shrink: 0;
}

.step-circle.red {
  background: #7f1d1d;
}

.step-circle.green {
  background: #166534;
}

.generate-button {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

button {
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: bold;
  border: none;
  font-size: 16px;
  cursor: pointer;
  max-width: 100%;
}

.btn-primary {
  background: linear-gradient(180deg, #67b3ff, #3f8cff);
  color: #08111d;
}

.btn-secondary {
  background: #2c3545;
  color: #fff;
}

.review-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(103, 179, 255, 0.10);
  border: 1px solid rgba(103, 179, 255, 0.24);
}

.review-copy {
  margin-bottom: 12px;
  line-height: 1.45;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pick-wrap {
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.pick-wrap input {
  flex: 1 1 auto;
  min-width: 0;
}

.pick-btn {
  width: 92px;
  min-width: 92px;
  border-radius: 20px;
  background: linear-gradient(180deg, #67b3ff, #3f8cff);
  color: #08111d;
  font-size: 28px;
}

.picker-modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  padding: 14px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}

.picker-panel {
  background: #0c1b2e;
  padding: 18px;
  border-radius: 18px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #1c2a3c;
}

.picker-header {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 14px;
}

.picker-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.picker-list {
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  min-height: 120px;
}

.picker-item {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  padding: 14px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  transition: 0.18s ease;
}

.picker-item:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.16);
}

.picker-item.active {
  background: linear-gradient(180deg, rgba(103, 179, 255, 0.95), rgba(63, 140, 255, 0.95));
  color: #08111d;
  border-color: rgba(103, 179, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(103, 179, 255, 0.16);
}

.picker-empty {
  color: var(--muted);
}

.picker-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fold {
  margin-top: 14px;
}

.fold summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.status {
  margin-top: 12px;
  min-height: 22px;
}

.status.error {
  color: #ef4444;
}

.status.success {
  color: #22c55e;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
}

.checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-row label {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #d7e3f4;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.format-preset-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.30);
  font-size: 14px;
}

.player-wrap {
  margin-top: 12px;
}

.player-wrap h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

audio {
  width: 100%;
  margin-top: 8px;
}

.download-link {
  display: inline-block;
  margin-top: 12px;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 700;
}

.download-link:hover {
  color: #bfdbfe;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  padding: 14px;
  border-radius: 14px;
  background: #08172a;
  border: 1px solid #1c2a3c;
}

.history-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.history-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.history-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.empty-state {
  color: var(--muted);
}

.highlight-flash {
  box-shadow: 0 0 0 2px rgba(103, 179, 255, 0.35);
}

/* ===== Music setup sections ===== */

.setup-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #1c2a3c;
  border-radius: 18px;
  background: rgba(8, 23, 42, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.setup-section-title {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid #2d4562;
  background: rgba(103, 179, 255, 0.08);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 14px 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.setup-section .hint {
  margin-top: 10px;
}

.setup-section .chip-actions {
  margin-top: 14px;
}

.setup-section + .setup-section {
  margin-top: 20px;
}

/* ===== Music chip selectors ===== */

.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.chip-btn {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid #2d4562;
  background: #08172a;
  color: #d7e3f4;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: 0.18s ease;
}

.chip-btn:hover {
  border-color: #4d8fe0;
  background: #0c1c31;
}

.chip-btn.active {
  background: linear-gradient(180deg, #67b3ff, #3f8cff);
  color: #08111d;
  border-color: #67b3ff;
  box-shadow:
    0 0 0 1px rgba(103, 179, 255, 0.20),
    0 0 14px rgba(63, 140, 255, 0.18);
}

.chip-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-clear-btn {
  padding: 10px 16px;
}

/* ===== Studio workflow banner ===== */

.studio-flow-banner {
  position: relative;
  overflow: hidden;
  margin: 20px 0 22px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 191, 73, 0.14), rgba(103, 179, 255, 0.10), rgba(255, 191, 73, 0.08));
  border: 1px solid rgba(255, 200, 100, 0.45);
  box-shadow:
    0 0 12px rgba(255, 200, 100, 0.18),
    inset 0 0 10px rgba(255, 200, 100, 0.08);
  animation: studioGlowPulse 3s ease-in-out infinite;
}

.studio-flow-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: -42%;
  width: 42%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.20),
    transparent
  );
  transform: skewX(-20deg);
  animation: studioLightSweep 4.2s linear infinite;
}

.studio-flow-title {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: #ffcc70;
}

.studio-flow-steps {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.flow-step {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.flow-step:hover {
  transform: scale(1.04);
  background: rgba(255,255,255,0.13);
  border-color: rgba(255, 200, 100, 0.32);
}

.flow-arrow {
  font-size: 22px;
  font-weight: 800;
  color: #ffcc70;
  line-height: 1;
  animation: studioArrowMove 1.6s ease-in-out infinite;
}

.studio-flow-sub {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 13px;
  color: #dfeaf8;
  opacity: 0.88;
}

/* ===== Desktop ===== */

@media (min-width: 901px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand {
    font-size: 20px;
  }

  .nav a {
    width: 74px;
    height: 74px;
    min-width: 74px;
    min-height: 74px;
  }

  .nav .nav-icon {
    font-size: 38px;
  }

  .grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .pick-btn {
    width: 120px;
    min-width: 120px;
    font-size: 30px;
  }

  .chip-btn {
    font-size: 15px;
    padding: 13px 18px;
  }

  .setup-section-title {
    font-size: 26px;
    padding: 12px 18px;
  }

  .studio-flow-banner {
    padding: 20px 22px;
  }

  .studio-flow-title {
    font-size: 14px;
  }

  .flow-step {
    font-size: 16px;
    padding: 11px 18px;
  }

  .flow-arrow {
    font-size: 24px;
  }
}

/* ===== Fakebook Icon ===== */

.fakebook-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #ffffff;
  color: #1877f2;
  border-radius: 10px;
  font-weight: 900;
  font-size: 24px !important;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
  transform: rotate(180deg) skewX(-8deg) !important;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.25),
    0 0 14px rgba(24, 119, 242, 0.45);
  text-shadow: none;
}

.nav a:hover .fakebook-icon {
  transform: rotate(180deg) skewX(-8deg) scale(1.08) !important;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(24, 119, 242, 0.65);
}

/* ===== Banner animations ===== */

@keyframes studioGlowPulse {
  0%, 100% {
    box-shadow:
      0 0 12px rgba(255, 200, 100, 0.18),
      inset 0 0 10px rgba(255, 200, 100, 0.08);
  }
  50% {
    box-shadow:
      0 0 26px rgba(255, 200, 100, 0.34),
      inset 0 0 14px rgba(255, 200, 100, 0.12);
  }
}

@keyframes studioLightSweep {
  0% {
    left: -42%;
  }
  100% {
    left: 120%;
  }
}

@keyframes studioArrowMove {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}
