@font-face {
  font-family: "FBCaption";
  src: url("Fonts/American Purpose STRIPE 1 Normal.ttf") format("truetype");
  font-display: block;
}

:root {
  --bg: #141519;
  --panel: #1c1d22;
  --line: #2c2e35;
  --text: #ecebe8;
  --muted: #9a9ba3;
  --accent: #ff8a1f;
  --accent-ink: #1a1206;
  --warn: #ffcf5a;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.app {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  min-height: 100vh;
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2, .h2 {
  display: block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  background: #000;
  cursor: pointer;
  aspect-ratio: 1395 / 2000;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { transform: translateY(-2px); }
.thumb[aria-checked="true"] { border-color: var(--accent); }
.thumb:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111215;
  color: var(--text);
  font: 600 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-transform: uppercase;
}
textarea:focus { outline: none; border-color: var(--accent); }

.help { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--warn);
  min-height: 1.45em;
}
.hint:empty { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

button.primary, button.secondary {
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
}
button.primary { background: var(--accent); color: var(--accent-ink); border: 0; }
button.primary:hover { filter: brightness(1.08); }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.secondary:hover { border-color: var(--muted); }
button:disabled { opacity: 0.5; cursor: default; }

.meta { margin: auto 0 0; font-size: 12px; color: var(--muted); }

.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-width: 0;
}

#poster {
  display: block;
  height: auto;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  aspect-ratio: 1395 / 2000;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  background: #000;
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage { padding: 16px; }
  #poster { max-height: none; width: 100%; }
}
