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

:root {
  --bg-main: #06070a;
  --bg-card: #0d0f15;
  --bg-elevated: #13161f;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.24);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent-white: #ffffff;
  --success: #10b981;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: rgba(56, 66, 92, 0.16);
}

.orb-2 {
  width: 480px;
  height: 480px;
  bottom: -150px;
  right: -100px;
  background: rgba(42, 46, 62, 0.18);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.88;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(145deg, #1a1d28, #0f1118);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-badge {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  color: #d1d5db;
}

/* Converter Input Section */
.converter-panel {
  background: linear-gradient(180deg, rgba(19, 22, 31, 0.85) 0%, rgba(12, 14, 20, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 15px 42px 15px 48px;
  border-radius: 14px;
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: #ffffff;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-wrap input:focus {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.input-wrap input::placeholder {
  color: #6b7280;
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #9ca3af;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.primary-btn {
  padding: 0 26px;
  border-radius: 14px;
  background: #ffffff;
  color: #090a0f;
  font-size: 14.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.14s ease, opacity 0.14s ease;
}

.primary-btn:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.primary-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2.2px solid rgba(9, 10, 15, 0.25);
  border-top-color: #090a0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Quick Samples */
.quick-samples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.samples-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d1d5db;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sample-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.error-alert {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 13.5px;
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.22fr 1fr;
  gap: 22px;
  align-items: start;
}

.preview-column, .share-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.panel-box.highlight-border {
  border-color: rgba(255, 255, 255, 0.15);
}

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

.panel-header h2 {
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
}

.subtle-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 999px;
}

.ready-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Style Selector (2x2 Grid for 4 Layouts) */
.style-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.style-option {
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 12px;
  text-align: left;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.style-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #101219;
}

.style-option.active {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.style-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-top: 2px;
  flex-shrink: 0;
}

.obsidian-dot {
  background: linear-gradient(135deg, #2b3245, #0f1117);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.fb-dot {
  background: linear-gradient(135deg, #18181f, #060608);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.float-dot {
  background: linear-gradient(135deg, #232736, #11131a);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.float-blur-dot {
  background: radial-gradient(circle at 30% 30%, rgba(156, 163, 175, 0.55), rgba(15, 17, 25, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.18);
}

.style-option strong {
  display: block;
  font-size: 13px;
  color: #ffffff;
}

.style-option span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

/* Typography Controls: 3 Independent Rows (Track Title, Artist, Badge & Timestamps) */
.typo-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.typo-row {
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.typo-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.typo-row-head label {
  font-size: 12px;
  font-weight: 700;
  color: #e5e7eb;
  letter-spacing: 0.2px;
}

.font-size-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.typo-row-controls {
  display: grid;
  grid-template-columns: minmax(170px, 1.15fr) 1fr auto;
  align-items: center;
  gap: 12px;
}

.typo-select {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  background: #11131b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.typo-select:hover,
.typo-select:focus {
  border-color: rgba(255, 255, 255, 0.32);
}

.typo-select option {
  background: #0d0f15;
  color: #ffffff;
}

.typo-slider {
  width: 100%;
  accent-color: #ffffff;
  cursor: pointer;
  height: 5px;
}

.size-presets {
  display: flex;
  gap: 4px;
}

.size-preset-btn {
  width: 28px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.size-preset-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.size-preset-btn.active {
  background: #ffffff;
  color: #08090d;
  border-color: #ffffff;
}

/* Preview Tabs Bar */
.preview-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.preview-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preview-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preview-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.preview-tab.active {
  background: #ffffff;
  color: #08090d;
}

.source-pill {
  font-size: 12px;
  font-weight: 600;
  color: #e5e7eb;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.15s ease;
}

.source-pill:hover {
  background: rgba(255, 255, 255, 0.15);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.live-frame-container {
  background: #08090c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#liveEmbedFrame {
  width: 100%;
  height: 270px;
  border: none;
  overflow: hidden;
  display: block;
}

.interaction-hint {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.interaction-hint strong {
  color: #e5e7eb;
}

/* Facebrowser Post Simulator (Matching Screenshot 3: face-tr.gta.world) */
.fb-mock-post {
  background: #141519;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 16px;
}

.fb-mock-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.fb-mock-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d3242, #15171e);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.fb-mock-user {
  flex: 1;
}

.fb-mock-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #f3f4f6;
}

.fb-gold {
  color: #facc15;
  font-size: 12px;
}

.fb-action {
  font-weight: 400;
  color: #9ca3af;
}

.fb-mock-date {
  font-size: 11.5px;
  color: #6b7280;
  margin-top: 2px;
}

.fb-mock-dots {
  color: #6b7280;
  font-size: 13px;
}

.fb-mock-caption {
  margin-bottom: 12px;
  font-size: 13.5px;
}

.fb-mock-caption a {
  color: #93c5fd;
  text-decoration: none;
  word-break: break-all;
}

.fb-mock-caption a:hover {
  text-decoration: underline;
}

.fb-mock-card-holder {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #08090c;
}

.fb-mock-card-holder img {
  width: 100%;
  height: auto;
  display: block;
}

/* Discord Embed Simulator */
.dc-mock-msg {
  background: #313338;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 14px;
  font-family: 'gg sans', 'Segoe UI', sans-serif;
}

.dc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1e1f22;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

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

.dc-user-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.dc-username {
  font-size: 14.5px;
  font-weight: 600;
  color: #f2f3f5;
}

.dc-time {
  font-size: 11.5px;
  color: #949ba4;
}

.dc-link {
  font-size: 13.5px;
  color: #00a8fc;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
  word-break: break-all;
}

.dc-embed-card {
  background: #2b2d31;
  border-left: 4px solid #0b0c10;
  border-radius: 4px;
  padding: 12px 14px;
  max-width: 520px;
}

.dc-embed-title {
  font-size: 15px;
  font-weight: 700;
  color: #00a8fc;
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}

.dc-embed-title:hover {
  text-decoration: underline;
}

.dc-embed-desc {
  font-size: 13px;
  color: #dbdee1;
  margin-bottom: 10px;
}

.dc-embed-img-wrap {
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

.dc-embed-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Share Links Panel */
.share-links-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-item {
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-item-top label {
  font-size: 13px;
  font-weight: 700;
  color: #f3f4f6;
}

.tag-recommend {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.tag-subtle {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.share-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

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

.copy-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  background: #10121a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  outline: none;
}

.copy-btn {
  padding: 10px 15px;
  border-radius: 10px;
  background: #ffffff;
  color: #08090d;
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.copy-btn:hover {
  background: #e5e7eb;
}

.icon-link-btn, .download-btn {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.icon-link-btn:hover, .download-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Customizer Form */
.customizer-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-action-btn {
  background: none;
  border: none;
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.text-action-btn:hover {
  text-decoration: underline;
}

.field-group input[type="text"] {
  padding: 10px 12px;
  border-radius: 10px;
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  outline: none;
}

.field-group input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-wrap input[type="color"] {
  width: 44px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #08090d;
  cursor: pointer;
  padding: 2px;
}

.mini-dark-btn {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  background: #08090d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d1d5db;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mini-dark-btn:hover {
  background: #151720;
  color: #ffffff;
}

.secondary-btn {
  margin-top: 4px;
  padding: 11px 16px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* History Section */
.history-section {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title-row h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.history-card:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.history-card img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-artist {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.34);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: #ffffff;
  color: #08090d;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .style-selector {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .url-form {
    flex-direction: column;
  }
  .primary-btn {
    padding: 14px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .typo-row-controls {
    grid-template-columns: 1fr;
  }
}

