/* Titan Counters page. Colours come from site-v2.css tokens, so light/dark theme follow the site. */
.tc-wrap { max-width: 1100px; margin: 28px auto 40px; padding: 0 16px; color: var(--hv-text); font-family: var(--hv-body); }
.tc-wrap *, .tc-wrap *::before, .tc-wrap *::after { box-sizing: border-box; }
.tc-wrap button { font-family: inherit; }
.tc-water { --el: #38bdf8; } .tc-fire { --el: #f97316; } .tc-earth { --el: #65a30d; }
.tc-dark { --el: #a855f7; } .tc-light { --el: #eab308; } .tc-distortion { --el: #ec4899; }

.tc-hero { text-align: center; margin-bottom: 22px; }
.tc-hero h1 { font-family: var(--hv-display); font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 8px; color: var(--hv-text); letter-spacing: .3px; }
.tc-hero h1 span { color: var(--hv-gold); }
.tc-hero p { color: var(--hv-text-2); max-width: 720px; margin: 0 auto 10px; line-height: 1.6; }
.tc-meta { display: inline-block; font-size: .85rem; color: var(--hv-muted); background: var(--hv-surface-2); border: 1px solid var(--hv-line-2); border-radius: 999px; padding: 5px 14px; }
.tc-meta b { color: var(--hv-gold); }

.tc-card { background: var(--hv-panel); border: 1px solid var(--hv-line-2); border-radius: 16px; padding: 18px; margin-bottom: 18px; box-shadow: var(--hv-shadow); scroll-margin-top: 90px; }
.tc-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tc-card-h h2 { font-family: var(--hv-display); font-size: 1.15rem; margin: 0; color: var(--hv-text); text-transform: uppercase; letter-spacing: .6px; }
.tc-card-h h2 small { color: var(--hv-muted); font: 600 .8rem var(--hv-body); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.tc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tc-btn { background: var(--hv-surface-2); border: 1px solid var(--hv-line-2); color: var(--hv-text); border-radius: 9px; padding: 7px 12px; font-weight: 700; font-size: .85rem; cursor: pointer; }
.tc-btn:hover:not(:disabled) { border-color: var(--hv-gold-line); color: var(--hv-gold); }
.tc-btn:disabled { opacity: .45; cursor: default; }
.tc-muted { color: var(--hv-dim); font-size: .85rem; }

/* defense slots */
.tc-defense { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.tc-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-width: 560px; }
.tc-slot { position: relative; aspect-ratio: 1; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.tc-slot.empty { border: 2px dashed var(--hv-line-2); color: var(--hv-dim); font: 800 1.3rem var(--hv-display); background: var(--hv-surface); }
.tc-slot.full { border: 3px solid var(--el); background: #15130f; padding: 0; cursor: pointer; box-shadow: 0 0 14px color-mix(in srgb, var(--el) 35%, transparent); }
.tc-slot.full img { width: 100%; height: 100%; object-fit: cover; }
.tc-slot.full span { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; font-size: .72rem; font-weight: 700; padding: 10px 2px 3px; text-align: center; }
.tc-slot.full i { position: absolute; top: 3px; right: 5px; color: #fff; font-style: normal; font-weight: 800; text-shadow: 0 1px 3px #000; opacity: 0; transition: opacity .15s; }
.tc-slot.full:hover i, .tc-slot.full:focus-visible i { opacity: 1; }
.tc-def-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.tc-count { font: 800 1.1rem var(--hv-display); color: var(--hv-gold); }
.tc-totems { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tc-totem { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--hv-text); background: color-mix(in srgb, var(--el) 16%, transparent); border: 1px solid color-mix(in srgb, var(--el) 55%, transparent); border-radius: 999px; padding: 2px 9px 2px 3px; white-space: nowrap; }
.tc-el { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }

/* titan grid */
.tc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.tc-group { background: var(--hv-surface); border: 1px solid var(--hv-line); border-top: 3px solid var(--el); border-radius: 12px; padding: 10px; }
.tc-group-h { display: flex; align-items: center; gap: 6px; font: 800 .82rem var(--hv-display); text-transform: uppercase; letter-spacing: .7px; color: var(--hv-text-2); margin-bottom: 8px; }
.tc-group-h .tc-el { width: 22px; height: 22px; }
.tc-group-b { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tc-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--hv-text-2); }
.tc-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 2px solid transparent; background: #15130f; transition: transform .12s, border-color .12s; }
.tc-pick span { font-size: .68rem; font-weight: 600; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-pick:hover:not(:disabled) img { transform: translateY(-2px); border-color: color-mix(in srgb, var(--el) 60%, transparent); }
.tc-pick.on img { border-color: var(--el); box-shadow: 0 0 0 2px var(--el), 0 0 12px color-mix(in srgb, var(--el) 50%, transparent); }
.tc-pick.on span { color: var(--hv-text); font-weight: 800; }
.tc-pick:disabled { opacity: .35; cursor: default; }
.tc-x2 { position: absolute; top: -4px; right: -4px; background: var(--el); color: #111; font: 800 .6rem/1 var(--hv-body); font-style: normal; border-radius: 6px; padding: 2px 4px; }

/* results */
.tc-empty { text-align: center; color: var(--hv-muted); padding: 22px 10px; line-height: 1.6; }
.tc-empty b { color: var(--hv-text); }
.tc-counters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tc-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(0, 330px); gap: 12px; align-items: center; background: var(--hv-surface); border: 1px solid var(--hv-line); border-radius: 12px; padding: 10px 12px; }
.tc-row:first-child { border-color: var(--hv-gold-line); background: var(--hv-gold-soft); }
.tc-rank { font: 800 1.05rem var(--hv-display); color: var(--hv-gold); text-align: center; }
.tc-team { display: grid; grid-template-columns: repeat(5, minmax(0, 64px)); gap: 6px; }
.tc-ti { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.tc-ti img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; border: 2px solid var(--el); background: #15130f; }
.tc-ti b { font-size: .66rem; font-weight: 600; color: var(--hv-text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-team.sm { grid-template-columns: repeat(5, 44px); gap: 4px; }
.tc-team.sm .tc-ti b { display: none; }
.tc-stats { display: grid; grid-template-columns: 86px 1fr; gap: 6px 12px; align-items: center; }
.tc-win { text-align: center; border-radius: 10px; padding: 6px 4px; border: 1px solid; }
.tc-win b { display: block; font: 800 1.25rem var(--hv-display); }
.tc-win small { font-size: .72rem; color: var(--hv-muted); }
.hi { --wc: #22c55e; } .mid { --wc: #eab308; } .lo { --wc: #ef4444; }
.tc-win { border-color: color-mix(in srgb, var(--wc) 55%, transparent); background: color-mix(in srgb, var(--wc) 12%, transparent); }
.tc-win b, .tc-brow-w b { color: var(--wc); }
html[data-theme="light"] .hi { --wc: #15803d; } html[data-theme="light"] .mid { --wc: #a16207; } html[data-theme="light"] .lo { --wc: #b91c1c; }
.tc-hp-l { display: flex; justify-content: space-between; font-size: .8rem; color: var(--hv-muted); margin-bottom: 4px; }
.tc-hp-l b { color: var(--hv-text); }
.tc-bar { height: 8px; border-radius: 99px; background: var(--hv-line-2); overflow: hidden; }
.tc-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f59e0b, #84cc16); }
.tc-ehp { display: block; margin-top: 4px; font-size: .72rem; color: var(--hv-dim); }
.tc-att-totems { grid-column: 1 / -1; display: flex; gap: 5px; flex-wrap: wrap; }
.tc-att-totems .tc-totem { font-size: .7rem; }
.tc-att-totems .tc-el { width: 16px; height: 16px; }

/* browse */
.tc-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tc-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--hv-surface); border: 1px solid var(--hv-line-2); color: var(--hv-text-2); border-radius: 999px; padding: 3px 11px 3px 4px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.tc-chip.on { border-color: var(--el); background: color-mix(in srgb, var(--el) 18%, transparent); color: var(--hv-text); }
.tc-select { background: var(--hv-surface); border: 1px solid var(--hv-line-2); color: var(--hv-text); border-radius: 9px; padding: 6px 10px; font-size: .85rem; font-family: inherit; }
.tc-select option, .tc-select optgroup { background: var(--hv-bg-2); color: var(--hv-text); }
.tc-browse-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tc-brow { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--hv-surface); border: 1px solid var(--hv-line); border-radius: 12px; padding: 8px 10px; cursor: pointer; color: var(--hv-text); }
.tc-brow:hover { border-color: var(--hv-gold-line); }
.tc-brow-t { display: flex; gap: 2px; flex-wrap: wrap; width: 42px; }
.tc-brow-t .tc-el { width: 18px; height: 18px; }
.tc-brow-w { margin-left: auto; text-align: right; }
.tc-brow-w b { display: block; font: 800 1.05rem var(--hv-display); }
.tc-brow-w small { font-size: .7rem; color: var(--hv-muted); white-space: nowrap; }
.tc-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; color: var(--hv-muted); font-size: .85rem; }

@media (max-width: 900px) {
    .tc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tc-row { grid-template-columns: 30px minmax(0, 1fr); }
    .tc-stats { grid-column: 1 / -1; }
    .tc-browse-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .tc-card { padding: 14px 12px; }
    .tc-defense { grid-template-columns: 1fr; }
    .tc-def-side { align-items: flex-start; }
    .tc-totems { justify-content: flex-start; }
    .tc-grid { grid-template-columns: 1fr; }
    .tc-team { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .tc-team.sm { grid-template-columns: repeat(5, 34px); gap: 3px; }
    .tc-brow-t { display: none; }
}
