/* Campaign picker — "Your worlds". */

.wf-picker {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 56px 0;
  min-height: 0;
}

.wf-picker-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 40px;
  animation: wf-fade 700ms ease both;
}
.wf-picker-head .wf-spacer { flex: 1; }

.wf-picker-user {
  font-family: var(--fm);
  font-size: 12px;
  text-transform: lowercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}
.wf-picker-user a { color: var(--ink-dim); margin-left: 12px; }
.wf-picker-user a:hover { color: var(--acc); }

.wf-picker-title {
  animation: wf-rise 900ms var(--ease) 80ms both;
}
.wf-picker-rule { margin: 22px 0 0; animation-delay: 200ms; }

.wf-picker-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -12px;
  padding: 0 12px 40px;
}

/* ── a world ────────────────────────────────────────────────────────────── */

.wf-world {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 26px;
  width: 100%;
  /* right gutter reserves room for the delete control */
  padding: 28px 46px 28px 4px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  cursor: pointer;
  transition: background 340ms var(--ease), padding-left 340ms var(--ease);
  animation: wf-rise 700ms var(--ease) both;
}
.wf-world:hover {
  background: rgba(255, 255, 255, 0.045);
  padding-left: 18px;
}

/* Each world's genre art glows in from the right edge of its row — the same
   shipped backdrops the play screen uses, so the picker reads as a shelf of
   worlds rather than a file list. Text stays above it. */
.wf-world > * { position: relative; z-index: 1; }
.wf-world-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 30%;
  opacity: 0.14;
  -webkit-mask-image: linear-gradient(90deg, transparent 6%, rgba(0, 0, 0, 0.75) 55%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 6%, rgba(0, 0, 0, 0.75) 55%, #000 100%);
  transition: opacity 420ms var(--ease), transform 1200ms var(--ease);
  pointer-events: none;
}
.wf-world:hover .wf-world-art { opacity: 0.32; transform: scale(1.025); }

.wf-world-main { display: block; min-width: 0; }

.wf-world-name {
  display: block;
  font-family: var(--fh);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-world-sub {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 300;
  font-style: italic;
  color: var(--ink-dim);
}

.wf-world-pills { display: flex; gap: 8px; }

/* Each world previews its own palette in the list, so the picker doubles as
   a legend for the genre system. --row-acc is set per row by the page script. */
.wf-pill--genre {
  color: var(--row-acc, var(--acc));
  border-color: color-mix(in srgb, var(--row-acc, var(--acc)) 55%, transparent);
}

.wf-world-meta {
  font-family: var(--fm);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.wf-world-over {
  color: color-mix(in srgb, #c2413f 80%, var(--ink-faint));
}

/* Delete stays available but never competes with the world's name. */
/* Inside the row, not outside it. Sitting at a negative offset put this
   beyond the scroll container's padding, where it was clipped away entirely. */
.wf-world-del {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  z-index: 2;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--bd-ctl);
  background: transparent;
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  /* faint but present, so it can be found without hunting for it */
  opacity: 1;
  transition: opacity 240ms var(--ease), color 240ms var(--ease),
              border-color 240ms var(--ease);
}
.wf-world-row:hover .wf-world-del { opacity: 1; }
.wf-world-del:hover { color: #c2413f; border-color: #c2413f; }
.wf-world-del:focus-visible { opacity: 1; outline: 1px solid var(--acc); outline-offset: 2px; }

.wf-world-row { position: relative; }

/* ── empty ──────────────────────────────────────────────────────────────── */

.wf-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  padding: 70px 0;
  animation: wf-rise 800ms var(--ease) 200ms both;
}
.wf-empty-line {
  max-width: 44ch;
  margin: 0;
  font-size: 19px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* ── phones ─────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .wf-picker { padding: 18px 18px 0; }
  .wf-picker-head { flex-wrap: wrap; gap: 10px 14px; padding-bottom: 22px; }
  .wf-world {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 20px 40px 20px 4px;
  }
  .wf-world-name { font-size: 24px; white-space: normal; }
  .wf-world-sub { font-size: 14px; }
  .wf-world-pills { flex-wrap: wrap; }
  .wf-world-meta { white-space: normal; }
  /* No hover on touch — the delete control stays findable. */
  .wf-world-del { opacity: 1;
  color: var(--ink-dim);
}
}

.wf-pill--litrpg { background: #ffc440; color: #1d1406; border-color: #ffc440; font-weight: 700; letter-spacing: .08em; }

/* the title row: "Your worlds" and the gold New world button (owner, 25 Nov) */
.wf-picker-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.wf-picker-titlebar .wf-picker-title { margin-bottom: 0; }
.wf-picker-titlebar .wf-btn { margin-bottom: 10px; flex: none; }
.wf-picker-head { position: relative; z-index: 30; }
@media (max-width: 560px) {
  .wf-picker-titlebar { flex-wrap: wrap; gap: 4px 16px; align-items: flex-start; }
  .wf-picker-titlebar .wf-btn { margin: 0 0 14px; padding: 12px 18px; }
}
