/* The wiki: an item's sheet, the edit form and the history. */

/* ITEM VIEW */
.item-view {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.item-poster {
  width: 124px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.item-standing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.item-standing span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-alt);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.item-standing .standing-rank {
  background: var(--purple);
  color: #fff;
}
.item-text {
  flex: 1;
  min-width: 0;
}
.item-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.edit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 14px 6px 11px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: hover) {
  .edit-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-border);
  }
}
.edit-pill:active {
  transform: translateY(0);
}
.history-link {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 18px 0 0 auto;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
@media (hover: hover) {
  .history-link:hover {
    color: var(--purple);
    text-decoration: underline;
  }
}
.item-synopsis {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.video-frame {
  position: relative;
  margin-top: 16px;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-file {
  display: block;
  width: 100%;
  margin-top: 16px;
  border-radius: 10px;
  background: #000;
}
.video-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--purple);
  font-weight: 600;
  text-decoration: none;
}
@media (hover: hover) {
  .video-link:hover {
    text-decoration: underline;
  }
}
/* Where a missing video would play: a button asking for its link. */
.video-missing {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--card-alt);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.video-missing:focus:not(:focus-visible) {
  outline: none;
}
.video-missing .icon {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}
.video-missing b {
  font-weight: 800;
  color: var(--text);
}
.video-missing span {
  color: var(--purple);
  font-weight: 750;
}
@media (hover: hover) {
  .video-missing:hover {
    border-color: var(--accent);
    color: var(--text-strong);
  }
}
.version-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.version-pill {
  padding: 6px 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.version-pill.version-on {
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 750;
}
.version-pills + .video-frame,
.version-pills + .video-file,
.version-pills + .video-link {
  margin-top: 10px;
}

/* FORM */
.item-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-field input[type="text"],
.form-field input[type="url"],
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 400;
}
.form-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.form-hint {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}
.form-hint a {
  color: var(--purple);
  font-weight: 600;
}
.version-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.form-field .version-row input.version-name {
  flex: 2;
  min-width: 0;
}
.form-field .version-row input.version-url {
  flex: 3;
  min-width: 0;
}
.version-act {
  flex: none;
  width: 24px;
  height: 36px;
  border: none;
  background: none;
  color: var(--purple);
  font-size: 18px;
  cursor: pointer;
}
.version-act:disabled {
  visibility: hidden;
}
.version-add {
  align-self: flex-start;
  padding: 6px 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.form-poster {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.form-poster-preview .poster,
.form-poster-preview .poster-ph {
  --pw: 72px;
  --ph: 102px;
  --pf: 24px;
}
.form-poster-inputs {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upload-button {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--purple);
  color: var(--purple);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}
@media (hover: hover) {
  .upload-button:hover {
    background: var(--card-selected);
  }
}
.upload-button input {
  display: none;
}
.form-error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
}

/* HISTORY */
.history {
  list-style: none;
  margin-top: 12px;
}
.history-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--card-alt);
}
.history-row:last-child {
  border-bottom: none;
}
.history-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-strong);
}
.history-byline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.history-changes {
  list-style: none;
  margin-top: 6px;
  font-size: 13px;
}
.history-changes li {
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.history-field {
  color: var(--text-muted);
  margin-right: 6px;
}
.history-changes del {
  color: var(--loss);
  margin-right: 6px;
}
.history-changes ins {
  color: var(--win);
  text-decoration: none;
}
.history-restore {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
@media (hover: hover) {
  .history-restore:hover {
    background: var(--card-alt);
  }
}

.form-field textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.history-changes del,
.history-changes ins {
  white-space: pre-line;
}
