/* WoW Forever talent calculator (ATH). Colours come from the theme's variables, so light and dark both follow the site toggle. */
.wft {
	--wft-paper: var(--almanac-bg-paper, #fbf8ef);
	--wft-panel: var(--almanac-bg-cream, #f3eedf);
	--wft-panel-2: var(--almanac-bg-mist, #ebe6d6);
	--wft-line: var(--almanac-border, #ddd5c0);
	--wft-line-2: var(--almanac-border-strong, #b9ae92);
	--wft-ink: var(--almanac-fg-primary, #1a1a1a);
	--wft-ink-2: var(--almanac-fg-secondary, #4a4a4a);
	--wft-ink-3: var(--almanac-fg-tertiary, #6b6b6b);
	--wft-gold: var(--almanac-yellow, #ffd700);
	--wft-gold-deep: var(--almanac-yellow-deep, #c9a400);
	--wft-on-gold: var(--almanac-on-yellow, #231a00);
	--wft-open: #2f9e44;
	--wft-r: var(--almanac-radius-md, 8px);
	container-type: inline-size;
	margin: 1.5rem 0 2rem;
	color: var(--wft-ink);
	font-size: 15px;
	line-height: 1.45;
}
[data-almanac-theme="dark"] .wft { --wft-open: #51cf66; }
.wft *, .wft *::before, .wft *::after { box-sizing: border-box; }

/* class picker */
.wft-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin: 0 0 12px; }
.wft-class {
	display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px;
	border: 1px solid var(--wft-line); border-radius: var(--wft-r); background: var(--wft-panel);
	color: var(--wft-ink) !important; text-decoration: none !important; font-weight: 600; font-size: 14px;
}
.wft-class img { width: 28px; height: 28px; border-radius: 6px; flex: none; }
.wft-class:hover { border-color: var(--wft-line-2); }
.wft-class[aria-current="true"] { background: var(--wft-gold); border-color: var(--wft-gold-deep); color: var(--wft-on-gold) !important; }
.wft-class:focus-visible, .wft-btn:focus-visible, .wft-tab:focus-visible, .wft-t:focus-visible, .wft-tree__reset:focus-visible { outline: 3px solid var(--almanac-info, #1b58c4); outline-offset: 2px; }

/* bar */
.wft-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 12px; border: 1px solid var(--wft-line); border-radius: var(--wft-r); background: var(--wft-panel); margin-bottom: 12px; }
.wft-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.wft-stat { display: flex; flex-direction: column; }
.wft-stat__k { font-size: 12px; color: var(--wft-ink-3); }
.wft-stat__v { font-size: 16px; font-variant-numeric: tabular-nums; }
.wft-btns { display: flex; gap: 8px; }
.wft-btn {
	min-height: 40px; padding: 0 14px; border-radius: var(--wft-r); border: 1px solid var(--wft-gold-deep);
	background: var(--wft-gold); color: var(--wft-on-gold); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.wft-btn--ghost { background: transparent; color: var(--wft-ink); border-color: var(--wft-line-2); }
.wft-btn:disabled { opacity: .45; cursor: default; }

/* tabs: only in the narrow layout */
.wft-tabs { display: none; }

/* trees */
.wft-trees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wft-tree { border: 1px solid var(--wft-line); border-radius: var(--wft-r); background: var(--wft-panel); padding: 8px 8px 10px; min-width: 0; }
.wft-tree__hd { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; }
.wft .wft-tree__name { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.2; flex: 1; min-width: 0; color: var(--wft-ink); }
.wft-tree__n { min-width: 28px; padding: 1px 7px; border-radius: 99px; background: var(--wft-panel-2); font-weight: 700; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.wft-tree__reset { border: 0; background: none; color: var(--wft-ink-3); font: inherit; font-size: 12px; padding: 4px; cursor: pointer; text-decoration: underline; }
.wft-tree__reset:disabled { visibility: hidden; }
.wft-grid {
	position: relative; display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), auto);
	aspect-ratio: var(--cols) / var(--rows);
}
.wft-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wft-arr { fill: none; stroke: var(--wft-line-2); stroke-width: 6; }
.wft-arrhd { fill: var(--wft-line-2); }
.wft-arr.is-on { stroke: var(--wft-gold-deep); }
.wft-arrhd.is-on { fill: var(--wft-gold-deep); }

/* talent */
.wft-t {
	position: relative; align-self: center; justify-self: center; width: 68%; aspect-ratio: 1; padding: 0; margin: 0;
	border: 2px solid var(--wft-line-2); border-radius: 9px; background: #111; cursor: pointer; touch-action: manipulation;
	-webkit-tap-highlight-color: transparent; z-index: 1;
}
.wft-t img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: cover; }
.wft-t.is-lock img { filter: grayscale(1) brightness(.55); }
.wft-t.is-lock { border-color: var(--wft-line); cursor: default; }
.wft-t.is-open { border-color: var(--wft-open); }
.wft-t.is-part { border-color: var(--wft-open); box-shadow: 0 0 0 1px var(--wft-open); }
.wft-t.is-max { border-color: var(--wft-gold); box-shadow: 0 0 0 1px var(--wft-gold-deep); }
.wft-t.is-sel { outline: 3px solid var(--almanac-info, #1b58c4); outline-offset: 2px; }
.wft-t__r {
	position: absolute; right: -8px; bottom: -8px; min-width: 26px; padding: 0 4px; border-radius: 6px;
	background: #14110a; color: #f2f2f2; border: 1px solid #000; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums;
}
.wft-t.is-open .wft-t__r, .wft-t.is-part .wft-t__r { color: #7ee08f; }
.wft-t.is-max .wft-t__r { color: #ffd84a; }
.wft-t.is-lock .wft-t__r { color: #9a9a9a; }
.wft-t__g {
	position: absolute; left: -7px; top: -7px; width: 16px; height: 16px; border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #fff6c2 0 18%, #ffd700 40%, #b8860b 100%); border: 1px solid #6b4e00;
}

/* summary */
.wft-sum { margin-top: 12px; }
.wft-sum:empty { display: none; }
.wft .wft-sum__h { font-size: 16px; margin: 0 0 6px; }
.wft .wft-sum__p { margin: 0 0 6px; font-size: 14px; color: var(--wft-ink-2); }

/* tooltip + touch sheet (appended to body, so they carry their own colours) */
.wft-tip, .wft-sheet {
	--wft-gold: var(--almanac-yellow, #ffd700); --wft-gold-deep: var(--almanac-yellow-deep, #c9a400); --wft-on-gold: var(--almanac-on-yellow, #231a00);
	--wft-ink: var(--almanac-fg-primary, #1a1a1a); --wft-line-2: var(--almanac-border-strong, #b9ae92); --wft-r: 8px;
	background: #15130f; color: #ece8de; border: 1px solid #4a4335; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
	font-size: 14px; line-height: 1.45; z-index: 100000;
}
.wft-tip { position: fixed; width: 300px; max-width: calc(100vw - 16px); padding: 12px; pointer-events: none; }
.wft-tip[hidden], .wft-sheet[hidden] { display: none; }
.wft-sheet { position: fixed; left: 8px; right: 8px; bottom: 8px; max-height: 60vh; overflow: auto; padding: 14px; }
.wft-c__hd { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.wft-c__hd img { width: 40px; height: 40px; border-radius: 7px; flex: none; }
.wft-c__name { font-weight: 700; font-size: 15px; color: #fff; }
.wft-c__rank { font-size: 12px; color: #b9b2a2; }
.wft-c__gold { display: inline-block; margin: 2px 0 6px; padding: 1px 8px; border-radius: 99px; background: #ffd700; color: #231a00; font-size: 12px; font-weight: 700; }
.wft-c__req { color: #ff8a80; font-size: 13px; }
.wft-c__req.is-met { color: #b9b2a2; }
.wft-c__next { margin-top: 8px; font-size: 12px; font-weight: 700; color: #b9b2a2; text-transform: uppercase; letter-spacing: .04em; }
.wft-c__txt { margin: 4px 0 0; color: #ffd84a; }
.wft-c__txt.is-next { color: #ece8de; }
.wft-c__btns { display: flex; gap: 8px; margin-top: 12px; }
.wft-sheet .wft-btn { min-width: 56px; min-height: 44px; font-size: 18px; }
.wft-sheet .wft-btn--ghost { color: #ece8de; border-color: #6b6150; }
.wft-sheet .wft-c__close { margin-left: auto; font-size: 14px; }

/* narrow: one tree at a time with tabs */
@container (max-width: 640px) {
	.wft-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
	.wft-tab {
		display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 4px 6px;
		border: 1px solid var(--wft-line); border-radius: var(--wft-r); background: var(--wft-panel); color: var(--wft-ink);
		font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.15;
	}
	.wft-tab[aria-selected="true"] { background: var(--wft-gold); border-color: var(--wft-gold-deep); color: var(--wft-on-gold); }
	.wft-tab__n { padding: 0 6px; border-radius: 99px; background: rgba(0, 0, 0, .1); font-variant-numeric: tabular-nums; }
	.wft-trees { grid-template-columns: 1fr; }
	.wft-tree { display: none; padding: 10px 12px 14px; }
	.wft-tree.is-act { display: block; }
	.wft-grid { max-width: 420px; margin: 0 auto; }
	.wft-classes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.wft-class { padding: 6px; gap: 6px; font-size: 13px; }
	.wft-class img { width: 24px; height: 24px; }
	.wft-stats { gap: 6px 14px; }
}
@media (hover: none) { .wft-tip { display: none !important; } }
