:root {
  --bg: #0e1020;
  --bg-card: #1a1d33;
  --bg-card-hover: #21254180;
  --text: #eef0ff;
  --text-dim: #9aa0c0;
  --border: #2b2f4e;

  --common: #9aa0b5;
  --uncommon: #4caf50;
  --rare: #3d8bff;
  --legendary: #b061ff;
  --mythical: #ff5f6d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b1f3a, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.site-header {
  text-align: center;
  padding: 2.4rem 1rem 1.2rem;
}
.site-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.5px;
}
.subtitle {
  margin: 0.4rem 0 0;
  color: var(--text-dim);
}

.version-toggle {
  margin-top: 1rem;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--legendary);
  background: linear-gradient(135deg, #b061ff, #6a2fd0);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(176, 97, 255, 0.35);
}
.version-toggle:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(176, 97, 255, 0.5); }

.header-buttons {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Black Trade button */
.trade-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid #000;
  background: #0a0a0f;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.trade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.8);
  border-color: #7ee0c0;
}

/* When viewing the original list, tint the page so it's clearly the old version */
body.old-mode {
  background: radial-gradient(1200px 600px at 50% -10%, #2a241b, #16130e);
}
body.old-mode .version-toggle {
  border-color: #d8a23a;
  background: linear-gradient(135deg, #d8a23a, #9c6f1d);
  box-shadow: 0 4px 16px rgba(216, 162, 58, 0.35);
}
body.old-mode .site-header h1::after {
  content: " (Original)";
  font-size: 0.5em;
  color: #d8a23a;
  vertical-align: middle;
}

.controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
}

#search {
  flex: 1 1 260px;
  max-width: 420px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
}
#search::placeholder { color: var(--text-dim); }
#search:focus { outline: 2px solid var(--legendary); }

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.chip {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--text-dim); }
.chip.active { color: #0e1020; font-weight: 600; }
.chip-common.active    { background: var(--common);    border-color: var(--common); }
.chip-uncommon.active  { background: var(--uncommon);  border-color: var(--uncommon); }
.chip-rare.active      { background: var(--rare);      border-color: var(--rare); }
.chip-legendary.active { background: var(--legendary); border-color: var(--legendary); }
.chip-mythical.active  { background: var(--mythical);  border-color: var(--mythical); }

.sort-label {
  color: var(--text-dim);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#sort {
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
}

.result-count {
  max-width: 1100px;
  margin: 1rem auto 0;
  padding: 0 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.grid {
  max-width: 1100px;
  margin: 0.6rem auto 2rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 0.9rem;
}

/* Horizontal card: image on the LEFT, info on the right */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--legendary);
}

/* Icon tile (left side) holding the real fruit image */
.fruit-icon {
  position: relative;
  flex: 0 0 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
}
.fruit-img {
  width: 100%;
  height: 100%;
  max-height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}
.fruit-icon .emoji {
  font-size: 3.2rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}
