/* style-tierlist.css - Tier list pages (tier-lists.html hub + *-tier-list.html pages) */

.tl-page { max-width: 1150px; }
.tl-page .site-logo-link-small { text-decoration: none; }
.tl-intro { color: var(--text-color); font-size: 1.05rem; margin: 0 0 14px; }
.tl-intro a { color: var(--primary-color); }

/* toolbar + buttons */
.tl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tl-btn {
    font: 600 .9rem 'Poppins', sans-serif; padding: 8px 14px; border-radius: 20px; cursor: pointer;
    border: 1px solid var(--tile-border); background: var(--tile-bg); color: var(--text-color);
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.tl-btn:hover { transform: translateY(-2px); border-color: var(--primary-color); }
.tl-btn:focus-visible, .tl-zone:focus-visible, .tl-item:focus-visible, .tl-label:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }
.tl-btn-primary, .tl-btn-primary:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.tl-btn-danger { color: #e5484d; border-color: color-mix(in srgb, #e5484d 50%, transparent); }
.tl-btn-danger:hover { border-color: #e5484d; }

/* board */
.tl-board { display: flex; flex-direction: column; gap: 2px; background: #111116; border-radius: 10px; overflow: hidden; border: 2px solid #111116; }
.tl-row { display: flex; min-height: 92px; background: #24242c; }
.tl-label {
    flex: 0 0 110px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px;
    font: 700 1.5rem 'Poppins', sans-serif; color: #1b1b1b; border: none; border-radius: 0; cursor: pointer; word-break: break-word; line-height: 1.15;
}
.tl-label span { pointer-events: none; }
.tl-label[data-tier]:hover { filter: brightness(1.08); }
.tl-readonly .tl-label { cursor: default; }
.tl-zone { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; padding: 4px; min-height: 92px; }
.tl-row .tl-zone:empty::after { content: ''; }

/* items */
.tl-item {
    position: relative; width: 84px; height: 84px; padding: 0; border: none; border-radius: 6px; overflow: hidden; cursor: grab;
    background: #3a3a46; color: #fff; flex: 0 0 auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    transition: transform .12s ease, box-shadow .12s ease;
}
.tl-readonly .tl-item { cursor: default; }
.tl-item img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; pointer-events: none; margin: 0; border-radius: 0; box-shadow: none; max-width: none; }
.tl-name {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 3px; font: 600 .62rem/1.2 'Poppins', sans-serif; color: #fff;
    background: rgba(0, 0, 0, .68); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.tl-hide-names .tl-name { display: none; }
.tl-text { display: flex; align-items: center; justify-content: center; padding: 6px; background: linear-gradient(135deg, #4b4b5c, #33333f); }
.tl-text-label { font: 600 .78rem/1.2 'Poppins', sans-serif; text-align: center; word-break: break-word; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; pointer-events: none; }
.tl-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.tl-readonly .tl-item:hover { transform: none; box-shadow: none; }
.tl-item.tl-selected { box-shadow: 0 0 0 3px var(--primary-color), 0 0 16px var(--primary-color); transform: scale(1.04); z-index: 1; }
.tl-item.tl-src { display: none; }
.tl-item.tl-flash { animation: tlFlash .9s ease; }
@keyframes tlFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px #ffd54a, 0 0 20px #ffd54a; } }
.tl-ph { flex: 0 0 auto; border-radius: 6px; border: 2px dashed var(--primary-color); background: color-mix(in srgb, var(--primary-color) 18%, transparent); box-sizing: border-box; }
.tl-ghost { position: fixed !important; left: 0; top: 0; z-index: 10000; pointer-events: none; opacity: .92; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
body.tl-dragging, body.tl-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* unranked pool */
.tl-pool-wrap { margin-top: 18px; background: var(--tile-bg); border: 1px solid var(--tile-border); border-radius: 12px; padding: 12px; }
.tl-pool-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.tl-pool-title { margin: 0 auto 0 0 !important; font-size: 1.1rem !important; color: var(--primary-color); border: none !important; padding: 0 !important; }
.tl-pool { min-height: 100px; border-radius: 8px; background: color-mix(in srgb, var(--bg-color, #000) 35%, transparent); }
.tl-empty { color: var(--text-muted-color); text-align: center; margin: 10px 0 0; }

/* search + text add */
.tl-search { position: relative; }
.tl-search input, .tl-text-add input, .tl-title-field input, .tl-field input, .tl-share-input {
    font: 500 .95rem 'Poppins', sans-serif; padding: 8px 12px; border-radius: 20px; border: 1px solid var(--tile-border);
    background: var(--modal-bg, #fff); color: var(--text-color); min-width: 220px; box-sizing: border-box;
}
.tl-results { position: absolute; z-index: 50; right: 0; top: calc(100% + 4px); width: 300px; max-width: 86vw; background: var(--modal-bg); border: 1px solid var(--tile-border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); overflow: hidden; }
.tl-results:empty { display: none; }
.tl-result { display: flex; width: 100%; align-items: center; gap: 10px; padding: 6px 10px; border: none; background: none; color: var(--text-color); cursor: pointer; text-align: left; font: inherit; }
.tl-result:hover, .tl-result:focus-visible { background: color-mix(in srgb, var(--primary-color) 15%, transparent); }
.tl-result img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: top; margin: 0; box-shadow: none; flex: 0 0 auto; }
.tl-result span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tl-result b { font-size: .9rem; } .tl-result small { color: var(--text-muted-color); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-result em { font-size: .7rem; color: var(--text-muted-color); }
.tl-noresult { padding: 10px; color: var(--text-muted-color); font-size: .9rem; }
.tl-text-add { display: flex; gap: 6px; }
.tl-title-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 600; }
.tl-title-field input { min-width: 260px; flex: 1; max-width: 420px; }
.tl-custom-title { text-align: center; }

/* selection hint bar */
.tl-hint {
    position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 140%); z-index: 9000; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
    max-width: calc(100vw - 24px); padding: 10px 14px; border-radius: 16px; background: var(--modal-bg); color: var(--text-color);
    border: 2px solid var(--primary-color); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: transform .25s ease; font-size: .9rem;
}
.tl-hint.show { transform: translate(-50%, 0); }
.tl-hint-actions { display: inline-flex; gap: 6px; margin-left: 6px; }
.tl-hint .tl-btn { padding: 5px 10px; font-size: .8rem; }

/* banner (shared view) */
.tl-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px; background: color-mix(in srgb, var(--primary-color) 14%, transparent); border: 1px solid var(--primary-color); }

/* modal */
.tl-modal-bg { position: fixed; inset: 0; z-index: 10001; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tl-modal { background: var(--modal-bg); color: var(--text-color); border-radius: 16px; padding: 20px; width: 100%; max-width: 440px; box-shadow: var(--modal-shadow, 0 10px 40px rgba(0,0,0,.4)); animation: tlPop .2s ease both; }
@keyframes tlPop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.tl-modal h3 { margin: 0 0 12px; color: var(--primary-color); }
.tl-modal-text { margin: 0 0 14px; }
.tl-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 600; }
.tl-field input, .tl-share-input { width: 100%; min-width: 0; }
.tl-field-label { font-weight: 600; margin-bottom: 6px; }
.tl-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.tl-swatch { height: 34px; border-radius: 8px; padding: 0; border: 2px solid transparent; }
.tl-swatch.on { border-color: var(--text-color); box-shadow: 0 0 0 2px var(--modal-bg) inset; }
.tl-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tl-end { justify-content: flex-end; margin-top: 14px; }

/* toast */
.tl-toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -150%); z-index: 10002; padding: 10px 18px; border-radius: 14px; background: var(--primary-color); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: transform .25s ease; max-width: calc(100vw - 24px); text-align: center; }
.tl-toast.show { transform: translate(-50%, 0); }

/* hub page */
.tl-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 10px 0 20px; }
.tl-hub a { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; text-decoration: none; color: var(--text-color) !important; background: var(--tile-bg); border: 2px solid var(--qc, var(--primary-color)); transition: transform .15s ease; }
.tl-hub a:hover { transform: translateY(-3px); }
.tl-hub .tl-hub-icon { font-size: 2.2rem; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tl-hub img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; object-position: top; margin: 0 !important; box-shadow: none !important; flex: 0 0 auto; }
.tl-hub b { display: block; } .tl-hub small { color: var(--text-muted-color); }
.tl-more { margin-top: 26px; }
.tl-more h2 { font-size: 1.3rem !important; }
.tl-more ul { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-left: 18px; }
.tl-more a { color: var(--primary-color); }

@media (max-width: 640px) {
    .tl-page { padding: 18px 12px !important; }
    .tl-label { flex-basis: 64px; font-size: 1.1rem; }
    .tl-row, .tl-zone { min-height: 68px; }
    .tl-item { width: 60px; height: 60px; }
    .tl-name { font-size: .52rem; }
    .tl-text-label { font-size: .62rem; }
    .tl-btn { font-size: .8rem; padding: 7px 11px; }
    .tl-search input, .tl-text-add input { min-width: 0; width: 100%; }
    .tl-pool-head > * { flex: 1 1 100%; }
    .tl-hint { font-size: .82rem; bottom: 84px; }
}
