/* client/src/theme.css */
:root {
  --bg: #0b0e14;
  --bg2: #11151f;
  --surface: #ffffff12;
  --surface-strong: #141822eb;
  --glass: #ffffff1a;
  --glass-border: #ffffff38;
  --text: #f2f4f8;
  --muted: #a7b0c0;
  --accent: #ffd23e;
  --green: #37d67a;
  --red: #ff5252;
  --yellow: #ffd23e;
  --blue: #4da3ff;
  --dock-h: 60px;
  --buncss-light: ;
  --buncss-dark: initial;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f5f7;
  --bg2: #e8eaee;
  --surface: #0000000d;
  --surface-strong: #fffffff2;
  --glass: #ffffffa6;
  --glass-border: #0000002e;
  --text: #14181f;
  --muted: #55606f;
  --buncss-light: initial;
  --buncss-dark: ;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

button {
  font: inherit;
  color: inherit;
}

.app {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  height: 100%;
}

.topstrip {
  display: flex;
  background: var(--bg);
  flex: none;
  align-items:  center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
}

.topstrip .spacer {
  flex: 1;
}

.app > .topstrip {
  display: none;
}

.logo-btn {
  display: flex;
  cursor: pointer;
  background: none;
  border: 0;
  align-items:  center;
  padding: 0;
}

.logo-btn img {
  border-radius: 8px;
  width: 34px;
  height: 34px;
}

.house-picker {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  border-radius: 999px;
  max-width: 46vw;
  padding: 7px 12px;
  font-size: 14px;
}

.cast-state {
  color: var(--muted);
  display: flex;
  align-items:  center;
  gap: 6px;
  font-size: 13px;
}

.cast-state .dot {
  background: var(--muted);
  border-radius: 50%;
  width: 9px;
  height: 9px;
}

.cast-state.live .dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.picture-zone {
  position: relative;
  display: flex;
  background: #000;
  flex: auto;
  min-height: 0;
}

.picture-zone canvas, .picture-zone .stage-img {
  display: block;
  width: 100%;
  height: 100%;
}

.dock-wrap {
  display: flex;
  position: relative;
  background: var(--bg);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px));
  flex-direction: column;
  flex: none;
  max-height: 40dvh;
}

.dock {
  display: flex;
  background: var(--bg);
  flex: none;
  align-items:  center;
  gap: 6px;
  padding: 4px 6px;
}

.dock-scroll {
  overflow-y: auto;
  display: flex;
  scrollbar-width: auto;
  flex-direction: column;
  flex: auto;
  min-height: 0;
}

.show-row {
  display: flex;
  flex-direction: row;
  flex: none;
  align-items:  center;
  gap: 6px;
  padding: 6px 6px 0;
}

.play-bar {
  display: flex;
  flex-direction: row;
  flex: none;
  align-items: stretch;
  gap: 6px;
  padding: 6px 6px 0;
}

.play-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  display: flex;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
  flex-direction: column;
  flex: 1.1 1 0;
  justify-content: center;
  align-items:  center;
  gap: 0;
  min-width: 0;
  height: 46px;
  padding: 0 6px;
}

.play-btn.pb-pause {
  flex: .75 1 0;
}

.play-btn:active {
  filter: brightness(1.25);
}

.play-btn.is-paused {
  background: var(--accent);
  border-color: var(--accent);
  color: #141414;
}

.play-btn.is-fight {
  color: #14202b;
  background: #a8d4f0;
  border-color: #a8d4f0;
}

.play-btn.is-fight .play-btn-hint {
  color: #14202ba6;
}

.play-btn.is-fill {
  color: #141414;
  background: #f5b942;
  border-color: #f5b942;
}

.play-btn.is-fill .play-btn-hint {
  color: #141414a6;
}

.play-bar.has-screens {
  flex-wrap: wrap;
}

.play-bar.has-screens .play-btn {
  flex: 45%;
}

.play-btn.is-fit {
  color: #141414;
  background: #ffd23e;
  border-color: #ffd23e;
}

.play-btn.is-fit .play-btn-hint {
  color: #141414a6;
}

.play-btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.15;
}

.play-btn-hint {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: 9.5px;
  line-height: 1.15;
}

.play-btn.is-paused .play-btn-hint {
  color: #141414a6;
}

.save-bar {
  display: flex;
  flex-direction: row;
  flex: none;
  align-items:  center;
  margin-left: auto;
}

.save-pulse {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  border: 1px solid var(--accent);
  color: #ffe9a8;
  text-align: center;
  background: #3a2b12;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  bottom: calc(100% + 6px);
  left: 10px;
  right: 10px;
  box-shadow: 0 4px 18px #0000008c;
}

.save-clock {
  white-space: nowrap;
  color: var(--accent);
  background: #ffd23e14;
  border: 1px solid #ffd23e59;
  border-radius: 999px;
  flex: none;
  padding: 3px 10px;
  font-size: 12.5px;
}

