/* AniWorld TCG — /tierlist */
.tl-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 44px; padding-bottom: 22px; }
.tl-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -.02em; margin: 10px 0 10px; }
.tl-hero p { max-width: 520px; }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border-radius: 999px; border: none; background: none; color: var(--text-2); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: color .15s, background .15s; }
.seg button:hover { color: var(--text); }
.seg button.active { color: #fff; background: var(--brand-grad); box-shadow: 0 4px 16px #c04df540; }
.seg.small button { height: 32px; padding: 0 13px; font-size: 13px; }
.seg.small button.active { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }

.tl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tl-bar .left, .tl-bar .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-note { font-size: 13px; color: var(--text-3); margin: -2px 0 16px; }
.tl-note b { color: var(--text-2); font-weight: 600; }

/* Tier rows */
.tiers { display: flex; flex-direction: column; gap: 8px; }
.tier { display: grid; grid-template-columns: 96px 1fr; min-height: 112px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.tier-label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; background: var(--tc); color: #14101f; text-align: center; }
.tier-label .name { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; word-break: break-word; }
.tier-label .name.long { font-size: 17px; }
.tier-label .sub { font-size: 11px; font-weight: 700; opacity: .7; }
.tier-cards { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 8px; min-height: 100%; }
.tier-cards .empty-row { align-self: center; padding: 0 8px; font-size: 13px; color: var(--text-3); }

.mini { position: relative; width: 74px; flex-shrink: 0; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mini .art { position: relative; aspect-ratio: 5 / 7; border-radius: 8px; overflow: hidden; background: var(--bg-2); box-shadow: 0 0 0 2px var(--rc, var(--COMMON)); transition: transform .15s, box-shadow .15s; }
.mini .art img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mini:hover .art { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--rc), 0 8px 20px #0009; }
.mini .nm { margin-top: 4px; font-size: 10.5px; font-weight: 600; line-height: 1.2; color: var(--text-2); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .rank { position: absolute; top: 3px; left: 3px; padding: 0 5px; height: 17px; display: inline-flex; align-items: center; border-radius: 5px; background: #000b; font-size: 10px; font-weight: 800; color: #fff; }
.mini .cmp { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; display: inline-grid; place-items: center; border-radius: 5px; background: var(--tc); color: #14101f; font-size: 10.5px; font-weight: 800; box-shadow: 0 0 0 1px #0006; }
.mini.selected .art { box-shadow: 0 0 0 3px #fff, 0 0 18px #fff8; transform: translateY(-2px); }
.mini.dragging { opacity: .25; }
.mini.ghost { position: fixed; z-index: 300; pointer-events: none; transform: rotate(-4deg) scale(1.08); filter: drop-shadow(0 12px 22px #000c); }
.mini.ghost .nm { display: none; }
.drop-mark { width: 4px; align-self: stretch; min-height: 100px; border-radius: 2px; background: var(--pink); box-shadow: 0 0 10px var(--pink); }

.tip { position: fixed; z-index: 250; pointer-events: none; padding: 10px 12px; border-radius: 10px; background: #0d0a19f2; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 12.5px; min-width: 170px; }
.tip b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; color: var(--text-2); }
.tip .row span:last-child { color: var(--text); font-weight: 700; }

/* Community */
.lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.list-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.list-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.list-card h3 { font-family: var(--font-display); font-size: 17px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card .by { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.list-card .by img { width: 22px; height: 22px; border-radius: 50%; }
.list-card .thumbs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.list-card .thumbs span { position: relative; aspect-ratio: 5 / 7; border-radius: 5px; overflow: hidden; background: var(--bg-2); }
.list-card .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.list-card .thumbs i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tc); }
.list-card .meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-3); }
.list-card .meta .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.pill.private { color: var(--gold); border-color: #f4c54255; }

/* Viewer */
.view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.view-head h2 { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 32px); line-height: 1.15; margin-bottom: 8px; word-break: break-word; }
.view-head .desc { margin-top: 10px; color: var(--text-2); max-width: 680px; white-space: pre-line; }
.view-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.liked { border-color: #ff4db380; background: #ff4db322; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--pink); width: 16px; height: 16px; }

/* Editor */
.editor-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.ed-form { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px 18px; padding: 18px; }
.ed-form .full { grid-column: 1 / -1; }
.ed-form label.k { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.ed-form textarea.input { height: 64px; padding: 10px 14px; resize: vertical; }
.ed-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.ed-tools .left, .ed-tools .right { display: flex; gap: 8px; flex-wrap: wrap; }
.tier.edit .tier-label { padding: 6px 6px 30px; }
.tier.edit .tier-label input.lbl { width: 100%; border: none; outline: none; background: transparent; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 26px; color: #14101f; }
.tier.edit .tier-label input.lbl:focus { background: #ffffff40; border-radius: 6px; }
.tier-ctl { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 2px; }
.tier-ctl button, .tier-ctl label { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: none; background: #0003; color: #14101f; font-size: 12px; cursor: pointer; }
.tier-ctl button:hover, .tier-ctl label:hover { background: #0005; }
.tier-ctl input[type=color] { position: absolute; width: 0; height: 0; opacity: 0; }
.tier.drop-target { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink) inset; }
.pool { padding: 14px; }
.pool-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pool-head h3 { font-family: var(--font-display); font-size: 17px; }
.pool-head h3 span { color: var(--text-3); font-weight: 600; font-size: 14px; margin-left: 6px; }
.pool-head .search { width: 240px; }
.pool-cards { display: flex; flex-wrap: wrap; gap: 6px; min-height: 120px; padding: 8px; border-radius: var(--r); border: 1px dashed var(--line-2); }
.pool-cards.drop-target { border-color: var(--pink); }
.hint { font-size: 12.5px; color: var(--text-3); }

.login-box { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-box h3 { font-family: var(--font-display); font-size: 22px; }

.share-box { width: min(480px, 100%); padding: 26px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); position: relative; }
.share-box h3 { font-family: var(--font-display); font-size: 22px; margin-bottom: 6px; }
.share-box .row { display: flex; gap: 8px; margin: 16px 0 10px; }

@media (max-width: 760px) {
  .tl-hero { padding-top: 26px; }
  .tier { grid-template-columns: 58px 1fr; min-height: 92px; }
  .tier-label .name { font-size: 24px; }
  .tier.edit .tier-label input.lbl { font-size: 20px; }
  .tier-ctl { gap: 1px; }
  .tier-ctl button, .tier-ctl label { width: 13px; height: 20px; font-size: 9px; border-radius: 4px; }
  .mini { width: 51px; }
  .mini .nm { font-size: 9.5px; }
  .tier-cards { gap: 4px; padding: 5px; }
  .ed-form { grid-template-columns: 1fr; padding: 14px; }
  .seg button { padding: 0 12px; font-size: 13px; }
  .pool { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 30; max-height: 34vh; overflow-y: auto; padding: 10px; box-shadow: 0 -10px 30px #000a; }
  .pool-head { margin-bottom: 8px; gap: 6px; }
  .pool-head > div { width: 100%; flex-wrap: nowrap !important; }
  .pool-head .chips { flex-wrap: nowrap; overflow-x: auto; flex-shrink: 1; min-width: 0; scrollbar-width: none; }
  .pool-head .chips::-webkit-scrollbar { display: none; }
  .pool-head .search { flex: 0 0 120px; }
  .pool-head .chip { height: 30px; padding: 0 10px; }
  .pool-cards { min-height: 90px; padding: 6px; }
}
