:root {
  --bg: #e9edf2;
  --panel: #ffffff;
  --panel2: #f4f6f9;
  --ink: #182230;
  --muted: #5d6f83;
  --line: #d9e1ea;
  --accent: #0e7a63;
  --accent-ink: #ffffff;
  --accent-soft: #e2f2ec;
  --warn: #b45309;
  --chip: #eef2f6;
  --shadow: 0 10px 30px rgba(21, 35, 52, 0.14);
  --tag-bg: rgba(16, 24, 34, 0.82);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1117;
    --panel: #141b24;
    --panel2: #1a232f;
    --ink: #e8eef5;
    --muted: #93a5b8;
    --line: #26313f;
    --accent: #2fbf9a;
    --accent-ink: #06231b;
    --accent-soft: #123128;
    --warn: #f0b35e;
    --chip: #1d2835;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --tag-bg: rgba(10, 16, 24, 0.85);
  }
}
* {
  box-sizing: border-box;
}
body,
html {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Avenir Next",
    "Segoe UI",
    system-ui,
    -apple-system,
    "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
[role="button"],
button,
input:not([type="checkbox"]),
select {
  min-height: 2.25rem;
}
#app {
  display: flex;
  height: 100dvh;
}
#stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(
    120% 90% at 50% 38%,
    #1d1e23 0,
    #101114 55%,
    #07080a 100%
  );
}
#stage canvas {
  display: block;
}
#labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.tag {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -115%);
  background: var(--tag-bg);
  color: #fff;
  border-radius: 10px;
  padding: 4px 9px 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  text-align: center;
  will-change: transform;
}
.tag .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}
.bang {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  pointer-events: none;
  will-change: transform;
  z-index: 4;
}
.bang svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
.bang span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  color: #2a1608;
  letter-spacing: -1px;
  line-height: 1;
  transform: rotate(-7deg);
}
.zzz {
  position: absolute;
  left: 0;
  top: 0;
  width: 64px;
  height: 84px;
  pointer-events: none;
  will-change: transform;
  z-index: 4;
}
.zzz span {
  position: absolute;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  color: #a9c8ff;
  text-shadow:
    0 2px 0 rgba(18, 38, 80, 0.55),
    0 0 7px rgba(120, 170, 255, 0.4);
  animation: zfloat 2.7s ease-in-out infinite;
}
.zzz .z1 {
  left: 4px;
  bottom: 4px;
  font-size: 15px;
}
.zzz .z2 {
  left: 21px;
  bottom: 15px;
  font-size: 20px;
  animation-delay: 0.9s;
}
.zzz .z3 {
  left: 39px;
  bottom: 29px;
  font-size: 27px;
  animation-delay: 1.8s;
}
@keyframes zfloat {
  0% {
    opacity: 0;
    transform: translateY(9px) rotate(-11deg) scale(0.65);
  }
  35% {
    opacity: 1;
  }
  70% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateY(-17px) rotate(13deg) scale(1.12);
  }
}
@media (prefers-reduced-motion: reduce) {
  .zzz span {
    animation-duration: 5.4s;
  }
}
#topbar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
#topbar > * {
  pointer-events: auto;
}
.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(13, 22, 33, 0.72);
  color: #fff;
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  box-shadow: 0 4px 14px rgba(10, 20, 30, 0.25);
}
.tbtn:hover {
  background: rgba(13, 22, 33, 0.88);
}
.tbtn[aria-pressed="true"] {
  background: var(--accent);
  border-color: transparent;
}
.tbtn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
#btnPhase {
  border-color: rgba(255, 210, 120, 0.55);
}
.tsep {
  flex: 1 1 auto;
}
.cams {
  display: flex;
  gap: 6px;
}
.cams .tbtn {
  padding: 0 10px;
  font-size: 12px;
}
#soundHint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(13, 22, 33, 0.8);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(10, 20, 30, 0.3);
}
#errbox {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 9;
  max-width: min(92%, 520px);
  background: #7f1d1d;
  color: #fff;
  font-size: 12.5px;
  padding: 10px 13px;
  border-radius: 10px;
  display: none;
}
#panel {
  flex: 0 0 300px;
  width: 300px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 14px 14px 20px;
  z-index: 4;
}
#panel h1 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 3px;
  letter-spacing: -0.01em;
}
#panel .sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 13px;
  line-height: 1.45;
}
.sec {
  margin-bottom: 15px;
}
.sec > h2 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 9px;
}
.card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
}
label.f {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 5px;
}
input[type="text"],
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13.5px;
  margin-bottom: 10px;
  min-height: 38px;
}
input[type="text"]:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  padding: 0 14px;
  min-height: 40px;
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  width: 100%;
}
.btn.primary:hover {
  filter: brightness(1.07);
}
.btn.ghost {
  width: 100%;
  margin-top: 8px;
}
.btn svg {
  width: 15px;
  height: 15px;
}
.task {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 11px;
  padding: 8px 10px;
  margin-bottom: 7px;
}
.task .tt {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.task .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ava {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.task .pbar {
  height: 6px;
  border-radius: 3px;
  background: var(--chip);
  margin-top: 8px;
  overflow: hidden;
}
.task .pbar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s linear;
}
.pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2.5px 8px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  white-space: nowrap;
}
.pill.run {
  background: var(--accent-soft);
  color: var(--accent);
}
.pill.done {
  background: var(--accent-soft);
  color: var(--accent);
}
.empty {
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 2px;
}
.mate {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 6px 10px;
  margin-bottom: 6px;
  min-height: 44px;
}
.mate:hover {
  border-color: var(--accent);
}
.mate .face {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.mate .nm {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
}
.mate .rl {
  font-size: 11.5px;
  color: var(--muted);
}
.mate .st {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  max-width: 110px;
}
#log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
}
#log li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  gap: 8px;
}
#log li:last-child {
  border-bottom: none;
}
#log time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
  font-size: 11.5px;
  padding-top: 1px;
}
.foot {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
#btnRetryVrm {
  margin-bottom: 6px;
}
#btnRetryVrm[hidden] {
  display: none;
}
.stylestatus {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 2px 0 0;
}
@media (max-width: 860px) {
  #app {
    flex-direction: column;
  }
  #stage {
    flex: 0 0 58dvh;
  }
  #panel {
    flex: 1 1 auto;
    width: auto;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .cams .tbtn {
    padding: 0 8px;
  }
}
