:root {
    --bg: #0b0f17;
    --panel: #0f172a;
    --card: #111827;
    --muted: #9ca3af;
    --text: #e5e7eb;
    --line: #1f2937;
    --accent: #60a5fa;
    --hover: rgba(96, 165, 250, .08);

    --w-rank: 54px;
    --w-slot: 56px;
    /* nur Icon */
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: linear-gradient(180deg, #070a10, #0b0f17 35%);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.wrap {
    max-width: 1500px;
    margin: 0 auto;
    padding: 16px
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(11, 15, 23, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.titleRow {
    display: flex;
    align-items: baseline;
    gap: 10px
}

.topHeader {
    display: flex;
    align-items: center;
    gap: 12px
}

.topHeaderLeft {
    display: flex;
    align-items: baseline;
    gap: 10px
}

.topHeaderRight {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px
}

h1 {
    font-size: 18px;
    margin: 0
}

.subtitle {
    color: var(--muted);
    font-size: 12px
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .75);
    border: 1px solid rgba(255, 255, 255, .08)
}

.authEmail {
    color: var(--text);
    font-weight: 900
}

.authSep {
    color: rgba(156, 163, 175, .8)
}

.navLink {
    color: #93c5fd;
    text-decoration: none
}

.navLink:hover {
    text-decoration: underline
}

.langBar {
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.langBtn {
    width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(17, 24, 39, .65);
    color: var(--text);
    cursor: pointer;
    padding: 0;
    line-height: 1
}

.langBtn[disabled] {
    opacity: .35;
    cursor: not-allowed
}

.langBtn.isActive {
    border-color: rgba(96, 165, 250, .65);
    background: rgba(96, 165, 250, .12)
}

.controls {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.ctrl {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 8px 10px;
    border-radius: 12px;
    min-width: 160px;
}

.ctrl.small {
    min-width: 120px
}

.label {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px
}

select,
input {
    width: 100%;
    background: #0b1220;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 10px;
    outline: none;
}

select option {
    background: #0b1220;
    color: var(--text)
}

.btn {
    background: var(--accent);
    border: 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    color: #071018;
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed
}

.meta {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 240px
}

.info,
.sortLbl {
    color: var(--muted);
    font-size: 12px;
    text-align: right
}

.pager {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center
}

.btnGhost {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
}

a.btnGhost {
    text-decoration: none;
    display: inline-flex;
    align-items: center
}

.pageText {
    color: var(--muted);
    font-size: 12px
}

.tableWrap {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: auto;
    background: rgba(17, 24, 39, .85);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap
}

.itemIconImg,
.itemIconFallback {
    width: 32px;
    height: 32px;
    z-index: 4;
    background: #0b1220;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 11px;
    user-select: none;
}

tbody tr:hover td {
    background: var(--hover)
}

th.sortable {
    cursor: pointer
}

th.activeSort {
    color: var(--text)
}

.sortIcon {
    margin-left: 6px;
    opacity: .85
}

td.zero {
    color: rgba(156, 163, 175, .55)
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace
}

/* Slot cells: nur Icon */
th.slotTh,
td.slotTd {
    padding: 6px;
    text-align: center;
    width: var(--w-slot);
    min-width: var(--w-slot);
    max-width: var(--w-slot);
}

th.rankTh,
td.rankTd {
    padding: 6px 8px;
    width: var(--w-rank);
    min-width: var(--w-rank);
    max-width: var(--w-rank);
}

.slotCell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.iconWrap {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 2px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--line);
    background: #0b1220;
}

/* Rarity colors */
.iconWrap.r-normal {
    border-color: rgba(156, 163, 175, .55);
    background: rgba(156, 163, 175, .10);
}

.iconWrap.r-advance {
    border-color: rgba(34, 197, 94, .60);
    background: rgba(34, 197, 94, .12);
}

.iconWrap.r-elite {
    border-color: rgba(59, 130, 246, .65);
    background: rgba(59, 130, 246, .12);
}

.iconWrap.r-epic {
    border-color: rgba(168, 85, 247, .65);
    background: rgba(168, 85, 247, .12);
}

.iconWrap.r-legendary {
    border-color: rgba(249, 115, 22, .70);
    background: rgba(249, 115, 22, .12);
}

.itemIconImg,
.itemIconFallback {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 0;
    display: block;
    background: linear-gradient(135deg, #0b1220, #111827);
}

.itemIconImg {
    object-fit: cover;
    position: relative;
    z-index: 1
}

.itemIconFallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 11px;
    color: var(--text);
}

/* Badges */
.setBadge,
.refBadge {
    position: absolute;
    z-index: 3;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #0b1220;
    color: var(--text);
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

.setBadge {
    top: -5px;
    right: -5px
}

.refBadge {
    top: -5px;
    left: -5px
}

.setBadge:hover,
.refBadge:hover {
    border-color: rgba(96, 165, 250, .9)
}

/* Costs */
.costCell {
    display: flex;
    gap: 10px;
    align-items: center
}

.costItem {
    display: flex;
    gap: 6px;
    align-items: center
}

.costItem img {
    width: 16px;
    height: 16px;
    display: block
}

.costAmt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--text)
}

.costZero {
    color: rgba(156, 163, 175, .55)
}

/* Tooltip */
.tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    display: none;
    max-width: 860px;
    background: #050810;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.tipTitle {
    font-weight: 900;
    margin: 0 0 8px;
    font-size: 13px
}

.tipGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px
}

.tipBox {
    background: #0b1220;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px
}

.tipBox h4 {
    margin: 0 0 6px;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em
}

.tipLine {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px
}

.tipLine span {
    color: var(--muted)
}

.tipItems {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px
}

.tipItemCard {
    display: flex;
    gap: 10px;
    align-items: flex-start
}

.tipItemCard b {
    display: block;
    font-size: 12px
}

.tipItemCard small {
    color: var(--muted);
    font-size: 11px
}

/* Sticky columns */
.sticky {
    position: sticky;
    z-index: 3;
    background: rgba(17, 24, 39, .98)
}

.stickyHead {
    position: sticky;
    z-index: 6;
    background: #0b1220
}

.sticky-0 {
    left: 0
}

.sticky-1 {
    left: var(--w-rank)
}

.sticky-2 {
    left: calc(var(--w-rank) + var(--w-slot)*1)
}

.sticky-3 {
    left: calc(var(--w-rank) + var(--w-slot)*2)
}

.sticky-4 {
    left: calc(var(--w-rank) + var(--w-slot)*3)
}

.sticky-5 {
    left: calc(var(--w-rank) + var(--w-slot)*4)
}

.sticky-6 {
    left: calc(var(--w-rank) + var(--w-slot)*5)
}

.sticky-7 {
    left: calc(var(--w-rank) + var(--w-slot)*6)
}

.stickyDivider {
    box-shadow: 10px 0 16px rgba(0, 0, 0, .35)
}

.resCell {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.resRow {
    display: flex;
    gap: 8px;
    align-items: center
}

.resTag {
    font-size: 10px;
    color: rgba(156, 163, 175, .85);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 8px;
    min-width: 78px;
    text-align: center;
}