:root {
  color-scheme: dark;
  --bg: #141619;
  --sidebar: #181a1e;
  --surface: #1b1e23;
  --soft: #22252c;
  --field: #16181c;
  --border: #30333a;
  --text: #f4f3f6;
  --muted: #a5a7b2;
  --mint: #b4f4ce;
  --purple: #c8b5fa;
  --radius: 17px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  background: var(--bg);
  color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button, select { color: inherit; }
button, a, input[type="color"] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  display: flex;
  min-height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid #282b31;
  padding: 27px 18px 19px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; font-size: 22px; font-weight: 760; letter-spacing: -.045em; line-height: 1.03; }
.brand-icon {
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: 12px;
  background: var(--mint);
  color: #193527;
  font-size: 27px;
}
.brand-accent { color: var(--mint); }
.brand small { color: var(--muted); display: block; font-size: 9px; letter-spacing: .17em; margin-top: 6px; font-weight: 670; }
.navigation { margin-top: 48px; display: grid; gap: 6px; }
.navigation p { color: var(--muted); padding: 0 10px 5px; font-size: 10px; font-weight: 730; text-transform: uppercase; letter-spacing: .15em; }
.navigation a { padding: 0 10px; min-height: 44px; border-radius: 9px; display: flex; align-items: center; gap: 8px; color: #c2c4cc; font-size: 13px; border: 1px solid transparent; font-weight: 620; }
.navigation a:hover { background: #24272e; }
.navigation a[aria-current="page"] { background: #263831; color: var(--mint); border: 1px solid #385344; }
.nav-icon { width: 21px; color: inherit; text-align: center; font-size: 16px; }
.bolt { font-size: 21px; }
.navigation small { margin-left: auto; color: #a7a9b4; background: #262931; padding: 3px 6px; border-radius: 6px; font-size: 10px; letter-spacing: .01em; }
.account { margin-top: auto; display: grid; gap: 14px; padding-top: 18px; }
.account-profile { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.account-profile > span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; background: #383047; color: var(--purple); font-weight: 700; }
.account-profile strong, .account-profile small { display: block; font-size: 12px; line-height: 1.45; }
.account-profile small { color: var(--muted); }
.account-link { border: 0; background: none; margin: 9px 0 0 39px; color: var(--muted); padding: 3px; font-size: 12px; }
.account-link:hover { color: var(--text); }
.twitch-button { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 41px; border-radius: 9px; background: #302644; color: #ddccff; border: 1px solid #4a3b63; font-size: 12px; font-weight: 690; }
.twitch-button:hover { background: #403156; }
#demo-controls { border-top: 1px solid var(--border); padding-top: 12px; }
#demo-controls p { font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.demo-buttons { display: flex; gap: 6px; }
.demo-buttons button, .secondary, .subtle { border: 1px solid var(--border); background: #23262d; border-radius: 9px; }
.demo-buttons button { flex: 1; font-size: 11px; padding: 6px; color: #d3d4dd; }
.demo-buttons button:hover, .secondary:hover, .subtle:hover { background: #2e333b; border-color: #444a56; }
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 40px 38px 0;
  background: radial-gradient(ellipse 70% 350px at 88% 0%, #212a27 0%, transparent 83%);
}
.main > section, .main > .global-message, .footer { width: min(100%, 1330px); margin-inline: auto; }
.page-header { display: flex; align-items: end; gap: 18px; justify-content: space-between; margin: 2px 0 25px; }
.eyebrow { text-transform: uppercase; color: var(--mint); font-size: 10px; font-weight: 760; letter-spacing: .19em; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.eyebrow span { width: 13px; height: 1px; background: var(--mint); }
.page-header h1 { font-size: clamp(32px, 4.2vw, 55px); font-weight: 750; line-height: 1.05; letter-spacing: -.055em; }
.page-header p:not(.eyebrow) { color: var(--muted); font-size: 14px; margin-top: 11px; line-height: 1.5; }
.pill, .stage-label { display: inline-flex; align-items: center; gap: 7px; color: #cce4d7; border-radius: 100px; border: 1px solid #3b4e44; background: #26332e; white-space: nowrap; }
.pill { font-size: 11px; padding: 6px 10px; margin-bottom: 3px; }
.pill i, .stage-label i, .status-line i { height: 6px; width: 6px; border-radius: 100%; background: #78e5ac; flex: none; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.editor-controls { display: grid; gap: 18px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid #30333b; border-radius: var(--radius); padding: 19px; min-width: 0; box-shadow: 0 4px 16px #080a1019; }
.panel-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.section-icon { flex: 0 0 33px; height: 33px; display: grid; place-items: center; color: var(--purple); background: #302943; border: 1px solid #423556; border-radius: 9px; font-size: 20px; line-height: 1; }
.mint-icon { color: var(--mint); background: #283b33; border-color: #385447; }
.panel h2 { font-size: 17px; font-weight: 710; line-height: 1.2; letter-spacing: -.015em; }
.panel h3 { font-size: 15px; margin-bottom: 10px; }
.panel-heading p { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.35; }
.character-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.character-option { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 69px; padding: 6px 9px 6px 6px; text-align: left; border-radius: 10px; border: 1px solid #363944; color: #e8e7ef; background: #22252b; font-size: 13px; font-weight: 650; }
.character-option:hover { border-color: #71648c; }
.character-option[aria-pressed="true"] { border-color: #9579cb; background: #2f2840; }
.character-option canvas { display: block; width: 52px; height: auto; flex: none; border-radius: 7px; background: #322b46; }
.character-option[data-character="female"] canvas { background: #383040; }
.character-option small { color: #b5acbf; display: block; font-size: 10px; margin-top: 3px; font-weight: 500; }
.character-option i { margin-left: auto; flex: 0 0 13px; height: 13px; border: 1px solid #777284; border-radius: 50%; }
.character-option[aria-pressed="true"] i { background: #c5acf8; border-color: #c5acf8; box-shadow: inset 0 0 0 3px #362a4e; }
.outfit { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; align-items: end; justify-content: space-between; }
.field-label { display: block; color: #c7c9d3; font-size: 11px; font-weight: 690; margin-bottom: 6px; }
.segments { display: flex; gap: 3px; border: 1px solid var(--border); background: var(--field); padding: 3px; border-radius: 8px; }
.segments button { background: transparent; color: var(--muted); border: none; border-radius: 5px; font-size: 11px; font-weight: 630; padding: 5px 9px; }
.segments button[aria-pressed="true"] { background: #393049; color: #e4d5ff; }
.swatches { min-height: 31px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.swatches button, input[type="color"] { height: 20px; width: 20px; padding: 0; border-radius: 50%; flex: none; border: 1px solid #ffffff35; }
.swatches button:hover { transform: translateY(-2px); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #d6d5e0; }
.swatches input[type="color"] { background: conic-gradient(#ea72a4, #ffd776, #9cf0cc, #67b6fb, #a886fe, #ea72a4); cursor: pointer; }
.swatches input[type="color"]::-webkit-color-swatch-wrapper { padding: 5px; }
.swatches input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.violet { background: #a886fe; } .mint { background: #9cf0cc; } .pink { background: #ec72af; } .blue { background: #67b6fb; }
.ink { background: #27223e; } .ink-purple { background: #8c63ec; } .peach { background: #feac7d; } .yellow { background: #ffc955; } .white { background: #fff; }
.cream, .paper-cream { background: #fff9ea; } .paper-lilac { background: #f0e7ff; } .paper-green { background: #def7e7; } .dark { background: #252237; }
.subtle { color: #bdc0cb; padding: 6px 9px; font-size: 11px; min-height: 29px; }
.clear-button { margin-left: auto; }
.tools { padding: 5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: #17191e; border: 1px solid #30333b; border-radius: 9px; margin-bottom: 10px; }
.tools button { border: 1px solid transparent; background: none; border-radius: 6px; min-height: 26px; padding: 3px 7px; color: #bdc0cc; font-size: 11px; font-weight: 620; }
.tools button span { font-size: 14px; }
.tools button[aria-pressed="true"] { background: #382f48; border-color: #4e3e65; color: #e6d6ff; }
.tools button:not(:disabled):hover { background: #2e273b; }
.tools #undo, .tools #redo { font-size: 17px; line-height: 1; padding-inline: 6px; }
.tool-divider { align-self: stretch; width: 1px; background: #2d3038; margin: 4px 2px; }
.brush-size { display: flex; align-items: center; margin-left: auto; gap: 6px; color: #bdc0cc; font-size: 11px; padding: 3px 3px 3px 6px; }
.brush-size input { width: clamp(48px, 6vw, 85px); margin: 0; accent-color: #b99cf1; }
.brush-size output { min-width: 19px; text-align: right; font-variant-numeric: tabular-nums; }
.paper-wrap { border: 1px solid #ffffff26; border-radius: 10px; overflow: hidden; }
.paper-wrap canvas { width: 100%; height: auto; display: block; touch-action: none; cursor: crosshair; }
.palette-row { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 13px; justify-content: space-between; }
.preview-panel { position: sticky; top: 18px; }
.stage {
  position: relative;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 60%, #2e3830 0%, #202927 45%, #161a20 82%);
  border: 1px solid #373e3e;
  border-radius: 12px;
  overflow: hidden;
}
.stage canvas { display: block; width: 100%; height: auto; }
.stage-label { position: absolute; left: 10px; top: 10px; font-size: 10px; padding: 5px 8px; background: #182321de; color: #d0e2d7; }
.secondary, .primary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 12px; text-align: center; font-size: 12px; font-weight: 680; }
.primary { position: relative; border: 1px solid #c3f8d8; border-radius: 9px; background: var(--mint); color: #142c20; min-height: 43px; }
.primary:hover { background: #d1ffe3; }
.primary span { margin-left: 8px; }
.full { width: 100%; }
#play { margin-top: 12px; }
#play span { font-size: 16px; color: var(--mint); line-height: 1; }
.save-block { border-top: 1px solid #30333b; margin-top: 16px; padding-top: 15px; }
.save-block > p:not(.notice) { color: var(--muted); font-size: 11px; margin-top: 9px; line-height: 1.45; }
.notice { margin-top: 10px; border: 1px solid #466853; border-radius: 8px; background: #233b30; padding: 8px 10px; font-size: 12px; color: #d4f3e1; line-height: 1.45; }
.notice.error { background: #472d35; border-color: #6a3c49; color: #ffd1d8; }
.global-message { margin: 0 auto 14px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.admin-grid select, #obs-url { height: 39px; border-radius: 8px; background: var(--field); border: 1px solid var(--border); color: var(--text); padding: 0 9px; width: 100%; min-width: 0; }
.input-action { display: flex; gap: 7px; }
.admin-actions { display: flex; margin-top: 12px; gap: 7px; flex-wrap: wrap; }
.admin-actions .subtle { flex: 0 0 auto; }
.status-line { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin: 12px 0; line-height: 1.35; }
.status-line i { background: #898695; }
.status-line.active i { background: #78e5ac; }
.status-line.pending i { background: #ffc955; }
.divider { margin: 17px 0; border-top: 1px solid var(--border); }
.test-type-label { margin-top: 12px; }
.admin-stage { margin: 12px 0; }
.empty-state { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.empty-state .section-icon { flex-basis: 48px; height: 48px; }
.footer { margin-top: auto; padding: 25px 0 17px; color: #a3a6b0; font-size: 11px; }
.overlay { color-scheme: normal; overflow: hidden; background: transparent; }
.overlay-document { background: transparent; }
.overlay canvas { display: block; width: 100vw; height: 100vh; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .main { padding-inline: 25px; }
  .sidebar { padding-inline: 14px; }
}
@media (max-width: 920px) {
  .editor-grid, .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-panel { position: static; }
  .preview-panel .stage canvas { max-height: 350px; object-fit: contain; }
}
@media (max-width: 630px) {
  .shell { display: block; }
  .sidebar { position: static; min-height: auto; height: auto; padding: 14px; border: 0; border-bottom: 1px solid var(--border); gap: 13px; }
  .navigation { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
  .navigation p { display: none; }
  .navigation a { min-height: 35px; padding-inline: 5px; font-size: 12px; }
  .account { display: flex; flex-wrap: wrap; align-items: center; padding-top: 0; margin-top: 0; gap: 9px 16px; }
  .twitch-button { padding-inline: 9px; min-height: 33px; }
  #demo-controls { border: 0; padding-top: 0; }
  #demo-controls p { margin-bottom: 3px; }
  .account-link { margin: 4px 0 0 40px; }
  .main { padding: 22px 12px 0; }
  .page-header { display: block; }
  .pill { margin-top: 9px; }
  .panel { padding: 13px; }
}
@media (max-width: 355px) {
  .character-option small { display: none; }
  .character-option canvas { width: 36px; }
  .brush-size { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .swatches button:hover { transform: none; }
}


.start-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(22px, 4vw, 64px); align-items: center; padding-block: 35px 25px; }
.start-copy h1 { font-size: clamp(43px, 6.3vw, 91px); line-height: .96; letter-spacing: -.066em; font-weight: 780; }
.start-copy h1 em { color: var(--mint); font-style: normal; }
.start-copy > p:not(.eyebrow, .notice) { max-width: 55ch; margin-top: 17px; color: var(--muted); line-height: 1.55; font-size: 14px; }
.start-stage { border-radius: 23px; box-shadow: 0 12px 55px #080a103b; }
.role-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 28px; }
.role-card { padding: 13px; display: flex; flex-direction: column; gap: 11px; }
.role-card > div { display: flex; gap: 9px; align-items: center; }
.role-card > p { color: var(--muted); font-size: 12px; line-height: 1.45; margin-bottom: auto; }
.role-card .primary span { margin-left: 0; }
.channel-bar { display: flex; align-items: end; gap: 12px 19px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.channel-bar p { font-size: 12px; color: var(--muted); }
.channel-bar select, #viewer-url, .setting-fields input { min-height: 38px; min-width: 0; border-radius: 8px; background: var(--field); border: 1px solid var(--border); color: var(--text); padding-inline: 9px; }
.channel-bar select { width: min(100%, 260px); }
#viewer-url { flex: 1 1 0; width: 100%; }
.setting-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 9px; }
.setting-fields input { display: block; width: 100%; margin-top: 6px; }
@media (max-width: 1120px) {
  .start-grid { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 15px; }
}
@media (max-width: 880px) {
  .start-grid { grid-template-columns: 1fr; }
  .start-stage canvas { max-height: 440px; object-fit: contain; }
}
@media (max-width: 445px) {
  .role-options { grid-template-columns: 1fr; }
}

