/* OBS overlay (/live/overlay/CHANNEL). Options arrive as URL parameters; see product.js overlayOptions. */
@font-face { font-family: "Fredoka"; font-weight: 400 700; font-display: swap; src: url(fonts/fredoka-latin.woff2) format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 400 900; font-display: swap; src: url(fonts/nunito-latin.woff2) format("woff2"); }
:root { font-family: "Nunito", "Segoe UI", sans-serif; }
html, body { margin: 0; background: transparent; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Independent colours; accent remains a fallback for older overlay URLs. */
/* Night's header matches the site's page headers (their gradient, under the header's own light-to-dark shading). */
.live-overlay { --header: #995c2c; --bar: #a6ef2e; --accent: #ffc56b; --graph: var(--accent); --level: var(--accent); --text: var(--accent);
  --panel: #232c3e; --panel-edge: #4b3423; --ink: #f4ebdc; --muted: #aab3c4; --line: #3a465d; --track: #19212f; --badge: #2b354a; --bar-text: #fff; --bar-shadow: 0 1px 0 #10180a, 1px 0 0 #10180a, -1px 0 0 #10180a, 0 -1px 0 #10180a, 0 2px 3px #000b; }
.live-overlay[data-theme="day"] { --header: #8a6440; --bar: #7fcc12; --accent: #a8520a; --level: #ffb534;
  --panel: #fff9e9; --panel-edge: #725b43; --ink: #493b30; --text: var(--accent); --muted: #7a6855; --line: #d9ccb7; --track: #e8deca; --badge: #6e5139; --bar-text: #263310; --bar-shadow: 0 1px #f5ffc280; }

.live-overlay[data-theme="red"] { --panel:#301f26; --header:#8c3547; --graph:#ff9b9b; --bar:#ef6575; --accent:#ffb4b4; --level:#ffd5bd; --badge:#542b38; --panel-edge:#693847; }
.live-overlay[data-theme="green"] { --panel:#1c3029; --header:#32684e; --graph:#8fe0b2; --bar:#70ce82; --accent:#b1ebc6; --level:#e4f3b0; --badge:#294b3b; --panel-edge:#385e4b; }
.live-overlay[data-theme="blue"] { --panel:#1d2b40; --header:#335e91; --graph:#8fc9ff; --bar:#66b5ef; --accent:#b4d9ff; --level:#d4e9ff; --badge:#2b4566; --panel-edge:#3b5475; }
.live-overlay[data-theme="purple"] { --panel:#2a233b; --header:#62458c; --graph:#c4a1ff; --bar:#ad87ef; --accent:#dbc4ff; --level:#f1d5ff; --badge:#45335e; --panel-edge:#5b4675; }

.live-overlay[data-panel-ink="dark"] { --ink: #000; --muted: #000; --line: #0003; --track: #0002; }
.live-overlay[data-panel-ink="light"] { --ink: #fff; --muted: #fff; --line: #fff3; --track: #0003; }

#card { width: 490px; margin: 5px; display: flex; flex-direction: column; overflow: hidden;
  color: var(--ink); background: var(--background, var(--panel)); border: 2px solid var(--panel-edge); border-radius: 14px; box-shadow: 0 3px 0 #0000004d; }
[data-layout="card"] #card, [data-layout="bar"] #card { height: 150px; }
[data-layout="rates"] #card { height: 100px; }
[data-layout="chart"] #card { height: 170px; }
[data-layout="card"] :is(.rate-stats, .hour-chart), [data-layout="bar"] :is(.rate-stats, .hour-chart),
[data-layout="rates"] :is(.reading, .general-stats, .hour-chart),
[data-layout="chart"] :is(.reading, .general-stats, .rate-stats) { display: none; }

header { display: flex; align-items: center; gap: 7px; height: 28px; flex: none; padding: 0 12px 0 9px; color: #fff3dc;
  background: linear-gradient(#ffffff26, #0000001f), var(--header); border-bottom: 2px solid #0000004d; }
[data-header-ink="dark"] header { color: #000; }
[data-header-ink="dark"] :is(.brand, #character) { text-shadow: none; }
.charm { flex: none; filter: drop-shadow(0 1px 0 #0006); }
[data-icon="off"] .charm { display: none; }
[data-icon="off"] header { padding-left: 12px; }
/* No title: the name moves to the left, where the title was. */
[data-title="none"] :is(.brand, .charm) { display: none; }
[data-title="none"] header { padding-left: 12px; }
[data-title="none"] .identity { justify-content: flex-start; }
.brand { flex: none; font: 600 13px/1 "Fredoka", sans-serif; letter-spacing: .3px; text-shadow: 0 1px 0 #0000004d; }
.identity { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; flex: 1; min-width: 0; }
#character { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 15px/1.3 "Fredoka", sans-serif; text-shadow: 0 1px 0 #0000004d; }  /* 1.3: at 1 the clipped box cut off the tails of g, p, y. */
#streamer { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; opacity: .85; }
.separator { opacity: .6; font-size: 11px; }
[data-name="character"] :is(#streamer, .separator), [data-name="twitch"] :is(#character, .separator), [data-name="none"] .identity { display: none; }
[data-name="twitch"] #streamer { max-width: 100%; font-size: 13px; }
#overlay-job { flex: none; font-size: 11px; font-weight: 600; opacity: .8; white-space: nowrap; }
[data-job="off"] #overlay-job, #overlay-job:empty, [data-name="twitch"] #overlay-job { display: none; }

.reading { display: flex; align-items: center; gap: 8px; padding: 7px 10px 0; font-variant-numeric: tabular-nums; }
#level { flex: none; min-width: 64px; padding: 0 8px; text-align: center; line-height: 32px; border-radius: 8px; background: var(--badge); color: var(--level);
  font: 600 16px/32px "Fredoka", sans-serif; box-shadow: inset 0 -2px #0000004d; }
#level[data-last-known="true"] { outline: 1px dashed var(--accent); outline-offset: -3px; }
.progress-section { position: relative; flex: 1; min-width: 0; }
progress { display: block; width: 100%; height: 32px; margin: 0; border: 1px solid #0000004d; border-radius: 8px; overflow: hidden; background: var(--track); appearance: none; }
progress::-webkit-progress-bar { background: var(--track); }
progress::-webkit-progress-value { background: linear-gradient(#ffffff59, #ffffff00 60%), var(--bar); }
progress::-moz-progress-bar { background: var(--bar); }
#card[data-stale="true"] progress { opacity: .65; }
.progress-label { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 5px; white-space: nowrap; pointer-events: none;
  color: var(--bar-text); text-shadow: var(--bar-shadow); font-size: 13px; font-weight: 800; }
.caption { font-size: 10px; font-style: italic; letter-spacing: .5px; }
.mini-history, .general-history-caption { display: none; }
[data-layout="card"] #progress { display: none; }
[data-layout="card"] .progress-label > :not(.general-history-caption) { display: none; }
[data-layout="card"] .progress-label { position: static; height: 14px; justify-content: flex-start; color: var(--ink); text-shadow: none; }
[data-layout="card"] .general-history-caption { display: inline; margin-left: auto; color: var(--muted); font-size: 9px; }
[data-layout="card"] .mini-history { display: block; width: 100%; height: 20px; }
.mini-history .bar { fill: var(--graph); }
.mini-history .none { fill: var(--muted); opacity: .45; }
[data-layout="card"] .general-stats { padding-top: 4px; }
#exp { font-size: 15px; }
#exp[data-size="long"] { font-size: 12px; }

.statistics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 12px 0; }
.stat { min-width: 0; padding: 0 8px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.stat strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 600 20px/26px "Fredoka", sans-serif; font-variant-numeric: tabular-nums; }
.stat strong[data-size="long"] { font-size: 14px; }
/* Saved (not live) values stay readable; the status line says how old they are. */
.stat strong[data-paused="true"], #rate[data-paused="true"] { opacity: .9; }
.stat strong { color: var(--text); }

.hour-chart { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 12px 0; }
.hour-caption { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
#hour-total { color: var(--text); font: 600 15px/1 "Fredoka", sans-serif; letter-spacing: 0; text-transform: none; }
#overlay-chart { display: block; width: 100%; flex: 1; min-height: 0; margin-top: 4px; }
#overlay-chart .bar { fill: var(--graph); }
#overlay-chart .none { fill: var(--muted); opacity: .45; }
#overlay-chart .base { stroke: var(--line); stroke-width: 1; }
/* EXP chart layout: two y-axis values with faint guides and the peak bar's value. */
#overlay-chart text { font: 700 9px "Nunito", sans-serif; font-variant-numeric: tabular-nums; }
#overlay-chart .axis { fill: var(--muted); }
#overlay-chart .grid { stroke: var(--line); stroke-dasharray: 2 3; }
#overlay-chart .peak { fill: var(--text); font-weight: 800; }

footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 0 12px 5px; height: 21px; color: var(--muted); font-size: 10px; font-weight: 700; }
#age { flex: 1; min-width: 0; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; opacity: .85; }
#age:empty { display: none; }

/* Only the builder preview receives this marker; pop-outs and OBS URLs stay clean. */
.live-overlay [data-stat-highlight] { outline:1px solid color-mix(in srgb, var(--text) 45%, transparent); outline-offset:2px; border-radius:3px; background:color-mix(in srgb, var(--text) 7%, transparent); }

[data-layout="card"][data-showlevel="off"] #level { display:none; }
