@font-face {
  font-family: 'Inter var';
  src: url('/gov/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #08070a;
  --ink: #f2efe9;
  --ink-faint: rgba(242, 239, 233, 0.38);
  --brass: #c8a96a;
  --line: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 253, 250, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
}

body {
  font-family: 'Inter var', ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 40% at 50% -10%, rgba(200, 169, 106, 0.1), transparent 60%),
    var(--void);
}

button, textarea { font: inherit; color: inherit; }

.shell {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.models {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.models li { display: inline-flex; align-items: baseline; }

.models li:not(:last-child)::after {
  content: '|';
  margin: 0 0.55rem;
  color: var(--ink-faint);
}

.models button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
}

.models button.is-off { color: var(--ink-faint); }

textarea {
  display: block;
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
  outline: none;
}

textarea:focus { border-color: rgba(200, 169, 106, 0.7); }

.drop { margin-top: 0.75rem; }

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.drop.is-over #pick { border-color: var(--brass); }

#pick, #generate {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}

#generate {
  margin-top: 0;
  background: var(--brass);
  color: #1a1408;
  border-color: transparent;
  font-weight: 600;
}

#generate:disabled {
  opacity: 0.45;
  cursor: default;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.thumbs:empty { margin-top: 0; }

.thumb {
  width: 5.5rem;
  position: relative;
}

.thumb img, .thumb .chip {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #111;
}

.thumb button {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--ink);
  width: 1.3rem;
  height: 1.3rem;
  cursor: pointer;
}

.thumb .bar, .tile .bar {
  height: 3px;
  margin-top: 0.3rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.thumb .bar span, .tile .bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
}

.result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

#elapsed {
  margin: 0;
  color: var(--ink-faint);
}

.result-links {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.result-links a,
.retry {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.tile { min-width: 0; }

.caption {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  text-align: center;
  color: var(--ink-faint);
}

.retry {
  margin-top: 0.4rem;
  font: inherit;
}

.frame {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
}

.frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.sound {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.sound svg { width: 1.1rem; height: 1.1rem; display: block; }
.sound .icon-on { display: none; }
.sound.is-on .icon-off { display: none; }
.sound.is-on .icon-on { display: block; }

.pending {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.7rem;
}

.tile .bar { margin-top: 0; }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
