:root {
  --bg: #0b0b0f; --panel: #15141b; --panel2: #1b1a22; --line: #26242f; --text: #ECEAF2; --muted: #9a96a8;
  --accent: #F0E9B0; --good: #7BE0A0; --bad: #FF6F7D; --live: #ff4d5e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Roboto, "Segoe UI", Arial, sans-serif; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }
code { background: #0e0d13; padding: 1px 5px; border-radius: 4px; }
button, .btn { background: var(--accent); color: #111; border: 0; border-radius: 7px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.small { padding: 5px 10px; font-size: 13px; }
button.big { padding: 12px 22px; font-size: 16px; }
button.danger { border-color: #5a2a33; color: #ffb3bd; }
button:disabled { opacity: .45; cursor: default; }
button.is-live { background: var(--live); color: #fff; }
.row { display: flex; gap: 10px; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; }

/* brand: the overlay's pride stripe */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 19px; letter-spacing: .2px; }
.stripe-mark { display: inline-flex; flex-direction: column; width: 6px; height: 26px; border-radius: 2px; overflow: hidden; }
.stripe-mark i { flex: 1; }
.stripe-mark i:nth-child(1) { background: #D76E6B; } .stripe-mark i:nth-child(2) { background: #E9BE94; } .stripe-mark i:nth-child(3) { background: #F0E9B0; }
.stripe-mark i:nth-child(4) { background: #6EAA78; } .stripe-mark i:nth-child(5) { background: #4A7BE0; } .stripe-mark i:nth-child(6) { background: #9445A4; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login-card .brand { font-size: 24px; margin-bottom: 6px; }
.steam-btn { display: block; text-align: center; margin-top: 18px; background: #1b2838; color: #fff; border: 1px solid #2a475e; border-radius: 8px; padding: 12px; font-weight: 700; text-decoration: none; }
.steam-btn:hover { background: #2a475e; }
.err { color: var(--bad); min-height: 1.4em; }

/* header + tabs */
.top { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pills { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--good); border-color: #2c5a3e; } .pill.bad { color: var(--bad); border-color: #5a2a33; }
.pill.live { background: var(--live); color: #fff; border-color: var(--live); font-weight: 700; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .7; } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.main-tabs { padding: 12px 16px 0; max-width: 1140px; margin: 0 auto; }
.tabs button { background: var(--panel); color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.tabs button.on { color: #111; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 16px 16px 60px; }
.page { display: none; } .page.on { display: block; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.offline-note { background: #2a1d10; border: 1px solid #5a4020; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }

/* control */
.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.scenes button { background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 500; text-align: left; padding: 12px; min-height: 52px; }
.scenes button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }
.sources { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow: auto; }
.sources li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid #1d1b24; }
.sources li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources li.folder .name { font-weight: 700; }
.sources li.off .name { color: var(--muted); text-decoration: line-through; text-decoration-color: #555; }
.eye { width: 34px; height: 28px; padding: 0; border-radius: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 700; }
.eye.on { background: #23402f; border-color: #2c5a3e; color: var(--good); }
.eye.muted-on { background: #40232a; border-color: #5a2a33; color: var(--bad); }

/* cards page */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.kv .err { color: var(--bad); font-weight: 400; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #1d1b24; }
.links li b { width: 110px; flex: none; }
.links li input { flex: 1; min-width: 0; }

/* settings */
.stage-wrap { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.stage { position: relative; width: 100%; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #2a2d36, #1b1d24 40%, #3a3328); }
.stage iframe { position: absolute; left: 0; top: 0; width: 1000px; height: 200px; border: 0; transform-origin: 0 0; background: transparent; transition: opacity .2s; }
.stage iframe.dim { opacity: .3; } .stage iframe.gone { opacity: 0; pointer-events: none; }
.tools { margin-top: 10px; }
.save-state { font-size: 13px; color: var(--muted); }
.save-state.saving { color: var(--accent); } .save-state.saved { color: var(--good); } .save-state.fail { color: var(--bad); }
#setTabs { margin-bottom: 12px; }
.fpanel { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.fpanel.on { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2px 28px; }
.fpanel .hint { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin: 0 0 10px; }
label.f { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid #1d1b24; }
label.f span { color: var(--muted); }
input[type=text], input[type=password], input[type=number], select { width: 210px; max-width: 60vw; background: #0e0d13; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; }
input[type=color] { width: 44px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #0e0d13; padding: 2px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: #7BE0A0; }
.steps { padding-left: 20px; } .steps li { margin: 4px 0; }
.code { background: #0e0d13; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; font: 13px/1.5 Consolas, monospace; color: #cfe9d6; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #24222c; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px); z-index: 50; }
.toast.bad { border-color: #5a2a33; color: #ffb3bd; }
@media (max-width: 520px) { .kv { grid-template-columns: 100px 1fr; } .links li { flex-wrap: wrap; } .links li b { width: auto; } }

/* card sets editor */
.sets-editor { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; }
.set-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel2); display: flex; flex-direction: column; gap: 10px; }
.set-name { font-weight: 700; width: 220px; }
label.f.inline { border: 0; padding: 0; gap: 8px; } label.f.inline select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: transparent; color: var(--muted); border: 1px dashed var(--line); border-radius: 99px; padding: 5px 12px; font-weight: 500; font-size: 13px; }
.chip.on { background: #2b2a35; color: var(--text); border: 1px solid #3a3846; padding: 4px 6px 4px 12px; }
.mini-btn { background: transparent; color: var(--muted); border: 0; padding: 0 5px; font-size: 15px; line-height: 1; }
.mini-btn:hover { color: var(--text); }
.set-preview { position: relative; width: 100%; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #2a2d36, #1b1d24 40%, #3a3328); }
.set-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* where-to-find-it links on the Accounts tab */
label.f a.help { font-size: 12px; margin-left: 6px; color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
label.f small.tip { display: block; font-size: 12px; color: #77738a; margin-top: 3px; max-width: 46ch; line-height: 1.35; }
.credit { font-size: 12px; color: var(--muted); }

.span-pick { width: auto; padding: 1px 4px; margin: 0 4px; font-size: 12px; background: #1b1a22; }

/* real-size preview frames */
.stage iframe.hidden-frame { display: none; }
.stage iframe.widget-frame { border-radius: 6px; }
.stage iframe.widget-frame.gone { display: none; }
/* design gallery */
.design-editor { grid-column: 1 / -1; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.preset { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel2); }
.preset.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.preset-view { position: relative; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(135deg, #2a2d36, #1b1d24 40%, #3a3328); }
.preset-view iframe { width: 100%; aspect-ratio: 940 / 146; border: 0; display: block; background: transparent; }
.preset-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.preset-foot b { flex: 1; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.tag.anim { color: var(--accent); border-color: #5a5530; }
textarea { width: 100%; max-width: 60vw; background: #0e0d13; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: 14px/1.5 Consolas, monospace; }
label.f:has(textarea) { flex-direction: column; align-items: stretch; grid-column: 1 / -1; }
label.f:has(textarea) textarea { max-width: none; }

input.short { width: 90px; }
.chat-view { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; font-size: 14px; }
.chat-view li { padding: 4px 2px; border-bottom: 1px solid #1d1b24; word-break: break-word; }

/* grouped settings nav */
.tabs.groups { margin-bottom: 8px; }
.tabs.groups button { font-weight: 700; }
.tabs.subtabs { margin: 0 0 12px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.tabs.subtabs button { background: transparent; border-color: transparent; padding: 6px 12px; }
.tabs.subtabs button.on { background: #2b2a35; color: var(--text); border-color: #3a3846; }
/* your themes */
.design-editor h3 { margin: 4px 0 10px; }
.theme-save { margin-bottom: 12px; } .theme-save input { width: 260px; }
/* backgrounds gallery */
.backgrounds-editor { grid-column: 1 / -1; }
.bg-builder { margin-bottom: 12px; } .bg-builder input[type=text] { width: 180px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bg-tile { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel2); }
.bg-tile.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.bg-tile iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #000; }
.links li.link-head { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border: 0; padding-top: 14px; }
