/* ===== Halaman Ban & Pick ===== */
.draft-app { max-width: 1200px; margin: 0 auto; }
.draft-title { margin: 18px 4px 14px; }
.draft-title h1 { margin: 0; font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.02em; }
.draft-title p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }

.draft-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px 18px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ctl { display: flex; flex-direction: column; gap: 5px; }
.ctl > span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft); }
.seg button { padding: 7px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.seg button:disabled { opacity: .5; cursor: not-allowed; }
.ctl-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.btn { padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.status-bar { display: none; }
:root { --blue: #3f7fd0; --red: #cf5b4a; }
:root[data-theme="dark"] { --blue: #6aa5ee; --red: #ee7c6b; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tc, var(--ink-3)); }

/* Papan gaya siaran: tim kiri | info tengah | tim kanan */
.draft-board { display: grid; grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr); gap: 14px; align-items: start; margin: 16px 0 18px; padding: 14px; border-radius: 30px; background: var(--screen); border: 1px solid var(--screen-border); box-shadow: var(--shadow-screen); }
.bteam { --tc: var(--ink-3); min-width: 0; }
.bteam[data-team="blue"] { --tc: var(--blue); }
.bteam[data-team="red"] { --tc: var(--red); }
.bt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 8px 12px; border-radius: 18px; background: color-mix(in srgb, var(--tc) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--tc) 40%, var(--line)); border-bottom: 3px solid var(--tc); }
.bteam[data-team="red"] .bt-head { justify-content: space-between; }
.bteam[data-team="blue"] .bt-head { justify-content: space-between; }
.bt-head h2 { margin: 0; font-size: 16px; font-weight: 800; white-space: nowrap; }
.bteam.active .bt-head { box-shadow: 0 0 0 2px var(--tc); }
.ban-row { display: flex; gap: 5px; }
.pick-col { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }

.slot { position: relative; display: block; padding: 0; border: 1px dashed var(--line-strong); background: var(--soft); color: var(--ink-3); cursor: default; font: inherit; overflow: hidden; }
.slot.ban { width: 36px; height: 36px; border-radius: 10px; }
.slot.pick { aspect-ratio: 4 / 5; border-radius: 14px; }
.slot.current { border-style: solid; border-color: var(--tc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 40%, transparent); animation: pulse 1.4s ease-in-out infinite; }
.slot.target { border-style: solid; border-color: var(--tc); }
.slot.filled { border-style: solid; border-color: var(--line); background: var(--card); color: var(--ink); }
.slot.free { cursor: pointer; }
.slot .ico { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 22px; color: var(--forest-2); background: var(--soft); }
.slot.ban .ico { font-size: 14px; }
.slot.ban.filled .ico img { filter: grayscale(1); opacity: .55; }
.slot.ban.filled::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; background: #c0432d; transform: rotate(-40deg); }
.ico img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.slot .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 4px 5px; background: linear-gradient(to top, rgba(10,16,12,.85), transparent); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.slot .empty-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--ink-3); opacity: .6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--tc) 18%, transparent); } }

