@font-face {
  font-family: "Noto Sans SC";
  src: url("/fonts/NotoSansSC-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("/fonts/NotoSansSC-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DINish";
  src: url("/fonts/DINish-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #111318;
  --card: #1b1e27;
  --ink: #f4f1ea;
  --muted: #9aa0ae;
  --line: #2c3040;
  --gold: #f6c963;
  --accent: #f6c963;
  --danger: #ffb4a2;
  --ok: #9fe0b6;
  --shadow: 0 16px 40px rgba(0, 0, 0, .35);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #2a2418 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

header h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: .04em;
  margin: 0 0 6px;
  font-weight: 700;
}
header p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr);
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.drop {
  position: relative;
  border: 1.5px dashed #3a3f52;
  border-radius: 14px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  background: #14161d;
}
.drop:hover, .drop.dragover { border-color: var(--gold); color: var(--ink); }
.drop input { display: none; }
.drop .hint strong { color: var(--ink); font-weight: 700; }
.drop canvas, .drop img.preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #0c0d11;
}
.drop.has-image .hint { display: none; }

.stage {
  position: relative;
  width: 100%;
  background: #0c0d11;
  border-radius: 14px;
  overflow: hidden;
  min-height: 240px;
}
.stage canvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.stage .empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); pointer-events: none;
}

label.field {
  display: block;
  margin: 0 0 14px;
}
label.field span {
  display: block;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 6px;
}
input[type="text"], input[type="time"], input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #12141b;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
}
input:focus { outline: 2px solid var(--gold); border-color: transparent; }

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

.alert {
  display: none;
  background: #3a241f;
  color: var(--danger);
  border: 1px solid #5a332c;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
}
.alert.show { display: block; }
.alert.ok {
  background: #1b2a22;
  border-color: #2b4a38;
  color: var(--ok);
}

.meta-note {
  font-size: 12px;
  color: var(--muted);
  margin: -6px 0 14px;
  min-height: 1.2em;
}

details.more {
  margin: 6px 0 16px;
  color: var(--muted);
}
details.more summary { cursor: pointer; font-size: 13px; }
.sliders { padding-top: 10px; }
.sliders label { margin-bottom: 10px; }
.sliders input[type="range"] { width: 100%; accent-color: var(--gold); }
.sliders .val { float: right; color: var(--ink); }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
button, .btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button.primary, .btn.primary {
  background: var(--gold);
  color: #1a1408;
}
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

button.text-btn {
  display: none;
  margin: -8px 0 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
button.text-btn.show { display: inline-block; }

.film {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 12px;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}
.film-item, .film-add {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: #0c0d11;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.film-item img, .film-item canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.film-item.selected { border-color: var(--gold); }
.film-item .miss {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.film-add {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #3a3f52;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  font-weight: 400;
}
.film-add:hover { border-color: var(--gold); color: var(--ink); }

@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
  .wrap { width: min(1080px, calc(100% - 20px)); padding-top: 18px; }
}