.save-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  display: flex;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
  flex-direction: column;
  flex: auto;
  justify-content: center;
  align-items:  center;
  gap: 0;
  min-width: 0;
  height: 52px;
  padding: 0;
}

.save-btn:active {
  filter: brightness(1.25);
}

.save-btn-label {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
}

.save-btn-hint {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.15;
}

.dock-expand {
  overflow-y: auto;
  display: flex;
  scrollbar-width: thin;
  flex-wrap: wrap;
  flex: 0 auto;
  gap: 8px;
  padding: 8px 6px 2px;
}

.dock.col {
  overflow-y: auto;
  overflow-x: hidden;
  flex-direction: column;
  align-items: stretch;
}

.dock .sep {
  background: var(--glass-border);
  flex: 0 0 1px;
  align-self: stretch;
  margin: 4px 2px;
}

.icon-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: inline-flex;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  position: relative;
  border-radius: 50%;
  flex: none;
  justify-content: center;
  align-items:  center;
  width: 52px;
  height: 52px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.icon-btn.small {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.icon-btn.on {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.icon-btn.off-dim {
  opacity: .55;
  border-style: dashed;
}

.icon-btn:disabled {
  opacity: .35;
  cursor: default;
}

.icon-btn.danger {
  border-color: #ff525299;
}

.icon-btn.cast-btn {
  background: #ff525238;
  border-color: #ff5252a6;
}

.icon-btn .badge {
  position: absolute;
  background: var(--red);
  color: #fff;
  display: flex;
  border-radius: 9px;
  justify-content: center;
  align-items:  center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 11px;
  top: -3px;
  right: -3px;
}

.icon-pop {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  background: var(--surface-strong);
  border: 1px solid var(--glass-border);
  color: var(--text);
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  transform: translate(-50%, -130%);
  box-shadow: 0 6px 24px #00000080;
}

.sheet {
  overflow-y: auto;
  background: var(--bg2);
  border-top: 1px solid var(--glass-border);
  padding: 10px 12px calc(10px + max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px)));
  scrollbar-width: auto;
  flex: none;
  max-height: 30dvh;
}

.sheet.tall {
  max-height: 30dvh;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  margin: 0 0 10px;
  padding: 12px;
}

.card h3 {
  margin: 0 24px 8px 0;
  font-size: 16px;
}

.card p {
  color: var(--muted);
  margin: 4px 0;
  font-size: 14px;
}

.card-x {
  position: sticky;
  float: right;
  z-index: 5;
  border: 1px solid var(--glass-border);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 34px;
  height: 34px;
  font-size: 16px;
  top: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 10px;
}

.row.between {
  justify-content: space-between;
}

.pill {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 15px;
}

.char-pal-grid {
  gap: 8px;
}

.char-pal-btn {
  padding: 6px;
  line-height: 0;
}

.film-strip {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  background: radial-gradient(circle at 8px 5px, #ffffff47 2.2px, #0000 2.6px) 0 0 / 22px 10px repeat-x, radial-gradient(circle at 8px calc(100% - 5px), #ffffff47 2.2px, #0000 2.6px) 0 100% / 22px 10px repeat-x, #0a0c10;
  border-radius: 10px;
  align-items: stretch;
  gap: 8px;
  padding: 12px 8px;
}

.film-strip > * {
  flex: none;
}

.film-tile {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 2px;
  min-width: 84px;
}

.film-tile-name {
  text-align: center;
  white-space: normal;
  max-width: 84px;
  font-size: 11px;
  line-height: 1.15;
}

.pill.primary {
  background: var(--green);
  color: #06130b;
  border-color: #0000;
  font-weight: 600;
}

.del-chip {
  position: absolute;
  z-index: 7;
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  background: #c22727;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 14px #00000073;
}

.pill.danger {
  background: var(--red);
  color: #fff;
  border-color: #0000;
  font-weight: 600;
}

.pill:disabled {
  opacity: .4;
  cursor: default;
}

.pill.on {
  outline: 2px solid var(--accent);
}

input[type="text"], input[type="number"], input[type="search"], select, textarea {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: 10px;
  min-width: 0;
  padding: 9px 11px;
  font-size: 15px;
}

input[type="range"] {
  accent-color: var(--accent);
}

label.lbl {
  color: var(--muted);
  display: block;
  margin: 8px 0 4px;
  font-size: 13px;
}

.overlay {
  position: fixed;
  z-index: 120;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  inset: 0;
}

.overlay .scroll {
  overflow-y: auto;
  padding: 12px 12px calc(84px + max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px)));
  scrollbar-width: auto;
  flex: auto;
}

.overlay .overlay-footer {
  background: var(--bg2);
  border-top: 1px solid var(--glass-border);
  padding: 10px 76px calc(10px + max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px))) 12px;
  flex: none;
}

.help-fab {
  display: none;
}

