/* Local redesign experiment. Keep the existing application behavior and IDs. */
:root { --radius: 10px; }
body { background: var(--bg-primary); }
button { border-radius: 6px; font-weight: 600; }
button:hover:not(:disabled) { transform: none; box-shadow: none; }
.energy-panel::before, .energy-panel::after { display: none; }
body.workspace-open .app-shell { padding: 0; max-width: none; }
body.workspace-open .app-header { flex-basis: 40px; min-height: 40px; padding: 0 18px; background: var(--bg-primary); border-bottom: 1px solid var(--border-soft); }
body.workspace-open .brand-lockup { gap: 9px; }
body.workspace-open .mark { width: 24px; height: 24px; font-size: 15px; }
.mark::before { border-radius: 8px; transform: none; }
.mark > span { display: none; }
body.workspace-open .brand-lockup h1 { font-size: 13px; letter-spacing: -.3px; }
.private-label { gap: 9px; }
.preview-label { font-size: 8px; letter-spacing: .1em; color: var(--accent-violet); padding: 3px 6px; border: 1px solid var(--accent-deep); border-radius: 4px; margin-left: 10px; }
.workspace { gap: 0; grid-template-columns: 252px minmax(360px, 1fr) 320px; }
body.chat-collapsed .workspace { grid-template-columns: 252px minmax(360px, 1fr); }
.workspace > .panel { border: 0; border-radius: 0; box-shadow: none; }
.workspace > .sidebar { position: relative; }
.workspace > .sidebar::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0 0 0 auto;
  width: 2px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom,
    transparent 0%,
    transparent 24%,
    var(--accent-violet) 48%,
    var(--accent-violet) 65%,
    transparent 100%) 0 -220px / 100% 180px no-repeat;
  filter: drop-shadow(0 0 1px var(--accent-violet));
  animation: divider-wave 9s linear infinite;
}
@keyframes divider-wave {
  0% { background-position-y: -220px; opacity: 0; }
  12% { opacity: .35; }
  75% { opacity: .35; }
  100% { background-position-y: calc(100% + 220px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace > .sidebar::after { animation: none; background-position-y: 50%; opacity: .3; }
}
@media (max-width: 620px) {
  .workspace > .sidebar::after { display: none; }
}
.sidebar { background: var(--bg-secondary); padding: 0 12px; border-right: 1px solid color-mix(in srgb, var(--accent-violet) 45%, transparent) !important; }
.room-context { min-height: 66px; flex-direction: row-reverse; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 12px 4px; margin: 0 0 22px; }
.room-context strong { font-size: 14px; line-height: 1.4; }
.room-context button { font-size: 10px; padding: 5px; min-height: 28px; }
.sidebar > .panel-heading { color: var(--text-muted); padding: 0 8px 10px; }
.sidebar > .panel-heading h2 { font-size: 10px; letter-spacing: .12em; }
.sidebar > .panel-heading .icon { width: 14px; }
.member-row { border: 0; border-radius: 6px; padding: 10px 8px; margin-bottom: 2px; gap: 10px; }
.member-row:hover { background: var(--surface-hover); }
.member-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-elevated); border: 0; color: var(--accent-violet); font-size: 12px; }
.member-identity strong { font-size: 13px; font-weight: 550; }
.member-identity > span { font-size: 10px; }
.member-badges { padding-left: 44px; }
.voice-panel { margin: 0 -12px; padding: 15px 16px; background: var(--bg-primary); border-top: 1px solid var(--border); }
.voice-toolbar button { min-height: 32px; font-size: 11px; }
.voice-heading h2 { font-size: 13px; }
.voice-emblem { background: var(--success-glow); border-color: var(--success-glow); color: var(--success); }
.voice-preferences summary { font-size: 11px; }
.voice-empty { font-size: 10px; }
.account-menu { margin: 0 -12px; padding: 9px; background: var(--bg-primary); border-top: 1px solid var(--border-soft); }
.account-card { padding: 8px; border: 0; background: transparent; }
.account-avatar { border-radius: 50%; width: 34px; height: 34px; }
.account-identity > .eyebrow { display: none; }
.account-identity > strong { font-size: 12px; }
.stage { padding: 0 24px 18px; background: var(--surface); }
.stage-heading { min-height: 66px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.stage-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 650; }
.channel-hash { font-size: 24px; font-weight: 400; color: var(--text-muted); }
.transmission-state { font-size: 11px; margin-left: 28px; }
.stage-heading .compact-button { font-size: 10px; }
.stream-toolbar { flex: none; margin: 16px 0; justify-content: space-between; }
.view-modes { background: var(--bg-primary); border: 1px solid var(--border); padding: 3px; border-radius: 7px; }
.mode-button { min-height: 30px; padding: 7px 13px; font-size: 11px; }
.mode-button.active { background: var(--surface-hover); color: var(--text-primary); border-color: transparent; box-shadow: none; }
.watching-label { font-size: 10px; color: var(--text-muted); }
.stream-placeholder { position: relative; flex: 1; min-height: 240px; background: radial-gradient(ellipse at 50% 38%, var(--accent-wash), transparent 60%), var(--video-bg); border: 1px dashed var(--border); border-radius: 12px; gap: 12px; padding: 30px 20px; }
.empty-orbit { position: relative; width: 82px; height: 82px; margin-bottom: 12px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 24px; background: var(--accent-wash); transform: rotate(-6deg); }
.empty-orbit .icon { width: 36px; height: 36px; color: var(--accent-violet); transform: rotate(6deg); }
.orbit-dot { position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--success); border: 3px solid var(--video-bg); }
.stream-placeholder .eyebrow { font-size: 9px; letter-spacing: .18em; color: var(--accent-violet); }
.stream-placeholder h3 { font-size: clamp(23px, 2.5vw, 34px); font-weight: 700; letter-spacing: -.8px; color: var(--text-primary); }
.stream-placeholder p { font-size: 13px; line-height: 1.8; text-align: center; color: var(--text-secondary); }
.empty-flow { display: flex; align-items: center; gap: 16px; margin-top: 20px; color: var(--text-secondary); font-size: 10px; }
.empty-flow b { padding: 4px 5px; border-radius: 4px; background: var(--bg-elevated); color: var(--accent-violet); margin-right: 5px; font-size: 9px; }
.flow-arrow { color: var(--text-muted); }
.stage-actions { position: relative; flex: none; padding: 16px 0 0; gap: 10px; border: 0; }
.stage-actions > #broadcast { order: -2; min-height: 40px; padding-inline: 18px; font-size: 12px; }
.stage-actions > #stop-broadcast { order: -2; }
.stage-actions > #bets-open { margin-left: auto; font-size: 11px; min-height: 38px; background: transparent; border: 0; color: var(--text-secondary); }
.broadcast-settings > summary { display: flex; gap: 7px; align-items: center; padding: 10px; font-size: 11px; list-style: none; border-radius: 6px; }
.broadcast-settings > summary::-webkit-details-marker { display: none; }
.broadcast-settings[open] > summary, .broadcast-settings > summary:hover { background: var(--surface-hover); }
.broadcast-settings .icon { width: 15px; height: 15px; }
.broadcast-settings-popover { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 12; width: min(345px, 100%); padding: 22px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 44px #0006; }
.broadcast-settings-popover h3 { margin: 7px 0; font-size: 17px; }
.broadcast-settings-popover p { font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.broadcast-settings-popover .quality-controls { margin: 18px 0; display: flex; flex-wrap: wrap; gap: 12px; }
.broadcast-settings-popover .quality-controls label { flex: 1; font-size: 11px; }
.broadcast-settings-popover .quality-controls select { margin-top: 7px; min-height: 38px; font-size: 12px; width: 100%; }
.broadcast-settings-popover small { font-size: 10px; color: var(--text-muted); line-height: 1.5; }
.chat-panel { padding: 0 16px 16px; background: var(--bg-secondary); border-left: 1px solid var(--border-soft) !important; }
.chat-panel > .panel-heading { min-height: 66px; border-bottom: 1px solid var(--border); }
.chat-panel > .panel-heading h2 { font-size: 13px; }
.chat-panel > .panel-heading .icon { color: var(--accent-violet); }
.chat-history { margin-top: 12px; }
#chat-messages > li { padding: 12px 8px; border: 0; border-radius: 6px; }
#chat-messages > li:hover { background: var(--surface-hover); }
#chat-messages strong { color: var(--accent-violet); font-size: 12px; }
#chat-messages p { font-size: 12px; line-height: 1.65; }
#chat-messages time { font-size: 9px; }
#chat-form { padding-top: 12px; border: 0; }
#chat-input { background: var(--bg-elevated); border: 1px solid var(--border); min-height: 78px; border-radius: 8px; font-size: 12px; }
.compose-footer { margin-top: 10px; }
.compose-footer button { font-size: 11px; border-radius: 6px; }
body.workspace-open .status-bar { flex-basis: 24px; min-height: 24px; padding: 3px 14px; background: var(--bg-primary); font-size: 9px; }
.stream-tile { border-color: var(--border); background: var(--bg-secondary); box-shadow: none; }
.stream-list { padding-block: 12px; }
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 218px minmax(300px, 1fr) 270px; }
  body.chat-collapsed .workspace { grid-template-columns: 218px minmax(300px, 1fr); }
  .stage { padding-inline: 16px; }
  .watching-label { display: none; }
}
@media (max-width: 900px) {
  .workspace, body.chat-collapsed .workspace { grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: 'members stage'; }
  body:not(.chat-collapsed) .chat-panel { position: absolute; right: 0; top: 40px; bottom: 24px; width: min(320px, calc(100vw - 40px)); z-index: 15; box-shadow: -20px 0 50px #0007; }
  .empty-flow { flex-direction: column; gap: 12px; }
  .flow-arrow { display: none; }
}
@media (max-width: 620px) {
  body.workspace-open { height: auto; overflow: auto; }
  body.workspace-open .app-shell { height: auto; min-height: 100dvh; overflow: visible; }
  .workspace, body.chat-collapsed .workspace { display: flex; flex-direction: column; overflow: visible; }
  .sidebar { max-height: 360px; flex: none; }
  #members { min-height: 60px; max-height: 100px; }
  .room-context { min-height: 48px; margin-bottom: 12px; }
  .stage { min-height: 580px; overflow: visible; }
  body:not(.chat-collapsed) .chat-panel { position: static; width: 100%; min-height: 440px; box-shadow: none; }
  .sidebar .room-context { display: flex; }
  .stream-placeholder { min-height: 340px; }
  .stage-actions { gap: 4px; }
  .stage-actions > #broadcast { padding-inline: 10px; font-size: 11px; }
  .preview-label { display: none; }
}
