:root {
  --bg: #0e0b1c;
  --panel: #1d1733;
  --panel-2: #262041;
  --border: #3a3350;
  --text: #f3ecdc;
  --muted: #a79fb8;
  --accent: #e8604a;
  --accent-hover: #f0755f;
  --danger-bg: #5a1f1f;
  --danger-text: #ffb4a6;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--text); }
a:hover { color: var(--accent-hover); }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

main.container { flex: 1; padding-top: 32px; padding-bottom: 32px; }

/* Header and footer */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.developer { font-size: 13px; color: var(--muted); }
.developer a { color: var(--text); font-weight: 600; }
.developer a:hover { color: var(--accent-hover); }
.version {
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.site-footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Cards and text */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:focus-visible,
.dropzone:focus-within { outline: 3px solid #ffb199; outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; background: var(--accent); }
.btn-secondary { background: var(--panel-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

/* Upload form: drop zone replaces the browser's default file input */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 220px;
  padding: 32px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover,
.dropzone.is-dragover { border-color: var(--accent); background: #17122a; }
.dz-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  font-size: 24px;
  margin-bottom: 8px;
}
.dz-title { font-size: 17px; font-weight: 600; }
.dz-sub { color: var(--muted); font-size: 14px; }
.dz-selected .dz-sub { color: var(--text); }
.upload-actions { margin-top: 20px; display: flex; justify-content: flex-end; }

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
}
.alert-error { background: var(--danger-bg); color: var(--danger-text); }

/* Export page */
.page-title { word-break: break-word; }
.frame-wrap {
  width: min(100%, 1280px);
  aspect-ratio: 16 / 9;
  margin: 20px 0;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.progress {
  width: min(100%, 1280px);
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 16px;
}
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.status { margin-top: 10px; min-height: 22px; }
.status.error { color: var(--danger-text); }
.secondary-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .card { padding: 20px; }
  h1 { font-size: 22px; }
  .dropzone { min-height: 180px; }
}
