/* tierlist.css – Tier list rows, drag and drop and the selection bar */

.tier {
  display: flex;
  margin-bottom: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 92px;
}
.tl {
  width: 92px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  text-align: center;
  font: 700 18px/1.1 var(--sans);
  word-break: break-word;
}
.tl input[type="text"] {
  width: 100%;
  font: 13px var(--sans);
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  text-align: center;
  color: #111;
  background: #eee;
}
.tl input[type="color"] {
  width: 40px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
}
.tl .mv {
  display: flex;
  gap: 2px;
}
.tl .mv button {
  font-size: 11px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.7);
  color: #111;
}
.drop {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  align-content: flex-start;
}
.drop.over {
  background: var(--over);
}
/* Touch: holding a cover picks it up, so no "save image" menu. */
.ti {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}
.ti {
  position: relative;
  width: 68px;
  height: 102px;
  flex: none;
  cursor: grab;
  border-radius: 3px;
  transition: transform 0.12s;
  user-select: none;
  outline: none;
}
.ti img,
.ti .t {
  width: 100%;
  height: 100%;
  border-radius: 2px 4px 4px 2px;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 5px var(--cs);
  -webkit-user-drag: none;
}
.ti .t {
  background: var(--ph);
  color: var(--phInk);
  font-size: 9px;
  padding: 3px;
  overflow: hidden;
}
.ti:hover {
  transform: translateY(-2px);
}
.ti:focus-visible {
  box-shadow: 0 0 0 2px var(--acc);
}
.ti.sel {
  box-shadow:
    0 0 0 2px var(--acc),
    0 0 0 4px var(--bg);
}
.ti .ck {
  display: none;
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--accInk);
  font: 700 11px/18px var(--sans);
  text-align: center;
  font-style: normal;
  z-index: 2;
}
.ti.sel .ck {
  display: block;
}
.ti.placeholder {
  opacity: 0.3;
}
.ti.drop-before::before,
.ti.drop-after::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 4px;
  border-radius: 2px;
  background: var(--acc);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  z-index: 4;
}
.ti.drop-before::before {
  left: -5px;
}
.ti.drop-after::after {
  right: -5px;
}
.ti.ghost {
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6));
}
.ti.ghost.stack img,
.ti.ghost.stack .t {
  box-shadow:
    5px 5px 0 var(--edge),
    10px 10px 0 var(--line),
    0 1px 5px var(--cs);
}
.gcount {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--acc);
  color: var(--accInk);
  font: 700 12px/22px var(--sans);
  text-align: center;
  z-index: 3;
}
.tl.rowsel {
  cursor: pointer;
}
.selbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(94vw, 820px);
  padding: 8px 12px;
  background: var(--pan2);
  border: 1px solid var(--edge);
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--cs2);
  font-size: 13px;
}
.selbar[hidden] {
  display: none;
}
.selbar .tc {
  border: 0;
  border-radius: 6px;
  padding: 3px 10px;
  font-weight: 600;
  font-size: 12px;
}
.pool {
  margin-top: 18px;
}
.pool h3 {
  margin-bottom: 6px;
  font-size: 15px;
}
.pool .drop {
  border: 1px dashed var(--edge);
  border-radius: 8px;
  min-height: 92px;
}
@media (max-width: 760px) {
  .tl {
    width: 72px;
    font-size: 15px;
  }
}

/* ---- iPhone safe areas: keep clear of the status bar, camera cut-out and home bar ---- */
.selbar {
  bottom: calc(18px + env(safe-area-inset-bottom));
}
