/* ============================================================
   12-builder.css — Team Builder (/builder)
   Tema es GlacierDex, mobile-first.
   ============================================================ */
.tb-wrap { max-width: 1000px; margin: 0 auto; padding: 8px 0 40px; }
.tb-head { text-align: center; margin-bottom: 18px; }
.tb-title { font-size: 1.6rem; margin: 0 0 4px; }
.tb-sub { color: #9fb6c9; font-size: .92rem; margin: 0; }

/* --- SLOT TIM --- */
.tb-team { background: rgba(13,33,54,.55); border: 1px solid rgba(127,211,230,.18); border-radius: 16px; padding: 14px; margin-bottom: 18px; }
.tb-team-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tb-name { flex: 1 1 200px; min-width: 0; background: rgba(0,0,0,.25); border: 1px solid rgba(127,211,230,.25); border-radius: 10px; padding: 9px 12px; color: #eaf6ff; font-size: .95rem; }
.tb-name:focus { outline: none; border-color: #7fd3e6; }
.tb-team-actions { display: flex; gap: 8px; }
.tb-btn { background: linear-gradient(180deg,#1c86c8,#0f5f92); color: #fff; border: none; border-radius: 10px; padding: 9px 14px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: filter .15s; }
.tb-btn:hover { filter: brightness(1.1); }
.tb-btn-ghost { background: rgba(255,255,255,.08); }
.tb-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tb-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; border-radius: 12px; padding: 8px 4px; position: relative; }
.tb-slot.empty { border: 2px dashed rgba(127,211,230,.28); background: rgba(0,0,0,.15); }
.tb-slot.filled { border: 1px solid rgba(127,211,230,.3); background: rgba(20,60,90,.5); cursor: pointer; }
.tb-slot.filled:hover { background: rgba(30,80,120,.6); }
.tb-slot-plus { font-size: 1.8rem; color: rgba(127,211,230,.5); }
.tb-slot-spr { width: 56px; height: 56px; object-fit: contain; image-rendering: -webkit-optimize-contrast; }
.tb-slot-name { font-size: .78rem; text-align: center; line-height: 1.1; color: #eaf6ff; }
.tb-slot-types { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.tb-tt { font-size: .58rem; font-style: normal; font-weight: 700; color: #fff; padding: 1px 5px; border-radius: 6px; text-transform: uppercase; letter-spacing: .3px; }
.tb-slot-x { position: absolute; top: 4px; right: 6px; font-size: .7rem; color: #ff9e9e; opacity: 0; transition: opacity .15s; }
.tb-slot.filled:hover .tb-slot-x { opacity: 1; }

/* --- ANALISIS --- */
.tb-analysis { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
.tb-panel { background: rgba(13,33,54,.55); border: 1px solid rgba(127,211,230,.18); border-radius: 16px; padding: 14px; }
.tb-panel-title { font-size: 1.02rem; margin: 0 0 6px; }
.tb-panel-note { font-size: .84rem; color: #9fb6c9; margin: 0 0 10px; min-height: 1.1em; }
.tb-typegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 5px; }
.tb-tcell { display: flex; align-items: center; justify-content: space-between; gap: 4px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.06); border-radius: 8px; padding: 4px 6px; }
.tb-tcell.warn { border-color: rgba(255,180,90,.5); }
.tb-tcell.danger { border-color: rgba(255,90,90,.7); background: rgba(120,30,30,.25); }
.tb-tname { font-size: clamp(.55rem, 2.2vw, .64rem); font-weight: 700; color: #fff; padding: 2px 5px; border-radius: 6px; text-transform: uppercase; letter-spacing: .2px; }
.tb-tcount { display: flex; gap: 3px; align-items: center; font-size: clamp(.62rem, 2.4vw, .74rem); font-style: normal; }
.tb-tcount i { font-style: normal; font-weight: 700; }
.tb-wk { color: #ff8a8a; }
.tb-rs { color: #86e0a0; }
.tb-im { color: #b9a5ff; }
.tb-nu { color: #5f7386; }
.tb-off .tb-omult { font-size: .78rem; font-weight: 700; color: #7f95a6; }
.tb-off.is-se { border-color: rgba(120,230,150,.55); background: rgba(30,90,50,.28); }
.tb-off.is-se .tb-omult { color: #86e0a0; }
.tb-off.is-weak { opacity: .55; }
.tb-legend { margin-top: 10px; font-size: .74rem; color: #8aa1b3; }
.tb-legend i { font-style: normal; font-weight: 700; }
.tb-lg-se { color: #86e0a0; font-weight: 700; }

/* --- SARAN & REGISTRY --- */
.tb-sec-title { font-size: 1.05rem; margin: 0 0 10px; }
.tb-suggest, .tb-registry { margin-bottom: 20px; }
.tb-sugg-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.tb-sugg { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; background: rgba(20,60,90,.4); border: 1px solid rgba(127,211,230,.2); border-radius: 10px; padding: 8px 4px; cursor: pointer; color: #eaf6ff; transition: background .15s; }
.tb-sugg:hover { background: rgba(30,80,120,.6); }
.tb-sugg img { width: 48px; height: 48px; object-fit: contain; }
.tb-sugg span { font-size: .7rem; text-align: center; line-height: 1.05; }
.tb-reg-tools { margin-bottom: 10px; }
.tb-search { width: 100%; background: rgba(0,0,0,.25); border: 1px solid rgba(127,211,230,.25); border-radius: 10px; padding: 10px 12px; color: #eaf6ff; font-size: .95rem; }
.tb-search:focus { outline: none; border-color: #7fd3e6; }
/* --- SUB-FILTER (Type / Stats / Generasi) --- */
.tb-subfilter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding: 10px; background: rgba(0,0,0,.18); border: 1px solid rgba(127,211,230,.12); border-radius: 12px; }
.tb-subfilter[hidden] { display: none; }
.tb-tf { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; color: #cfe3f0; background: rgba(255,255,255,.06); border: 1px solid transparent; border-radius: 8px; padding: 4px 9px; cursor: pointer; }
.tb-tf:hover { background: rgba(255,255,255,.12); }
.tb-tf.on { background: var(--tc); color: #fff; border-color: rgba(255,255,255,.45); }
.tb-tf-ic { font-size: .82rem; line-height: 1; }
.tb-tf-nm { text-transform: uppercase; letter-spacing: .3px; }
.tb-tf-ct { font-size: .6rem; font-weight: 700; background: rgba(0,0,0,.28); padding: 0 6px; border-radius: 10px; min-width: 16px; text-align: center; }
.tb-tf.on .tb-tf-ct { background: rgba(0,0,0,.25); }
.tb-sf, .tb-gf { font-size: .72rem; font-weight: 600; color: #cfe3f0; background: rgba(255,255,255,.06); border: 1px solid transparent; border-radius: 8px; padding: 5px 11px; cursor: pointer; }
.tb-sf:hover, .tb-gf:hover { background: rgba(255,255,255,.12); }
.tb-sf.on, .tb-gf.on { background: linear-gradient(180deg,#1c86c8,#0f5f92); color: #fff; border-color: rgba(127,211,230,.4); }

/* --- CHIP FILTER AKTIF (header) --- */
.tb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tb-chips[hidden] { display: none; }
.tb-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; color: #fff; background: rgba(127,211,230,.16); border: 1px solid rgba(127,211,230,.3); border-radius: 20px; padding: 4px 11px; cursor: pointer; }
.tb-chip i { font-style: normal; font-size: .66rem; opacity: .8; }
.tb-chip:hover { background: rgba(127,211,230,.28); }
.tb-chip-clear { background: rgba(255,120,120,.14); border-color: rgba(255,120,120,.35); color: #ffc7c7; }
.tb-chip-clear:hover { background: rgba(255,120,120,.26); }

/* --- REGISTRY: badge nilai stat --- */
.tb-reg-stat { position: absolute; top: 3px; right: 4px; font-size: .58rem; font-weight: 700; color: #bfe0f2; background: rgba(0,0,0,.45); padding: 1px 5px; border-radius: 20px; }
.tb-reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.tb-reg { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(20,60,90,.35); border: 1px solid rgba(127,211,230,.15); border-radius: 10px; padding: 7px 3px; cursor: pointer; color: #eaf6ff; transition: background .15s; }
.tb-reg:hover { background: rgba(30,80,120,.6); }
.tb-reg img { width: 46px; height: 46px; object-fit: contain; }
.tb-reg span { font-size: .66rem; text-align: center; line-height: 1.05; }
.tb-reg-more { text-align: center; color: #8aa1b3; font-size: .8rem; margin-top: 12px; }
.tb-empty { color: #8aa1b3; font-size: .85rem; }

/* --- BAGIKAN / ICE CARD --- */
.tb-share-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(4,12,22,.78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tb-share-overlay[hidden] { display: none; }
.tb-share-box { position: relative; width: 100%; max-width: 540px; background: #0d2136; border: 1px solid rgba(127,211,230,.25); border-radius: 18px; padding: 18px; max-height: 92vh; overflow-y: auto; }
.tb-share-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: #9fb6c9; font-size: 1.1rem; cursor: pointer; }
.tb-share-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 10px; }
.tb-share-url { width: 100%; background: rgba(0,0,0,.3); border: 1px solid rgba(127,211,230,.2); border-radius: 8px; padding: 8px 10px; color: #cfe3f0; font-size: .8rem; }

.tb-card { position: relative; width: 100%; max-width: 480px; margin: 0 auto; padding: 20px 20px 14px; border-radius: 20px; overflow: hidden; color: #eaf6ff; background: linear-gradient(150deg,#0a2740 0%,#0e3757 45%,#13527a 100%); box-shadow: 0 12px 40px rgba(0,0,0,.5); border: 1px solid rgba(127,211,230,.35); }
.tb-card::after { content: "❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex  ❄ GlacierDex"; position: absolute; inset: -30%; transform: rotate(-22deg); font-size: 26px; font-weight: 800; letter-spacing: 3px; line-height: 2.4; color: rgba(255,255,255,.05); white-space: pre-wrap; word-break: break-word; overflow: hidden; pointer-events: none; z-index: 0; }
.tbc-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.tbc-brand { font-weight: 800; font-size: 1.05rem; letter-spacing: .3px; }
.tbc-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: #7fd3e6; background: rgba(127,211,230,.12); padding: 3px 8px; border-radius: 20px; }
.tbc-name { position: relative; z-index: 1; font-size: 1.4rem; font-weight: 700; margin: 12px 0 14px; word-break: break-word; }
.tbc-mons { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tbc-mon { display: flex; flex-direction: column; align-items: center; gap: 3px; background: rgba(255,255,255,.06); border: 1px solid rgba(127,211,230,.2); border-radius: 12px; padding: 8px 4px; }
.tbc-spr { position: relative; width: 58px; height: 58px; }
.tbc-spr > img { width: 58px; height: 58px; object-fit: contain; }
.tbc-nm { font-size: .72rem; text-align: center; line-height: 1.1; }
.tbc-types { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.tbc-types i { font-style: normal; font-size: .52rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #fff; padding: 1px 5px; border-radius: 5px; }
.tbc-stat { font-size: .58rem; font-weight: 700; color: #bfe0f2; background: rgba(0,0,0,.28); padding: 1px 7px; border-radius: 10px; }
.tbc-empty { grid-column: 1 / -1; text-align: center; color: #9fb6c9; padding: 20px 0; }
.tbc-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 4px; }
.tbc-chips i { font-style: normal; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #fff; padding: 2px 7px; border-radius: 6px; }
.tbc-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(127,211,230,.18); font-size: .72rem; color: #9fb6c9; }
.tbc-wm { color: #7fd3e6; }

/* --- TOAST --- */
.tb-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #12466e; color: #fff; padding: 10px 18px; border-radius: 24px; font-size: .88rem; box-shadow: 0 8px 24px rgba(0,0,0,.4); opacity: 0; transition: opacity .3s, transform .3s; z-index: 120; }
.tb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- DESKTOP --- */
@media (min-width: 720px) {
    .tb-slots { grid-template-columns: repeat(6, 1fr); }
    .tb-analysis { grid-template-columns: 1fr 1fr; }
}

/* --- SLOT: tombol hapus + held item --- */
.tb-slot { overflow: hidden; }
.tb-slot.empty { cursor: pointer; font: inherit; color: inherit; }
.tb-slot-del { position: absolute; top: 3px; right: 4px; z-index: 2; background: rgba(0,0,0,.35); border: none; color: #ff9e9e; font-size: .68rem; line-height: 1; padding: 3px 5px; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.tb-slot.filled:hover .tb-slot-del { opacity: 1; }
.tb-slot-item { display: flex; align-items: center; justify-content: center; gap: 3px; width: 100%; margin-top: 2px; background: rgba(0,0,0,.22); border: 1px solid rgba(127,211,230,.18); border-radius: 7px; padding: 2px 4px; cursor: pointer; color: #cfe3f0; }
.tb-slot-item:hover { background: rgba(30,80,120,.55); }
.tb-slot-item img { width: 18px; height: 18px; object-fit: contain; }
.tb-slot-item span { font-size: .6rem; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tb-item-add { color: #7f95a6; }

/* --- MODE FILTER (Semua / Type / Usage) --- */
.tb-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tb-mode { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.06); border: 1px solid transparent; color: #cfe3f0; border-radius: 9px; padding: 6px 12px; font-size: .84rem; font-weight: 600; cursor: pointer; }
.tb-mode:hover { background: rgba(255,255,255,.12); }
.tb-mode.on { background: linear-gradient(180deg,#1c86c8,#0f5f92); color: #fff; border-color: rgba(127,211,230,.4); }
.tb-mode-chip { font-size: .64rem; font-weight: 700; background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 20px; }

/* --- REGISTRY: badge peringkat usage --- */
.tb-reg { position: relative; }
.tb-reg-rank { position: absolute; top: 3px; left: 4px; font-size: .58rem; font-weight: 700; color: #ffd76a; background: rgba(0,0,0,.4); padding: 1px 5px; border-radius: 20px; }

/* --- PEMILIH ITEM (overlay) --- */
.tb-item-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(4,12,22,.78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tb-item-overlay[hidden] { display: none; }
.tb-item-box { width: 100%; max-width: 460px; background: #0d2136; border: 1px solid rgba(127,211,230,.25); border-radius: 18px; padding: 16px; max-height: 88vh; display: flex; flex-direction: column; }
.tb-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tb-item-title { font-weight: 700; font-size: 1rem; }
.tb-item-list { margin-top: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.tb-item-row { display: flex; align-items: center; gap: 10px; width: 100%; background: rgba(20,60,90,.35); border: 1px solid rgba(127,211,230,.12); border-radius: 10px; padding: 7px 10px; cursor: pointer; color: #eaf6ff; text-align: left; }
.tb-item-row:hover { background: rgba(30,80,120,.6); }
.tb-item-row img { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; }
.tb-item-nm { flex: 1 1 auto; font-size: .88rem; }
.tb-item-pct { font-size: .74rem; font-weight: 700; color: #7fd3e6; }
.tb-item-none { color: #9fb6c9; }

/* --- ICE CARD: ikon item mini (tanpa background, elegan) --- */
.tbc-mon { position: relative; }
.tbc-spr > img.tbc-item { position: absolute; bottom: -2px; right: -4px; width: 20px; height: 20px; object-fit: contain; background: none; padding: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }