/* ウロノロの公開画面。動画編集の画面になじむ、落ち着いた暗い基調 */
:root {
  --bg: #111215;
  --panel: #191b20;
  --panel-2: #21242a;
  --line: #2d3139;
  --text: #e6e7ea;
  --muted: #9298a3;
  --accent: #e3b04b;
  --accent-text: #1a1406;
  --error: #ff9b8f;
  --error-bg: #2b1715;
  --header: 52px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 system-ui, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
}

a {
  color: var(--muted);
}

a:hover {
  color: var(--text);
}

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

[hidden] {
  display: none !important;
}

.site {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.site-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  height: var(--header);
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tagline {
  color: var(--muted);
}

.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 12px;
}

/* 左に欄、右に確認用と購入のボタン。左だけを送り、確認用と購入のボタンはいつも見える */
.workspace {
  display: grid;
  grid-template-columns: 350px minmax(0, 960px);
  gap: 16px;
  justify-content: center;
  padding: 16px;
  flex: 1;
  min-height: 0;
}

.editor {
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field,
.slider {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.field-label,
.slider label,
.backdrops legend {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0;
}

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

textarea,
select,
input[type='number'] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

textarea {
  resize: vertical;
  font-size: 16px;
}

[aria-invalid='true'] {
  border-color: var(--error);
}

.field-errors {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 13px;
}

.field-errors p {
  margin: 0;
  white-space: pre-line;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}

/* 演出の一覧（見本つき） */
.effects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.effect-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.35;
}

.effect-card:hover {
  border-color: var(--muted);
}

.effect-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.effect-card:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.effect-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.effect-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  background: #000;
  object-fit: cover;
}

.colors,
.choices,
.backdrops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.color {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.color input {
  width: 32px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  background: none;
}

.choice {
  display: flex;
  align-items: center;
  gap: 4px;
}

.slider {
  display: grid;
  grid-template-columns: 1fr 52px;
  align-items: center;
  column-gap: 8px;
}

.slider label {
  grid-column: 1 / -1;
}

.slider input {
  width: 100%;
  accent-color: var(--accent);
}

.slider output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.seed {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

button {
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 6px 12px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  padding: 10px 22px;
}

button.secondary {
  padding: 10px 22px;
}

/* 確認用 */
.preview-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.player {
  position: relative;
  width: 100%;
  max-width: calc((100vh - var(--header) - 150px) * 16 / 9);
  background: #000;
  border: 1px solid var(--line);
}

.player-preparing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 18, 21, 0.72);
  color: var(--text);
  font-size: 15px;
}

.player-error {
  padding: 24px;
  color: var(--error);
  background: var(--error-bg);
  height: 100%;
  width: 100%;
}

.stage-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.backdrops {
  border: 0;
  margin: 0;
  padding: 0;
  align-items: center;
}

.backdrops legend {
  float: left;
  margin: 0 8px 0 0;
}

.stage-bar .hint {
  margin: 0;
}

.buy-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.buy-bar .hint {
  margin: 0 auto 0 0;
  font-size: 13px;
}

/* 最終確認 */
.confirm {
  flex: 1;
  min-height: 0;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 16px 16px 24px;
  overflow-y: auto;
}

.confirm h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.confirm h2 {
  font-size: 15px;
  margin: 18px 0 8px;
  color: var(--muted);
}

.lead {
  margin: 0;
}

.confirm-columns {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
}

.terms {
  margin: 0;
  border-top: 1px solid var(--line);
}

.terms div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.terms dt {
  color: var(--muted);
}

.terms dd {
  margin: 0;
  overflow-wrap: break-word;
}

.terms div.important {
  margin: 4px 0;
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
}

.terms .important dt,
.terms .important dd {
  color: var(--text);
  font-weight: 700;
}

.confirm .hint a {
  margin-right: 10px;
}

/* 確定のボタンは、条件を送って読む間も画面の下に留める */
.confirm-actions {
  position: sticky;
  bottom: -24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 14px -16px -24px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.confirm-actions .hint {
  margin: 0 auto 0 0;
  font-size: 13px;
}

.confirm-actions button {
  flex: none;
  white-space: nowrap;
}

.notice {
  margin: 0 auto 0 0;
  color: var(--accent);
}

/* 注文の画面 */
a.brand {
  color: inherit;
  text-decoration: none;
}

a.button {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.order .terms {
  max-width: 720px;
}

.order-status {
  max-width: 720px;
  margin: 12px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.order-status p {
  margin: 0 0 8px;
}

.order-status progress {
  width: 100%;
  height: 10px;
  accent-color: var(--accent);
}

.order-download .notice {
  margin: 8px 0 0;
}

.order-download .hint {
  margin: 8px 0 0;
}
