/* Luminous XR branding: charcoal, slate panels, Luminous orange, Barlow */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("assets/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("assets/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("assets/fonts/barlow-600.woff2") format("woff2"); }

:root {
  --bg: #1c1e1f;
  --panel: #252a2f;
  --panel-hover: #2d3339;
  --text: #ffffff;
  --muted: #989ea0;
  --line: #3a4046;
  --accent: #ff3300;
  --accent-hover: #ff5226;
  --danger: #ff6b5b;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
  margin: 0;
  font: 400 16px/1.5 var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 32px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 18px; color: var(--text); text-decoration: none; min-width: 0; }
.brand img { height: 32px; width: auto; display: block; }
.brand .wordmark { font-weight: 500; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; }
.brand .divider { width: 1px; height: 28px; background: var(--line); }
.brand .section { font-weight: 500; font-size: 18px; color: var(--muted); white-space: nowrap; }

/* Page */
main { max-width: 1200px; margin: 0 auto; padding: 40px 32px 64px; }
.page-head { margin-bottom: 28px; }
.eyebrow {
  color: var(--accent); font-weight: 500; font-size: 14px;
  letter-spacing: .12em; text-transform: uppercase; margin: 0 0 6px;
}
.page-head h1 { margin: 0; font-weight: 500; font-size: 40px; line-height: 1.15; }
.empty {
  color: var(--muted); text-align: center; padding: 64px 16px;
  border: 1px dashed var(--line); border-radius: 12px;
}

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  background: var(--panel); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: background .15s;
}
.card:hover { background: var(--panel-hover); }
.card-img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-bottom: 3px solid var(--accent);
}
.card-body { flex: 1; padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; font-weight: 500; font-size: 21px; line-height: 1.25; word-break: break-word; }
.desc { margin: 0; color: var(--muted); font-size: 15px; white-space: pre-line; word-break: break-word; }
.meta { color: var(--muted); font-size: 14px; }
.card .row { display: flex; gap: 10px; margin-top: auto; padding-top: 14px; flex-wrap: wrap; }

/* Buttons: Luminous pill style */
.btn {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  padding: 9px 22px; border-radius: 26px; font: 500 14px/1.2 var(--font);
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  display: inline-block; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Dialog */
dialog {
  border: none; border-radius: 14px; padding: 0; width: min(480px, calc(100vw - 32px));
  background: var(--panel); color: var(--text);
  box-shadow: 0 24px 60px rgba(0,0,0,.5); border-top: 3px solid var(--accent);
}
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog form { padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { margin: 0 0 4px; font-weight: 500; font-size: 26px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
input[type=text] {
  font: 400 16px var(--font); color: var(--text); background: var(--bg);
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
}
input[type=file] { font: 400 15px var(--font); color: var(--text); text-transform: none; letter-spacing: 0; }
input[type=file]::file-selector-button {
  font: 500 13px var(--font); letter-spacing: .06em; text-transform: uppercase;
  background: transparent; color: var(--text); border: 1px solid var(--line);
  border-radius: 20px; padding: 7px 16px; margin-right: 12px; cursor: pointer;
}
input[type=file]::file-selector-button:hover { border-color: var(--muted); }
.hint { margin: -6px 0 0; color: var(--muted); font-size: 14px; }
.error { margin: 0; color: var(--danger); font-size: 15px; }
.progress { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Player page */
.player-body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.player-bar {
  display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--bg); border-bottom: 2px solid var(--accent);
}
.player-bar .brand img { height: 24px; }
.player-bar .brand .wordmark { font-size: 17px; }
.player-bar h1 {
  margin: 0; font-size: 18px; font-weight: 500; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-bar .btn { padding: 7px 18px; font-size: 13px; }
#frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* Header actions */
.header-actions { display: flex; gap: 10px; }

/* Login page */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(400px, 100%); background: var(--panel); border-radius: 14px;
  border-top: 3px solid var(--accent); padding: 32px 30px;
  display: flex; flex-direction: column; gap: 16px;
}
.login-logo { height: 34px; width: auto; align-self: flex-start; margin-bottom: 12px; }
.login-card .eyebrow { margin: 0; }
.login-card h1 { margin: -8px 0 4px; font-weight: 500; font-size: 32px; }
.login-card .btn { margin-top: 6px; padding: 12px 22px; }
.image-preview { display: flex; align-items: center; gap: 14px; margin-top: -4px; }
.image-preview img {
  width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px;
  border-bottom: 2px solid var(--accent); background: var(--bg); flex-shrink: 0;
}
label.checkbox {
  flex-direction: row; align-items: center; gap: 8px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--text);
}
label.checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }
textarea {
  font: 400 16px/1.4 var(--font); color: var(--text); background: var(--bg); resize: vertical;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  text-transform: none; letter-spacing: 0;
}
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=password] {
  font: 400 16px var(--font); color: var(--text); background: var(--bg);
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
}

@media (max-width: 640px) {
  .topbar { padding: 16px; flex-wrap: wrap; }
  .brand .divider, .brand .section { display: none; }
  main { padding: 28px 16px 48px; }
  .page-head h1 { font-size: 30px; }
  .player-bar .meta, .player-bar .brand { display: none; }
}

/* .btn sets display, so make the hidden attribute always win */
[hidden] { display: none !important; }
.back-link { color: var(--muted); text-decoration: none; font-size: 14px; text-align: center; }
.back-link:hover { color: var(--text); }