.help-fab.on-overlay {
  display: block;
  position: fixed;
  right: 12px;
  bottom: calc(18px + max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px)));
  z-index: 130;
}

.tour-root {
  position: fixed;
  z-index: 240;
  pointer-events: none;
  inset: 0;
}

.tour-dim {
  position: absolute;
  pointer-events: auto;
  background: #020408a8;
}

.tour-ring {
  position: absolute;
  border: 3px solid var(--accent);
  pointer-events: none;
  border-radius: 14px;
  box-shadow: 0 0 0 4px #ffd23e38, 0 0 26px #ffd23e59;
}

.tour-x {
  position: absolute;
  pointer-events: auto;
  top: 58px;
  right: 12px;
}

.tour-callout {
  position: absolute;
  pointer-events: auto;
  background: var(--surface-strong);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px;
  left: 12px;
  right: 12px;
  box-shadow: 0 10px 34px #0000008c;
}

.tour-callout.bottom {
  bottom: calc(12px + max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px)));
}

.tour-callout.top {
  top: 118px;
}

.tour-callout h3 {
  margin: 2px 0 6px;
  font-size: 17px;
}

.tour-count {
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
}

.tour-press {
  margin: 4px 0;
  font-size: 15px;
  font-weight: 600;
}

.tour-see {
  color: var(--muted);
  margin: 4px 0;
  font-size: 14px;
}

.tour-callout img {
  object-fit: contain;
  display: block;
  background: #000;
  border-radius: 10px;
  width: 100%;
  max-height: 34dvh;
  margin: 8px 0 2px;
}

.notice-stack {
  position: fixed;
  top: calc(6px + env(safe-area-inset-top, 0px));
  z-index: 320;
  display: flex;
  pointer-events: none;
  flex-direction: column;
  gap: 8px;
  left: 8px;
  right: 8px;
}

.notice-stack .notice {
  pointer-events: auto;
  margin: 0;
}

.notice {
  position: relative;
  background: #ffd23e24;
  border: 1px solid #ffd23e80;
  border-radius: 12px;
  margin: 8px 12px 0;
  padding: 10px 40px 10px 12px;
  font-size: 14px;
}

.notice.error {
  background: #ff525224;
  border-color: #ff52528c;
}

.notice .nx {
  position: absolute;
  border: 1px solid var(--glass-border);
  background: var(--surface-strong);
  cursor: pointer;
  display: flex;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  width: 28px;
  height: 28px;
  font-size: 13px;
  top: 6px;
  right: 6px;
}

.toast {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(var(--dock-h)  + 10px + max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px)));
  z-index: 250;
  background: var(--surface-strong);
  border: 1px solid var(--glass-border);
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14.5px;
  transform: none;
  box-shadow: 0 8px 30px #0000008c;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 14px;
}

.kv b {
  font-weight: 600;
}

.proj-card {
  border: 1px solid var(--glass-border);
  background: var(--surface);
  border-radius: 14px;
  margin: 0 0 10px;
  padding: 10px 12px 12px;
}

.proj-head {
  display: block;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  background: none;
  border: 0;
  width: 100%;
  padding: 0;
}

.proj-name {
  display: block;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.proj-code {
  display: block;
  color: var(--text);
  letter-spacing: .05em;
  margin-top: 1px;
  font-size: 14px;
}

.proj-rename {
  margin-top: 8px;
}

.proj-rename input {
  flex: 1;
}

.proj-status {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 14px;
}

.proj-status.on {
  color: #7ee2a0;
}

.proj-primary {
  margin-top: 10px;
}

.proj-primary .pill {
  display: block;
  text-align: center;
  width: 100%;
}

.proj-sub {
  margin-top: 8px;
}

.muted {
  color: var(--muted);
}

.small-txt {
  font-size: 13px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.thumb {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #000;
  border-radius: 10px;
  width: 100%;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  border-radius: 999px;
}

.seg button {
  cursor: pointer;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 8px 13px;
  font-size: 14px;
}

.seg button.on {
  background: var(--glass);
  color: var(--text);
}

canvas.touch-none {
  touch-action: none;
}

.present-shell {
  position: fixed;
  z-index: 200;
  background: #000;
  inset: 0;
}

.present-canvas {
  display: block;
  background: #000;
  width: 100%;
  height: 100%;
}

.pettoy-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + max(env(safe-area-inset-bottom, 0px), var(--eyc-nav-floor, 0px)));
  z-index: 201;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  max-width: 96vw;
  transform: translateX(-50%);
}

.pettoy-bar .pill {
  color: #fff;
  background: #141a28d9;
  border-color: #ffffff59;
}

.pettoy-bar .pill.on {
  outline: 2px solid var(--accent);
}

.pettoy-code {
  color: #fff;
  background: #141a28d9;
  border: 1px solid #ffffff59;
  border-radius: 999px;
  padding: .55rem 1.1rem;
  font-size: .95rem;
}
