/* Vice Panels — editor styling. Sunset / neon Vice palette, heavy system type for the UI.
   The bundled OFL display face (fonts/Montserrat-800.ttf) is loaded here so the canvas
   caption renderer can use it too; interface text itself uses the heavy system stack. */

@font-face {
  font-family: "Vice Display";
  src: url("./fonts/Montserrat-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #170a26;
  --ink-2: #241038;
  --panel: #2b1547;
  --panel-edge: #4b256e;
  --paper: #fdf3e3;
  --muted: #cdb8e8;
  --pink: #ff2e88;
  --orange: #ff9a3d;
  --gold: #ffd166;
  --teal: #22d3ee;
  --magenta: #e879f9;
  --heavy: "Arial Black", "Segoe UI Black", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--body);
  color: var(--paper);
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(232, 121, 249, 0.28), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(255, 46, 136, 0.30), transparent 55%),
    linear-gradient(165deg, #1d0b33 0%, #2b1042 46%, #43103f 78%, #6d1537 100%);
  background-attachment: fixed;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding: 20px 28px 6px;
}

.brand h1 {
  margin: 0; font-family: var(--heavy); font-weight: 900;
  font-size: clamp(30px, 4vw, 46px); letter-spacing: 0.04em;
  text-transform: uppercase; line-height: 0.95;
  color: var(--paper);
  text-shadow: 0 3px 0 rgba(23, 10, 38, 0.85), 0 10px 28px rgba(255, 46, 136, 0.45);
}
.brand h1 span {
  background: linear-gradient(92deg, var(--gold) 0%, var(--orange) 38%, var(--pink) 78%, var(--magenta) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand p { margin: 6px 0 0; color: var(--muted); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }

.status { margin: 0; max-width: 420px; text-align: right; color: var(--gold); font-size: 14px; min-height: 1.2em; }

/* ---------- workspace grid ---------- */

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 20px;
  padding: 14px 28px 8px;
  align-items: start;
}

.rail { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: linear-gradient(180deg, rgba(59, 27, 96, 0.92), rgba(36, 16, 56, 0.94));
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(10, 2, 20, 0.45);
}
.card h2 {
  margin: 0 0 10px; font-family: var(--heavy); font-weight: 900;
  font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
}
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.privacy { margin: 10px 0 0; color: var(--teal); font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.field input[type="text"] {
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  padding: 10px 12px; border: 2px solid var(--panel-edge); border-radius: 9px; background: var(--paper);
}
.field input[type="range"] { width: 100%; accent-color: var(--pink); }

/* ---------- photo library ---------- */

.upload-btn {
  display: block; text-align: center; cursor: pointer;
  font-family: var(--heavy); font-weight: 900; font-size: 14px; letter-spacing: 0.06em;
  padding: 11px 12px; border-radius: 10px; color: #fff;
  background: linear-gradient(92deg, var(--orange), var(--pink));
  box-shadow: 0 8px 20px rgba(255, 46, 136, 0.35);
}
.upload-btn:hover { filter: brightness(1.08); }

.library { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.thumb {
  position: relative; padding: 0; border: 3px solid transparent; border-radius: 10px;
  overflow: hidden; cursor: pointer; background: var(--ink-2); text-align: left;
}
.thumb img { display: block; width: 100%; height: 74px; object-fit: cover; }
.thumb span {
  display: block; padding: 5px 8px; font-size: 11.5px; font-weight: 700; color: var(--paper);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb:hover { border-color: var(--teal); }
.thumb.is-selected-photo { border-color: var(--gold); }
.thumb.is-in-use::after {
  content: "ON COVER"; position: absolute; top: 6px; left: 6px;
  font-size: 9px; font-weight: 900; letter-spacing: 0.08em;
  background: rgba(23, 10, 38, 0.85); color: var(--gold);
  padding: 3px 6px; border-radius: 5px;
}

/* ---------- choice chips and layout list ---------- */

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  padding: 8px 12px; border-radius: 999px;
  color: var(--paper); background: rgba(253, 243, 227, 0.10);
  border: 1.5px solid var(--panel-edge);
}
.chip:hover { border-color: var(--teal); }
.chip.is-active {
  color: var(--ink); border-color: transparent;
  background: linear-gradient(92deg, var(--gold), var(--orange));
}

.choice-list { display: flex; flex-direction: column; gap: 9px; }
.layout-btn {
  font: inherit; text-align: left; cursor: pointer; width: 100%;
  padding: 11px 13px; border-radius: 11px; color: var(--paper);
  background: rgba(253, 243, 227, 0.07); border: 1.5px solid var(--panel-edge);
}
.layout-btn strong { display: block; font-size: 14.5px; letter-spacing: 0.03em; }
.layout-btn small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.layout-btn:hover { border-color: var(--teal); }
.layout-btn.is-active { border-color: var(--gold); background: rgba(255, 209, 102, 0.13); }

/* ---------- stage ---------- */

.stage-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
#stage {
  max-width: 100%; max-height: 72vh; width: auto; height: auto;
  border-radius: 6px; cursor: grab; touch-action: none;
  box-shadow: 0 24px 60px rgba(5, 0, 12, 0.65), 0 0 0 1px rgba(255, 209, 102, 0.25);
  background: var(--ink);
}
#stage:active { cursor: grabbing; }
.stage-hint { margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- right rail ---------- */

.panel-info { margin: 0 0 10px; font-weight: 800; color: var(--paper); }
.button-row { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ghost-btn {
  font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  padding: 9px 12px; border-radius: 9px; color: var(--teal);
  background: transparent; border: 1.5px solid var(--teal);
}
.ghost-btn:hover { background: rgba(34, 211, 238, 0.12); }

.export-btn {
  width: 100%; margin-top: 14px; cursor: pointer;
  font-family: var(--heavy); font-weight: 900; font-size: 17px; letter-spacing: 0.05em;
  padding: 14px; border: 0; border-radius: 11px; color: #fff;
  background: linear-gradient(92deg, var(--pink) 0%, #ff5e3a 55%, var(--orange) 100%);
  box-shadow: 0 12px 28px rgba(255, 46, 136, 0.40);
}
.export-btn:hover { filter: brightness(1.09); }

.foot { padding: 6px 28px 22px; color: var(--muted); font-size: 12.5px; }
.foot p { margin: 0; }

/* ---------- screenshot modes ---------- */

body.shot-cover .topbar,
body.shot-cover .rail,
body.shot-cover .stage-hint,
body.shot-cover .foot { display: none; }
body.shot-cover .workspace { display: block; padding: 0; }
body.shot-cover .stage-wrap { padding: 0; }
body.shot-cover #stage {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  border-radius: 0; box-shadow: none; cursor: default;
}

body.shot-editor .workspace { grid-template-columns: 300px minmax(0, 1fr) 320px; }
body.shot-editor .topbar { padding-top: 10px; padding-bottom: 0; }
body.shot-editor .card { padding: 12px 14px; }
body.shot-editor #stage { max-height: 64vh; }
body.shot-editor .foot { display: none; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .status { text-align: left; }
  .topbar { flex-direction: column; align-items: flex-start; }
  #stage { max-height: 60vh; }
}
