:root { color-scheme: dark; --bg: #0f131c; --panel: #171d29; --panel-2: #1f2635; --line: #2b3447; --text: #e8ebf2; --muted: #98a2b8;
	--gold: #f2c14e; --teal: #4cc9b0; --bare: #6ea8ff; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; }
small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
h1, h2, h3 { margin: 20px 0 10px; font-size: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.updated, .count, .note { color: var(--muted); font-size: 13px; }
.top { flex-wrap: wrap; }
.source { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; color: var(--gold); font-size: 13.5px; text-decoration: underline; }
.export { position: relative; }
.export summary { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; cursor: pointer; list-style: none; }
.export summary::-webkit-details-marker { display: none; }
.export summary::after { content: "▾"; color: var(--muted); }
.export[open] summary { border-color: var(--gold); }
.export-menu { position: absolute; z-index: 15; right: 0; top: calc(100% + 4px); display: grid; gap: 8px; width: 250px; padding: 12px; background: var(--panel); border: 1px solid #6a7186; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.export-menu p { margin: 0; color: var(--muted); font-size: 12.5px; }
.export-menu button { min-height: 36px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; }
.export-menu button:hover:enabled { border-color: var(--gold); }
.export-menu button:disabled { color: var(--muted); cursor: default; }
.export.busy .export-menu { cursor: progress; }
.export-csv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.update { min-width: 160px; min-height: 36px; padding: 0 14px; background: var(--gold); border: 0; color: #10141c; font: inherit; font-weight: 700; cursor: pointer; }
.update:disabled { background: var(--panel-2); color: var(--muted); cursor: default; }
.update.busy:disabled, .update.busy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--teal); color: #10141c; cursor: progress; }
.update.busy::before { content: ""; width: 14px; height: 14px; border: 2px solid #10141c; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Over the top of whatever is on screen, and the only light thing on the page, so it is seen among the gear. */
.toast { position: fixed; z-index: 20; left: 50%; top: 10px; transform: translateX(-50%); display: grid; justify-items: center; gap: 9px; width: max-content; max-width: calc(100vw - 16px); min-width: min(420px, calc(100vw - 16px));
	padding: 13px 20px; pointer-events: none; background: #f4f6fb; color: #10141c; border: 2px solid var(--teal); border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.75), 0 0 0 4px rgba(76,201,176,.35); font-size: 16px; font-weight: 700; text-align: center; animation: drop .25s ease-out; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px); } }
.toast[hidden], .toast progress[hidden] { display: none; }
.toast progress { appearance: none; width: 100%; height: 12px; border: 0; background: #c9d0de; }
.toast progress::-webkit-progress-bar { background: #c9d0de; }
.toast progress::-webkit-progress-value { background: #0b7a65; transition: width .9s linear; }
.toast progress::-moz-progress-bar { background: #0b7a65; }
.toast.blocked, .toast.failed { background: var(--gold); border-color: #fff; }
.out { text-decoration: underline; }
.out svg { display: inline; margin-left: 3px; vertical-align: -1px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stale { color: var(--gold); }
.foot { max-width: 1180px; margin: 0 auto; padding: 14px 16px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot p { margin: 4px 0; }
.foot a { color: var(--gold); text-decoration: underline; }
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

.standouts ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.standouts li a { position: relative; display: grid; gap: 10px; height: 100%; padding: 14px 12px 12px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold); }
.standouts .place-1 a { border-color: var(--gold); box-shadow: 0 0 18px -4px var(--gold); }
.standouts .place { position: absolute; top: 4px; right: 8px; color: var(--gold); font-weight: 800; }

.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > span { min-width: 0; }
.who b, .who small { display: block; overflow-wrap: anywhere; }
.class-icon { flex: none; border: 1px solid #000; }
.c-warrior { color: #c69b6d; } .c-paladin { color: #f48cba; } .c-hunter { color: #aad372; } .c-rogue { color: #fff468; } .c-priest { color: #fff; }
.c-shaman { color: #3d8bea; } .c-mage { color: #3fc7eb; } .c-warlock { color: #9a9bef; } .c-druid { color: #ff7c0a; }

.row-score { display: grid; gap: 4px; align-content: center; }
.score-n { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.score-n b { font-size: 19px; color: var(--gold); font-variant-numeric: tabular-nums; }
.bar { width: 100%; height: 6px; }
.bar .track { fill: var(--panel-2); }
.bar .fill { fill: var(--gold); }
.nolist { color: var(--muted); font-size: 13px; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 8px; }
.chips, .picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
input, select, .chip { min-height: 36px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; }
input { width: 170px; padding: 0 10px; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; padding: 0 10px; cursor: pointer; }
.chip:has(img) { padding: 3px; }
.chip img { opacity: .55; }
.chip[aria-pressed="true"] { border-color: var(--gold); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--gold); }
.chip[aria-pressed="true"] img { opacity: 1; }
.pick { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.has-help { cursor: help; text-decoration: underline dotted; }
/* A small gear slot, big enough that the same corner badges as on the icons leave it showing. */
.key { position: relative; width: 18px; height: 18px; border: 2px solid var(--line); background: #0a0d13; }
.key.bis { border-color: var(--gold); box-shadow: 0 0 7px var(--gold); }
.key.ranked { border-color: var(--teal); }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 16px 0 10px; }
.head h1 { margin: 0; }
.fights { display: inline-flex; flex: none; border: 1px solid var(--line); }
.fights button { min-width: 52px; min-height: 34px; background: var(--panel); border: 0; color: var(--muted); font: inherit; cursor: pointer; }
.fights button + button { border-left: 1px solid var(--line); }
.fights button[aria-pressed="true"] { background: var(--gold); color: #10141c; font-weight: 700; }
.toggles { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.sets button { padding: 0 12px; }
.slot.away::before, .key.away::before { content: ""; position: absolute; z-index: 1; left: -4px; bottom: -4px; width: 11px; height: 11px; border: 1px solid var(--text); border-radius: 50%;
	background: linear-gradient(var(--text), var(--text)) 4px 2px / 1px 4px no-repeat, linear-gradient(var(--text), var(--text)) 4px 5px / 3px 1px no-repeat, #000; }
.away-note { color: var(--text); }
.others { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.others li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 8px; background: var(--panel); border: 1px solid var(--line); }
.others li > span:last-child { min-width: 0; }
.others b, .others small { display: block; font-size: 13px; overflow-wrap: anywhere; }
.group { margin-top: 22px; }
.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 180px minmax(0, 1fr) 112px 92px 76px; gap: 10px; align-items: center; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-top: 0; }
.row:hover { background: var(--panel-2); }
.strip { position: relative; display: flex; flex-wrap: wrap; gap: 3px; }
/* Being read again: the old gear stays, dimmed, under a throbber. */
.doll { position: relative; }
.row.updating .strip > .slot, .doll.updating > div { opacity: .25; }
.row.updating .strip::after, .doll.updating::after { content: "Updating…"; position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 4px 14px 4px 34px; white-space: nowrap;
	background: #f4f6fb; color: #10141c; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 18px; pointer-events: none; }
.row.updating .strip::before, .doll.updating::before { content: ""; position: absolute; z-index: 3; left: calc(50% - 45px); top: calc(50% - 7px); width: 14px; height: 14px; border: 2px solid #0b7a65; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; pointer-events: none; }
.doll.updating::after { top: 28px; }
.doll.updating::before { top: 21px; }
@media (prefers-reduced-motion: reduce) { .row.updating .strip::before, .doll.updating::before, .update.busy::before { animation-duration: 3s; } }
.slot { position: relative; display: inline-block; flex: none; border: 2px solid var(--line); background: #0a0d13; line-height: 0; cursor: default; }
.strip .slot.empty { width: 32px; height: 32px; border-style: dashed; }
.slot.bis { border-color: var(--gold); box-shadow: 0 0 7px var(--gold); }
.slot.ranked { border-color: var(--teal); }
.slot.bare::after, .key.bare::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border: 1px solid #000; border-radius: 50%; background: var(--bare); }
.slot:hover img, .talent:hover img { filter: brightness(1.25); }
.row-ench { font-variant-numeric: tabular-nums; }
.bare-count { color: var(--bare); font-weight: 700; cursor: help; }
.done { color: var(--teal); }
.row-seen { display: grid; color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }

.back { display: inline-block; margin: 14px 0; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.sheet-head .row-score { width: 170px; flex: none; }
.sheet { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sheet h2 { margin-top: 0; }
.doll { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 14px; background: var(--panel); border: 1px solid var(--line); }
.doll > div { display: grid; gap: 8px; align-content: start; }
.doll .doll-bottom { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 8px; border-top: 1px solid var(--line); }
.doll-slot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.doll-slot .slot.empty { width: 48px; height: 48px; border-style: dashed; }
.doll-slot > span:last-child { min-width: 0; }
.doll-slot b, .doll-slot small { display: block; font-size: 13px; overflow-wrap: anywhere; }
.targets { margin: 0; padding: 0; list-style: none; }
.targets li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; }
.targets li:last-child { border-bottom: 1px solid var(--line); }
.targets .slot.empty { width: 36px; height: 36px; border-style: dashed; }
.t-slot { width: 62px; flex: none; color: var(--muted); font-size: 12.5px; }
.arrow { color: var(--muted); }
.slot.target { border-color: var(--gold); }
.t-what { flex: 1; min-width: 0; }
.t-what b, .t-what small { display: block; overflow-wrap: anywhere; }
.targets a { flex: none; padding: 8px; color: var(--muted); }
.full { color: var(--gold); font-weight: 700; }
.trees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.tree { padding: 0 12px 14px; background: var(--panel); border: 1px solid var(--line); }
.talents { display: flex; flex-wrap: wrap; gap: 10px; }
.talent { position: relative; border: 2px solid var(--gold); line-height: 0; }
.talent i { position: absolute; right: -6px; bottom: -6px; min-width: 15px; background: #000; border: 1px solid var(--line); color: var(--gold); font: normal 700 11px/14px system-ui; text-align: center; }

.tip { position: absolute; z-index: 30; width: max-content; max-width: min(320px, calc(100vw - 8px)); padding: 9px 11px; pointer-events: none;
	background: rgba(8, 10, 24, .97); border: 1px solid #6a7186; border-radius: 4px; color: #fff; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.6); }
.tip[hidden] { display: none; }
.tip-name { font-size: 15px; font-weight: 600; }
.tip-row { display: flex; justify-content: space-between; gap: 18px; }
.tip-p { margin-top: 4px; }
.tip-icon { display: inline; margin-right: 5px; border: 1px solid #000; vertical-align: -4px; }
.dps-only { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.tip-note { margin-top: 6px; padding-top: 5px; border-top: 1px solid #333c52; color: var(--muted); }
.t-q { color: #ffd100; } .t-q0, .t-poor { color: #9d9d9d; } .t-q1, .t-common { color: #fff; } .t-q2, .t-uncommon { color: #1eff00; }
.t-q3, .t-rare { color: #0070dd; } .t-q4, .t-epic { color: #a335ee; } .t-q5, .t-legendary { color: #ff8000; } .t-q8 { color: #ffff98; }
.q-poor { color: #9d9d9d; } .q-common { color: #fff; } .q-uncommon { color: #1eff00; } .q-rare { color: #4a9cf0; } .q-epic { color: #bd6cf5; } .q-legendary { color: #ff8000; }

@media (max-width: 1060px) {
	.standouts ol, .sheet, .trees { grid-template-columns: minmax(0, 1fr); }
	.row { grid-template-columns: minmax(0, 1fr) 120px; gap: 8px 12px; }
	.row-who { grid-column: 1; grid-row: 1; }
	.row-score { grid-column: 2; grid-row: 1; }
	.strip { grid-column: 1 / -1; grid-row: 2; }
	.row-ench { grid-column: 1; grid-row: 3; }
	.row-seen { grid-column: 2; grid-row: 3; }
	.standouts .row-score { grid-column: auto; grid-row: auto; }
}
@media (max-width: 520px) {
	.doll, .doll .doll-bottom { grid-template-columns: minmax(0, 1fr); }
	input { width: 100%; }
	/* The button sits anywhere in a wrapped header: the menu spans the screen under the header instead. */
	.top { position: relative; }
	.export { position: static; }
	.export-menu { left: 8px; right: 8px; top: 100%; width: auto; }
	.t-slot { display: none; }
	.standouts ol { gap: 6px; }
	.standouts li a { grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; padding: 8px 26px 8px 8px; border-top-width: 1px; border-left: 3px solid var(--gold); }
	.strip { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); justify-items: center; }
	.strip .slot img { width: 28px; height: 28px; }
	.chips { gap: 4px; }
	.chip:has(img) { min-width: 0; min-height: 32px; padding: 1px; }
	.chip img { width: 26px; height: 26px; }
}