.icon-common    { background: radial-gradient(circle at 50% 45%, #3a3f55, #1a1d33); }
.icon-uncommon  { background: radial-gradient(circle at 50% 45%, #1f5a2c, #15261a); }
.icon-rare      { background: radial-gradient(circle at 50% 45%, #1c3f7a, #14203a); }
.icon-legendary { background: radial-gradient(circle at 50% 45%, #4a2080, #221440); }
.icon-mythical  { background: radial-gradient(circle at 50% 45%, #7a2030, #2a1420); }

.card-body {
  flex: 1 1 auto;
  padding: 0.8rem 1rem 0.85rem;
  min-width: 0;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.fruit-name {
  margin: 0;
  font-size: 1.15rem;
}
.fruit-type {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.values {
  margin: 0.7rem 0 0;
  display: grid;
  gap: 0.3rem;
}
.value-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.value-row dt {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}
.value-row dd { margin: 0; font-weight: 700; }
.value-row .money { color: #ffd86b; }
.value-row .trade { color: #7ee0c0; }

.badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  color: #0e1020;
  white-space: nowrap;
}
.badge-common    { background: var(--common); }
.badge-uncommon  { background: var(--uncommon); }
.badge-rare      { background: var(--rare); }
.badge-legendary { background: var(--legendary); }
.badge-mythical  { background: var(--mythical); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 2rem 0;
}

.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 1rem 1.5rem 2.5rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --------------------------- Trade calculator (full page) --------------------------- */
.trade-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
}
.trade-overlay[hidden] { display: none; }

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

.trade-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.trade-head h2 { margin: 0; font-size: 1.4rem; }

.trade-back {
  background: #0a0a0f;
  border: 1px solid #000;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
.trade-back:hover { border-color: var(--mythical); }

/* Middle area (sides + verdict), scrolls if needed */
.trade-main {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1.4rem 1rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.trade-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
}
.trade-side { min-width: 0; }
.side-title {
  margin: 0 0 0.7rem;
  text-align: center;
  font-size: 1.05rem;
  padding: 0.45rem;
  border-radius: 8px;
}
.side-title.you { background: rgba(126, 224, 192, 0.15); color: #7ee0c0; }
.side-title.them { background: rgba(255, 95, 109, 0.15); color: #ff8a93; }

.slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--border);
  background: #14172b;
  border-radius: 12px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.4rem;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
}
.slot.filled { border-style: solid; background: #1b1f3a; }
.slot.drag-over {
  border-color: var(--legendary);
  background: #251b40;
  transform: scale(1.04);
}
.slot-plus { font-size: 2rem; line-height: 1; }
.slot-hint { font-size: 0.72rem; }
.slot-icon img { width: 60px; height: 60px; object-fit: contain; pointer-events: none; }
.slot-emoji { font-size: 2.2rem; }
.slot-name { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.slot-val { font-size: 0.74rem; color: #7ee0c0; font-weight: 700; }
.slot-remove {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 0.7rem;
  color: var(--mythical);
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.slot-remove:hover { background: var(--mythical); color: #fff; }

.trade-vs { font-size: 1.8rem; color: var(--text-dim); text-align: center; }

.side-total {
  text-align: center;
  margin: 0.8rem 0 0;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.side-total span { color: #ffd86b; font-weight: 700; }

.trade-verdict {
  margin: 1.4rem auto 0;
  max-width: 640px;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.trade-verdict.neutral { background: #14172b; color: var(--text-dim); }
.trade-verdict.win  { background: rgba(76, 175, 80, 0.18); color: #7ee08a; border: 1px solid #4caf50; }
.trade-verdict.lose { background: rgba(255, 95, 109, 0.18); color: #ff8a93; border: 1px solid var(--mythical); }
.trade-verdict.fair { background: rgba(255, 216, 107, 0.16); color: #ffd86b; border: 1px solid #ffd86b; }

/* Bottom draggable fruit tray */
.trade-tray {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0.7rem 1rem 1rem;
}
.tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.tray-label { color: var(--text-dim); font-size: 0.9rem; font-weight: 700; }
#tray-search {
  flex: 0 1 260px;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #14172b;
  color: var(--text);
}
.tray-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 104px;
  grid-template-rows: 1fr;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}
.tray-item {
  background: #14172b;
  border: 1px solid var(--border);
  border-bottom-width: 4px;
  border-radius: 10px;
  padding: 0.5rem 0.3rem;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--text);
  user-select: none;
}
.tray-item:hover { transform: translateY(-3px); border-color: var(--legendary); }
.tray-item:active { cursor: grabbing; }
.tray-item.dragging { opacity: 0.4; }
.tray-icon img { width: 50px; height: 50px; object-fit: contain; pointer-events: none; }
.tray-icon .slot-emoji { font-size: 1.9rem; }
.tray-name { font-size: 0.78rem; font-weight: 700; }
.tray-val { font-size: 0.7rem; color: #7ee0c0; font-weight: 700; }
.tray-item.rar-common    { border-bottom-color: var(--common); }
.tray-item.rar-uncommon  { border-bottom-color: var(--uncommon); }
.tray-item.rar-rare      { border-bottom-color: var(--rare); }
.tray-item.rar-legendary { border-bottom-color: var(--legendary); }
.tray-item.rar-mythical  { border-bottom-color: var(--mythical); }

@media (max-width: 560px) {
  .trade-sides { grid-template-columns: 1fr; }
  .trade-vs { transform: rotate(90deg); }
}

/* Purple Story button */
.book-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid #c9962f;
  background: linear-gradient(135deg, #6b4e1f, #3a2a10);
  color: #ffe9b8;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(201, 150, 47, 0.3);
}
.book-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(201, 150, 47, 0.5); }

/* ------------------------------- Story book ------------------------------- */
.book-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 12, 0.82);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
}
.book-overlay[hidden] { display: none; }

.book {
  position: relative;
  width: min(620px, 100%);
  background: #2a1d12;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  border: 1px solid #4a3520;
}
.book::before {
  /* book spine on the left */
  content: "";
  position: absolute;
  left: 1rem;
  top: 1rem;
  bottom: 4.2rem;
  width: 14px;
  background: linear-gradient(90deg, #1c130b, #4a3520);
  border-radius: 6px 0 0 6px;
}

.book-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #4a3520;
  background: #1c130b;
  color: #ffe9b8;
  cursor: pointer;
}
.book-close:hover { border-color: #c9962f; }

.book-page {
  background: #f6ecd6;
  background-image: radial-gradient(circle at 0 0, rgba(120, 90, 50, 0.08), transparent 60%);
  color: #3a2a18;
  border-radius: 8px;
  padding: 2rem 2.2rem 2.4rem 2.6rem;
  min-height: 380px;
  position: relative;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: inset 0 0 40px rgba(120, 90, 50, 0.18);
}
.book-page.turn { animation: pageturn 0.35s ease; }
@keyframes pageturn {
  from { opacity: 0; transform: rotateY(-12deg) translateX(14px); }
  to   { opacity: 1; transform: none; }
}

.book-emoji { font-size: 3rem; text-align: center; margin-bottom: 0.4rem; }
.book-title {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1.6rem;
  color: #6b3410;
  border-bottom: 2px solid #c9a86a;
  padding-bottom: 0.6rem;
}
.book-text { font-size: 1.08rem; line-height: 1.7; }
.book-text p { margin: 0 0 0.8rem; }
.book-text p:first-of-type::first-letter {
  font-size: 2.6rem;
  font-weight: bold;
  float: left;
  line-height: 0.8;
  padding: 0.1rem 0.5rem 0 0;
  color: #6b3410;
}
.book-pageno {
  position: absolute;
  bottom: 0.9rem;
  right: 1.4rem;
  font-size: 0.85rem;
  color: #8a6a42;
}

.book-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.9rem;
  padding: 0 0.4rem;
}
.book-arrow {
  background: #1c130b;
  border: 1px solid #4a3520;
  color: #ffe9b8;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
.book-arrow:hover:not(:disabled) { border-color: #c9962f; transform: translateY(-1px); }
.book-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.book-indicator { color: #ffe9b8; font-size: 0.9rem; }

@media (max-width: 480px) {
  .book-page { padding: 1.4rem 1.2rem 2rem 1.6rem; min-height: 340px; }
  .book-title { font-size: 1.3rem; }
}

/* Soft breezes drifting from the book edges (pages 4–15 only) */
.book-page { overflow: hidden; }
.book-breeze {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
  z-index: 3;
}
.book.breezy .book-breeze { display: block; }

/* Static light-blue breeze in the TOP-RIGHT edge (no movement, no fading) */
.breeze { display: none; }

/* The visible top-right breeze */
.breeze:nth-child(1) {
  display: block;
  position: absolute;
  top: -90px;
  right: -90px;
  left: auto;
  width: 360px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(ellipse at top right, rgba(150, 205, 255, 0.85), rgba(173, 216, 255, 0.35) 45%, rgba(173, 216, 255, 0) 72%);
  filter: blur(12px);
  opacity: 1;
}

/* Tier List button */
.tier-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid #3d8bff;
  background: linear-gradient(135deg, #2d6fd0, #1c3f7a);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(61, 139, 255, 0.3);
}
.tier-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(61, 139, 255, 0.5); }

/* ------------------------------- Tier list ------------------------------- */
.tier-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 55;
  overflow: auto;
}
.tier-overlay[hidden] { display: none; }

.tier-page { min-height: 100%; display: flex; flex-direction: column; }

.tier-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.tier-name-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.tier-name-input {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #14172b;
  color: var(--text);
  font-size: 0.9rem;
  width: 160px;
}
.tier-name-input:focus { outline: 2px solid #3d8bff; }

.tier-rows {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.tier-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  min-height: 86px;
}
.tier-label {
  flex: 0 0 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: #1a1209;
  border-radius: 10px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.tier-S { background: #ff7676; }
.tier-A { background: #ff9f5a; }
.tier-B { background: #ffd45a; }
.tier-C { background: #f6ee5a; }
.tier-D { background: #9be35a; }
.tier-F { background: #8fb7e0; }

.tier-drop {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.4rem;
  padding: 0.45rem;
  background: #14172b;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.tier-drop.drag-over { background: #1f2440; border-color: #3d8bff; }

.tier-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  width: 78px;
  padding: 0.35rem 0.25rem;
  background: #1b1f3a;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: grab;
  user-select: none;
}
.tier-chip:hover { border-color: var(--legendary); transform: translateY(-2px); }
.tier-chip:active { cursor: grabbing; }
.tier-chip.dragging { opacity: 0.4; }
.tier-chip img { width: 42px; height: 42px; object-fit: contain; pointer-events: none; }
.tier-chip .slot-emoji { font-size: 1.7rem; }
.chip-name { font-size: 0.68rem; font-weight: 700; text-align: center; }

.tier-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0 1rem 1.4rem;
}

@media (max-width: 560px) {
  .tier-label { flex-basis: 54px; font-size: 1.4rem; }
  .tier-chip { width: 66px; }
}

/* Tier list: publish button + bottom tray + status + gallery */
.tier-pub-btn {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  border: 1px solid #4caf50;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
.tier-pub-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(76,175,80,0.4); }

.tier-status {
  max-width: 1100px;
  margin: 0.6rem auto 0;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  text-align: center;
}
.tier-status[hidden] { display: none; }
.tier-status.info    { background: #14172b; color: var(--text-dim); }
.tier-status.success { background: rgba(76,175,80,0.16); color: #7ee08a; border: 1px solid #4caf50; }
.tier-status.error   { background: rgba(255,95,109,0.16); color: #ff8a93; border: 1px solid var(--mythical); }
.share-row { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.5rem; flex-wrap: wrap; }
.share-link {
  flex: 1 1 320px; max-width: 460px;
  padding: 0.5rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--border); background: #0f1120; color: var(--text);
  font-size: 0.85rem;
}

.tier-tray {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0.7rem 1rem 1rem;
}
.tier-pool {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.3rem 0.3rem 0.6rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.tier-pool .tier-chip { flex: 0 0 auto; }
.tier-pool.drag-over { border-color: #3d8bff; background: #1f2440; }

/* Other Tier Lists button */
.others-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid #ffce54;
  background: linear-gradient(135deg, #f6b73c, #c98a1f);
  color: #2a1d09;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(246, 183, 60, 0.3);
}
.others-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(246, 183, 60, 0.5); }

/* Gallery of published lists (standalone full-screen overlay) */
.gallery {
  position: fixed;
  inset: 0;
  background: rgba(4,5,12,0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 70;
}
.gallery-sub {
  margin: 0;
  padding: 0 1rem 0.6rem;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.gallery[hidden] { display: none; }
.gallery-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gallery-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--border);
}
.gallery-head h3 { margin: 0; }
.gallery-list { overflow: auto; padding: 0.8rem; display: grid; gap: 0.5rem; }
.gallery-item {
  text-align: left;
  background: #14172b;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.gallery-item:hover { border-color: var(--legendary); transform: translateY(-2px); }
.gallery-meta { color: var(--text-dim); font-size: 0.78rem; }

/* Gallery item: open area + like/favorite actions */
.gallery-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #14172b;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}
.gallery-item:hover { border-color: var(--legendary); }
.gallery-open {
  flex: 1 1 auto;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.gallery-actions { display: flex; align-items: center; gap: 0.4rem; flex: 0 0 auto; }
.like-btn, .fav-btn {
  background: #0f1120;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
}
.like-btn { color: #7ec8ff; }
.like-btn:hover { border-color: var(--rare); }
.like-btn.liked {
  background: rgba(61,139,255,0.22);
  border-color: var(--rare);
  color: #aee0ff;
  cursor: default;
}
.fav-btn { color: #ffd86b; font-size: 1.05rem; line-height: 1; padding: 0.3rem 0.55rem; }
.fav-btn:hover { border-color: #ffd86b; }
.fav-btn.on { background: rgba(255,216,107,0.18); }

/* Fake "access denied" popup for non-owners */
.access-denied {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #2a0d0f;
  color: #ff8a93;
  border: 1px solid var(--mythical);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  font-weight: 700;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.9rem;
  max-width: 460px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.access-denied.show { opacity: 1; transform: translateX(-50%) translateY(0); }