.bcenter { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 8px 4px; text-align: center; }
.score { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.score .sc { min-width: 1ch; font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.score .sc.blue { color: var(--blue); }
.score .sc.red { color: var(--red); }
.score small { font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); }
.timer { font-size: 64px; font-weight: 800; line-height: 1; min-height: 64px; font-variant-numeric: tabular-nums; color: var(--ink); }
.timer.low { color: #c0432d; }
.score-ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--soft); font-size: 13px; }
.sc-pill b { font-weight: 700; color: var(--ink-2); }
.sc-pill.blue b { color: var(--blue); }
.sc-pill.red b { color: var(--red); }
.sc-pill button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--card); color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.sc-pill button:hover { background: var(--hover); }
.sc-pill output { min-width: 1.4ch; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

.sum { margin-top: 10px; }
.lane-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.lane-chip { padding: 4px 9px; border-radius: 999px; background: var(--soft); color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.lane-chip.on { background: var(--sage); color: var(--ink); }
.dmg { display: flex; height: 8px; margin-top: 8px; border-radius: 99px; overflow: hidden; background: var(--soft); }
.dmg i { display: block; height: 100%; }
.dmg .p { background: #d98a3d; }
.dmg .m { background: #7a6fd0; }
.dmg-legend { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.missing { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }

.pool { padding: 18px; border-radius: 32px; background: var(--screen); border: 1px solid var(--screen-border); box-shadow: var(--shadow-screen); min-width: 0; }
.pool-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pool-tools .search-wrap { flex: 1 1 180px; }
.pool .picker-filters { margin: 8px 0 0; padding: 8px 2px 12px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px 6px; max-height: 620px; overflow-y: auto; padding: 4px 6px 8px 2px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.hero-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px 8px; border: 1px solid transparent; border-radius: 16px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; min-width: 0; }
.hero-tile:hover:not(:disabled) { background: var(--hover); border-color: var(--line-strong); }
.hero-tile .ico { display: grid; place-items: center; width: 100%; max-width: 56px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--soft); font-weight: 800; font-size: 18px; color: var(--forest-2); }
.hero-tile .ico img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-tile .nm { font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--ink-2); text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-tile:disabled { cursor: not-allowed; opacity: .38; }
.hero-tile:disabled .ico { filter: grayscale(1); }
.hero-tile .tag { font-size: 10px; font-weight: 800; color: #c0432d; text-transform: uppercase; }
.hint { margin: 10px 2px 0; font-size: 12px; color: var(--ink-3); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-card); }

@media (max-width: 900px) {
  .draft-board { grid-template-columns: 1fr; padding: 10px; }
  .bcenter { order: -1; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 18px; }
  .timer { font-size: 44px; min-height: 0; }
  .score .sc { font-size: 32px; }
  .ctl-actions { margin-left: 0; }
}
@media (max-width: 560px) {
  .slot.ban { width: 32px; height: 32px; }
  .slot .nm { font-size: 9px; padding: 10px 2px 3px; }
  .slot .empty-label { font-size: 16px; }
  .bt-head h2 { font-size: 14px; }
}

/* Desktop: skor sejajar bar tim, timer sejajar kartu pick (tengah) */
@media (min-width: 901px) {
  .bteam, .bcenter { display: contents; }
  .draft-board { grid-template-rows: auto auto auto; row-gap: 0; align-items: stretch; }
  .bteam[data-team="blue"] .bt-head { grid-column: 1; grid-row: 1; }
  .bteam[data-team="blue"] .pick-col { grid-column: 1; grid-row: 2; }
  .bteam[data-team="blue"] .sum { grid-column: 1; grid-row: 3; }
  .bteam[data-team="red"] .bt-head { grid-column: 3; grid-row: 1; }
  .bteam[data-team="red"] .pick-col { grid-column: 3; grid-row: 2; }
  .bteam[data-team="red"] .sum { grid-column: 3; grid-row: 3; }
  .score { grid-column: 2; grid-row: 1; align-self: stretch; justify-self: center; margin-bottom: 8px; padding: 0 18px; }
  .timer { grid-column: 2; grid-row: 2; align-self: center; justify-self: center; min-height: 0; font-size: 72px; }
}

/* ===== Nama tim yang bisa diedit ===== */
.bt-head h2.team-title { min-width: 0; }
.team-edit { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; cursor: text; }
/* Lebar kolom mengikuti panjang teks: salinan tak terlihat (data-value) menentukan lebar */
.team-input-wrap { display: inline-grid; min-width: 3ch; max-width: 100%; }
.team-input-wrap::after { content: attr(data-value) "\00a0"; grid-area: 1 / 1; visibility: hidden; white-space: pre; padding: 3px 6px; overflow: hidden; }
.team-name { grid-area: 1 / 1; width: 0; min-width: 100%; padding: 3px 6px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: inherit; text-overflow: ellipsis; outline: none; }
.team-name:hover { background: color-mix(in srgb, var(--tc) 14%, transparent); }
.team-name:focus { background: color-mix(in srgb, var(--tc) 16%, var(--card)); box-shadow: 0 0 0 2px var(--tc); }
.team-pen { flex: none; color: var(--ink-3); transition: color .2s; }
.team-edit:hover .team-pen, .team-edit:focus-within .team-pen { color: var(--tc); }
.sc-pill b { max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Ikon role di slot pick yang masih kosong ===== */
/* Setengah transparan; warnanya mengikuti tema lewat mask (bagian terang gambar = ikon, bagian gelap = samar) */
.slot .empty-label.has-role { opacity: 1; }
.role-ico { display: block; width: 58%; aspect-ratio: 1; opacity: .5; background: var(--ico) center / contain no-repeat; filter: grayscale(1); } /* cadangan untuk peramban lama: abu-abu */
@supports (mask-mode: luminance) or (-webkit-mask-mode: luminance) {
  .role-ico { background: var(--ink-2); filter: none; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; -webkit-mask-mode: luminance; mask-mode: luminance; }
}
