/* ============================================================
   AUTHORING — clue pictures & sounds, paste-a-board (editor only)
   Uses the design tokens from styles.css.
   ============================================================ */

/* ---------- Board cell marker ---------- */
.media-badge {
  position: absolute; right: 6px; bottom: 6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-size: 12px; line-height: 1; color: #2b1d00;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-radius: 6px; box-shadow: 0 2px 8px rgba(255, 199, 61, 0.35);
  pointer-events: none;
}
.media-badge.is-audio { font-size: 13px; }

/* ---------- Media field (cell dialog + Final tab) ---------- */
.media-field { position: relative; }
.media-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.media-label-row .label { margin-bottom: 6px; }
.media-hint { font-size: 12.5px; color: var(--faint); margin-bottom: 6px; }
.media-file-input { display: none; }

.media-empty {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px; border-radius: var(--r-sm);
  border: 1px dashed var(--line-strong); background: rgba(6, 7, 13, 0.35);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.media-note { font-size: 12.5px; color: var(--faint); }
.media-field.is-busy .media-empty, .media-field.is-busy .media-preview { opacity: 0.7; }
.media-field.is-drop-hot .media-empty,
.media-field.is-drop-hot .media-preview {
  border-color: var(--gold); border-style: dashed; background: rgba(255, 199, 61, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 199, 61, 0.18);
}

.media-preview {
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: rgba(6, 7, 13, 0.45); overflow: hidden;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.media-imgbox {
  display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(rgba(160, 172, 255, 0.07) 0 25%, transparent 0 50%) 0 0 / 18px 18px;
  min-height: 120px; max-height: 240px;
}
.media-img { display: block; max-width: 100%; max-height: 240px; object-fit: contain; }
.media-sound { display: flex; align-items: center; gap: 12px; padding: 14px 12px; }
.media-sound-glyph {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; color: #2b1d00;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
}
.media-audio { flex: 1; min-width: 0; width: 100%; height: 40px; }
.media-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-top: 1px solid var(--line);
}
.media-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13.5px; color: var(--muted);
}
.media-actions { display: flex; gap: 8px; flex: none; }
.media-error:not(:empty) {
  margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--bad);
  background: rgba(255, 85, 102, 0.08); border: 1px solid rgba(255, 85, 102, 0.35);
}

/* ---------- Paste a board ---------- */
.paste-modal { width: min(980px, 100%); }
.paste-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.paste-title h3 { margin-bottom: 0; }

.paste-layouts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.paste-layout {
  min-width: 0; /* let the example scroll instead of widening the dialog */
  padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: rgba(6, 7, 13, 0.35);
  transition: border-color 0.15s, background 0.15s;
}
.paste-layout.on { border-color: rgba(255, 199, 61, 0.55); background: rgba(255, 199, 61, 0.06); }
.paste-layout-name {
  font-family: var(--f-cond); font-weight: 800; font-size: 15px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink);
}
.paste-layout.on .paste-layout-name { color: var(--gold); }
.paste-layout-desc { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.paste-example {
  margin: 0; padding: 6px 8px; border-radius: 6px; overflow-x: auto;
  background: rgba(6, 7, 13, 0.6); color: var(--faint);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 12;
}

textarea.input.paste-input {
  min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.45; white-space: pre; overflow-wrap: normal; tab-size: 12;
}

.paste-summary:not(:empty) { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; color: var(--muted); }
.paste-summary strong { color: var(--ink); }

.paste-preview-scroll { overflow-x: auto; border-radius: var(--r-sm); }
.paste-preview {
  display: grid; grid-template-columns: repeat(6, minmax(112px, 1fr)); gap: 5px; min-width: 690px;
}
.paste-head {
  padding: 7px 6px; border-radius: 6px; text-align: center;
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--line);
  font-family: var(--f-cond); font-weight: 800; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
}
.paste-head.is-new { color: var(--gold); border-color: rgba(255, 199, 61, 0.45); }
.paste-cell {
  position: relative; min-height: 64px; padding: 5px 7px; border-radius: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(17, 28, 142, 0.22); border: 1px dashed rgba(74, 99, 255, 0.35);
  font-size: 11.5px; line-height: 1.3;
}
.paste-cell.is-new {
  background: linear-gradient(165deg, var(--tile-md), var(--tile-lo)); border: 1px solid rgba(74, 99, 255, 0.55);
}
.paste-cell.is-warn { border-color: rgba(255, 85, 102, 0.7); }
.paste-val { font-family: var(--f-cond); font-weight: 800; font-size: 13px; color: var(--gold); }
.paste-prompt {
  font-family: var(--f-serif); color: rgba(245, 242, 233, 0.9);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.paste-resp { color: var(--ok); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paste-cell.is-warn .paste-resp { color: var(--bad); font-style: italic; }
.paste-same { color: var(--faint); font-style: italic; }
.paste-cell.has-media { padding-right: 22px; }
.paste-cell .media-badge { right: 4px; bottom: 4px; min-width: 16px; height: 16px; font-size: 10px; }

.paste-problems:not(:empty) {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(255, 85, 102, 0.07); border: 1px solid rgba(255, 85, 102, 0.3);
}
.paste-problems-head { font-family: var(--f-cond); font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bad); margin-bottom: 4px; }
.paste-problems ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.paste-problems li { margin: 2px 0; }

.paste-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 14px; cursor: pointer; }
.paste-check input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; flex: none; }

.paste-actions { align-items: center; flex-wrap: wrap; }
.paste-copy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-right: auto; min-width: 0; }
.paste-copy-note { font-size: 13px; color: var(--ok); }
.paste-copy-note.is-err { color: var(--bad); }

@media (max-width: 640px) {
  .paste-layouts { grid-template-columns: 1fr; }
  .paste-copy { width: 100%; }
  .media-bar { flex-wrap: wrap; }
  .media-actions { margin-left: auto; }
}
