@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #060611;
  --bg-deep: #030308;
  --panel: rgba(17, 17, 38, 0.76);
  --panel-strong: rgba(22, 22, 49, 0.94);
  --line: rgba(255, 255, 255, 0.105);
  --line-bright: rgba(255, 255, 255, 0.18);
  --text: #f7f5ff;
  --muted: #9694ae;
  --muted-2: #6f6d87;
  --pink: #ff3ea5;
  --pink-soft: #ff78c4;
  --violet: #8d5cff;
  --cyan: #31d7ff;
  --lime: #b9ff5f;
  --amber: #ffca58;
  --danger: #ff647c;
  --success: #5fffb0;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Arial Black", "DIN Alternate", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute must win over component display rules (flex/grid buttons, panels…). */
[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 50% -20%, rgba(126, 73, 255, 0.16), transparent 44%),
    linear-gradient(145deg, #090917 0%, #05050e 56%, #090713 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ambient-canvas,
.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient-canvas {
  z-index: 0;
  opacity: 0.72;
}

.fx-canvas {
  z-index: 50;
}

.aurora {
  position: fixed;
  z-index: 0;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
  pointer-events: none;
  animation: auroraDrift 15s ease-in-out infinite alternate;
}

.aurora-a {
  top: 12%;
  left: -18%;
  background: var(--pink);
}

.aurora-b {
  right: -16%;
  bottom: -18%;
  background: var(--cyan);
  animation-delay: -7s;
}

.grain {
  position: fixed;
  z-index: 1;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(100%, 1680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px clamp(18px, 2.6vw, 46px) 14px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 58px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 62, 165, 0.95), rgba(117, 67, 255, 0.92));
  box-shadow: 0 12px 36px rgba(202, 55, 255, 0.24), inset 0 1px rgba(255, 255, 255, 0.4);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 50px;
  height: 12px;
  transform: rotate(-35deg) translate(3px, -18px);
  background: rgba(255, 255, 255, 0.28);
  filter: blur(5px);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.65;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-kicker {
  margin-bottom: 6px;
  color: var(--pink-soft);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.22em;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.09em;
}

.source-picker {
  position: relative;
  min-width: 260px;
  max-width: 410px;
}

.source-pill {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 410px;
  padding: 8px 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(16, 16, 34, 0.62);
  transition: 180ms ease;
  backdrop-filter: blur(18px);
}

.source-pill:hover {
  border-color: rgba(49, 215, 255, 0.32);
  background: rgba(24, 23, 48, 0.76);
  transform: translateY(-1px);
}

.source-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 13px var(--success);
}

.source-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.source-copy span {
  color: var(--muted-2);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.source-copy strong {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #dedbed;
  font-size: 0.75rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-pill > svg {
  width: 16px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.source-pill[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}

.source-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  left: 50%;
  width: min(390px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 18px;
  background: rgba(18, 17, 39, .97);
  box-shadow: 0 24px 70px rgba(0,0,0,.52);
  transform: translateX(-50%);
  backdrop-filter: blur(24px);
  animation: menuIn 180ms ease both;
}

.source-menu[hidden] { display: none; }

.source-menu-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 8px 11px;
}

.source-menu-head > div {
  display: flex;
  flex-direction: column;
}

.source-menu-head small {
  margin-bottom: 4px;
  color: var(--pink-soft);
  font-size: .48rem;
  font-weight: 850;
  letter-spacing: .18em;
}

.source-menu-head strong { font-size: .78rem; }
.source-menu-head > span { color: var(--muted); font-size: .56rem; }

.source-class-list {
  display: grid;
  max-height: min(46vh, 330px);
  gap: 5px;
  overflow: auto;
  padding: 2px;
}

.source-class-option {
  display: grid;
  min-height: 48px;
  grid-template-columns: minmax(0,1fr) auto 22px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  transition: 150ms ease;
}

.source-class-option:hover,
.source-class-option.active {
  border-color: rgba(255,93,184,.25);
  background: linear-gradient(110deg, rgba(255,62,165,.1), rgba(83,87,255,.08));
}

.source-class-option > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.source-class-option strong {
  overflow: hidden;
  color: #eeeaf5;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-class-option small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: .51rem;
}

.source-class-option > span:nth-child(2) {
  color: var(--muted);
  font-size: .56rem;
  white-space: nowrap;
}

.source-class-option > svg { width: 14px; color: var(--muted); }
.source-class-option.active > svg { color: var(--pink-soft); }

.source-manage-button {
  display: grid;
  width: 100%;
  min-height: 43px;
  grid-template-columns: 20px 1fr 20px;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding: 0 11px;
  cursor: pointer;
  color: #d4d0df;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}

.source-manage-button:hover { border-color: var(--line-bright); background: rgba(255,255,255,.07); }
.source-manage-button svg { width: 15px; }
.source-manage-button svg:first-child { color: var(--cyan); }
.source-manage-button svg:last-child { justify-self: end; color: var(--muted); }

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.action-button {
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(16, 16, 34, 0.66);
  transition: 180ms ease;
  backdrop-filter: blur(18px);
}

.icon-button {
  width: 42px;
}

.action-button {
  gap: 8px;
  padding: 0 15px;
  font-size: 0.78rem;
  font-weight: 700;
}

.icon-button:hover,
.action-button:hover {
  border-color: var(--line-bright);
  background: rgba(30, 29, 57, 0.82);
  transform: translateY(-1px);
}

.sound-off,
#soundToggle[aria-pressed="false"] .sound-on {
  display: none;
}

.theme-moon,
html[data-theme="light"] .theme-sun {
  display: none;
}

html[data-theme="light"] .theme-moon {
  display: block;
}

#soundToggle[aria-pressed="false"] .sound-off {
  display: block;
  color: var(--danger);
}

.main-content {
  padding-top: 10px;
}

.roster-workspace {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 15, 32, 0.48);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.roster-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.roster-toolbar .source-picker {
  width: min(100%, 440px);
  max-width: 440px;
}

.roster-import-button {
  min-width: 126px;
  background: linear-gradient(115deg, rgba(255, 62, 165, .16), rgba(141, 92, 255, .16));
}

.roster-workspace .class-strip {
  margin-bottom: 0;
}

.class-strip {
  margin-bottom: 16px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 11px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--pink-soft);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.2em;
}

.eyebrow i {
  display: inline-block;
  width: 13px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.section-heading h1 {
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  letter-spacing: 0.03em;
}

.class-lock {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.lock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.class-scroller {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.class-chip {
  position: relative;
  display: flex;
  min-width: 0;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  overflow: hidden;
  padding: 0 13px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(15, 15, 32, 0.65);
  transition: 180ms ease;
  backdrop-filter: blur(14px);
}

.class-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(120deg, rgba(255, 62, 165, 0.17), rgba(90, 73, 255, 0.19) 54%, rgba(49, 215, 255, 0.13));
  transition: opacity 180ms ease;
}

.class-chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.class-chip.active {
  border-color: rgba(255, 94, 184, 0.64);
  background: rgba(37, 21, 52, 0.92);
  box-shadow: 0 8px 28px rgba(255, 62, 165, 0.13), inset 0 0 24px rgba(141, 92, 255, 0.08);
}

.class-chip.active::before {
  opacity: 1;
}

.class-chip.active::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  box-shadow: 0 0 12px var(--pink);
}

.class-chip strong,
.class-chip small {
  position: relative;
  z-index: 1;
}

.class-chip strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-chip small {
  color: var(--muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.class-chip.active small {
  color: #d3bce4;
}

.class-chip:disabled {
  transform: none;
}

.empty-class-button {
  display: flex;
  min-height: 54px;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
  font-size: .68rem;
  transition: 160ms ease;
}

.empty-class-button:hover {
  color: white;
  border-color: rgba(255,94,184,.45);
  background: rgba(255,62,165,.055);
}

.stage-grid {
  display: block;
}

.side-card,
.spotlight,
.history-panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.side-card {
  min-width: 0;
  min-height: 490px;
  padding: clamp(17px, 1.5vw, 24px);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(21, 21, 45, 0.82), rgba(10, 10, 24, 0.72));
}

.card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d7d3e6;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.card-label svg {
  color: var(--pink-soft);
}

.stats-card {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.stats-toggle {
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 8px;
  padding: 13px 15px;
  cursor: pointer;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  user-select: none;
}

.stats-summary-count {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}

.stats-summary-count strong {
  color: white;
  font-size: 1rem;
}

.stats-summary-count small {
  color: var(--muted);
  font-size: .54rem;
}

.stats-toggle-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.stats-toggle-arrow svg { width: 15px; }

.stats-body {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  padding: 0 clamp(17px, 1.5vw, 24px) 20px;
}

.stats-card.is-collapsed .stats-body { display: none; }

.stats-card.is-collapsed .stats-toggle {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 8px;
  border-bottom: 0;
  text-align: center;
}

.stats-card.is-collapsed .card-label {
  flex-direction: column;
  gap: 10px;
}

.stats-card.is-collapsed .card-label span {
  writing-mode: vertical-rl;
  letter-spacing: .16em;
}

.stats-card.is-collapsed .stats-summary-count {
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stats-card.is-collapsed .stats-summary-count strong { font-size: 1.2rem; }
.stats-card.is-collapsed .stats-summary-count small { writing-mode: vertical-rl; }
.stats-card.is-collapsed .stats-toggle-arrow { transform: rotate(-90deg); }

.progress-orbit {
  position: relative;
  display: grid;
  width: min(150px, 80%);
  aspect-ratio: 1;
  margin: 38px auto 28px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--pink) 0deg, var(--violet) calc(var(--progress) * 0.62), var(--cyan) var(--progress), rgba(255,255,255,0.075) var(--progress));
  box-shadow: 0 0 42px rgba(141, 92, 255, 0.13);
  transition: background 500ms ease;
}

.progress-orbit::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #111126;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.55);
}

.progress-orbit::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: inherit;
  animation: orbitSpin 22s linear infinite;
}

.progress-orbit-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-orbit-inner strong {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 3.8vw, 3.5rem);
  line-height: 1;
}

.progress-orbit-inner span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.64rem;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: auto;
}

.stat-row > i {
  width: 1px;
  height: 34px;
  background: var(--line);
}

.stat-row > div {
  display: flex;
  flex-direction: column;
}

.stat-row span {
  color: var(--muted);
  font-size: 0.62rem;
}

.stat-row strong {
  margin-top: 4px;
  font-size: 1.3rem;
}

.linear-progress {
  height: 4px;
  margin: 19px 0 14px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.075);
}

.linear-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan));
  box-shadow: 0 0 12px var(--violet);
  transition: width 500ms cubic-bezier(.2,.8,.2,1);
}

.fair-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.55;
}

.fair-note svg {
  width: 14px;
  flex: 0 0 auto;
  color: var(--success);
}

.spotlight {
  --pointer-x: 50%;
  --pointer-y: 45%;
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 560px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 34px clamp(22px, 3vw, 54px) 28px;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(142, 79, 255, 0.16), transparent 36%),
    radial-gradient(circle at 50% 50%, rgba(255, 50, 161, 0.09), transparent 54%),
    linear-gradient(150deg, rgba(27, 22, 52, 0.91), rgba(10, 10, 26, 0.92) 58%, rgba(15, 13, 35, 0.9));
  isolation: isolate;
}

.spotlight::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.035) 44%, transparent 61%);
  transform: translateX(-80%);
  animation: stageShimmer 8s ease-in-out infinite;
}

.spotlight::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px rgba(255,255,255,.11), inset 0 -50px 100px rgba(0,0,0,.22);
  pointer-events: none;
}

.spotlight-grid {
  position: absolute;
  z-index: -3;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.orbit {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 45%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  width: min(68%, 470px);
  border: 1px solid rgba(255, 100, 190, 0.15);
  transform: translate(-50%, -50%);
  animation: orbitPulse 4s ease-in-out infinite;
}

.orbit-two {
  width: min(82%, 590px);
  border: 1px dashed rgba(49, 215, 255, 0.13);
  transform: translate(-50%, -50%);
  animation: orbitSpinCentered 28s linear infinite;
}

.orbit-three {
  width: min(52%, 350px);
  border: 1px solid rgba(255, 255, 255, 0.055);
  transform: translate(-50%, -50%);
}

.orbit-three::before,
.orbit-two::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.orbit-two::before {
  top: 18%;
  right: 9%;
}

.orbit-three::before {
  left: 4%;
  bottom: 27%;
  background: var(--pink);
  box-shadow: 0 0 14px var(--pink);
}

.paint-mark {
  position: absolute;
  z-index: -1;
  width: 100px;
  height: 22px;
  opacity: 0.42;
  border-radius: 50%;
  filter: blur(12px);
  transform: rotate(-28deg);
}

.mark-one {
  left: 9%;
  top: 19%;
  background: var(--pink);
}

.mark-two {
  right: 8%;
  bottom: 24%;
  background: var(--cyan);
  transform: rotate(24deg);
}

.stage-status {
  position: absolute;
  top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: #b9b5cc;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  background: rgba(7, 7, 19, 0.48);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  backdrop-filter: blur(12px);
}

.stage-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink-soft);
  box-shadow: 0 0 9px var(--pink);
}

.name-stage {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 230px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 30px;
  text-align: center;
}

.name-prefix {
  margin-bottom: 12px;
  color: var(--pink-soft);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: 180ms ease;
}

.student-name {
  display: block;
  max-width: 100%;
  color: white;
  font-family: var(--font-display);
  font-size: var(--name-size, clamp(4.6rem, 8.2vw, 8.8rem));
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0.055em;
  text-wrap: nowrap;
  white-space: nowrap;
  text-shadow: 0 7px 32px rgba(0, 0, 0, 0.36), 0 0 52px rgba(141, 92, 255, 0.15);
  transform-origin: center;
}

.student-name.placeholder {
  color: rgba(255, 255, 255, 0.24);
  font-size: clamp(3.3rem, 6vw, 6.8rem);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.14);
  text-shadow: none;
}

.student-name.long-name {
  letter-spacing: 0.012em;
}

.student-number {
  min-height: 22px;
  margin-top: 13px;
  color: #a7a4b8;
  font-size: clamp(0.72rem, 1.05vw, 0.94rem);
  font-weight: 600;
  letter-spacing: 0.17em;
}

.student-number strong {
  color: #e8e4f3;
  font-size: 1.05em;
}

.draw-control {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.draw-button {
  position: relative;
  display: grid;
  width: min(330px, 78vw);
  min-height: 70px;
  grid-template-columns: 46px 1fr 34px;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  padding: 8px 15px 8px 12px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.31);
  border-radius: 22px;
  background: linear-gradient(115deg, #f82f9d, #974dff 54%, #3279ff);
  box-shadow: 0 15px 45px rgba(184, 56, 255, 0.33), inset 0 1px rgba(255, 255, 255, 0.44);
  transition: transform 180ms cubic-bezier(.2,.8,.2,1), box-shadow 180ms ease;
}

.draw-button:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 20px 60px rgba(184, 56, 255, 0.43), inset 0 1px rgba(255, 255, 255, 0.52);
}

.draw-button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.draw-button-glow {
  position: absolute;
  width: 100px;
  height: 160%;
  left: -120px;
  top: -30%;
  background: rgba(255,255,255,.27);
  filter: blur(20px);
  transform: skewX(-25deg);
  animation: buttonGlint 3.4s ease-in-out infinite;
}

.draw-button-icon,
.draw-button-arrow {
  position: relative;
  display: grid;
  place-items: center;
}

.draw-button-icon {
  width: 43px;
  height: 43px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.draw-button-icon svg {
  width: 22px;
  height: 22px;
}

.draw-button-copy {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.draw-button-copy small {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.52rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.draw-button-copy strong {
  font-size: 1.06rem;
  letter-spacing: 0.08em;
}

.draw-button-arrow svg {
  transition: transform 180ms ease;
}

.draw-button:hover .draw-button-arrow svg {
  transform: translateX(3px);
}

.draw-control > p {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 0.62rem;
}

.spotlight.is-preparing {
  border-color: rgba(49, 215, 255, 0.3);
  box-shadow: 0 30px 90px rgba(0,0,0,.4), 0 0 34px rgba(49,215,255,.1);
}

.spotlight.is-preparing .orbit-one,
.spotlight.is-preparing .orbit-three {
  animation: orbitPulse 1.1s ease-in-out infinite;
}

.spotlight.is-preparing .draw-button:disabled {
  opacity: 1;
  background: linear-gradient(115deg, #1cb6dc, #6556e8 58%, #9a4cff);
}

.spotlight.is-rolling {
  border-color: rgba(255, 72, 172, 0.42);
  animation: rollingBorder 1.2s ease-in-out infinite alternate;
}

.spotlight.is-rolling .orbit-one {
  animation: orbitSpinCentered 2.8s linear infinite;
  border-color: rgba(255, 62, 165, 0.32);
}

.spotlight.is-rolling .orbit-two {
  animation-duration: 5s;
  border-color: rgba(49, 215, 255, 0.25);
}

.spotlight.is-rolling .stage-status-dot {
  animation: statusBlink 0.62s ease-in-out infinite alternate;
}

.spotlight.is-rolling .student-name {
  color: #fff;
  text-shadow: -4px 0 0 rgba(255, 62, 165, 0.26), 4px 0 0 rgba(49, 215, 255, 0.22), 0 0 48px rgba(141, 92, 255, 0.5);
  animation: nameTension 0.16s ease-in-out infinite alternate;
}

.spotlight.is-rolling .draw-button {
  background: linear-gradient(115deg, #ffbd36, #ff5f70 55%, #ff3ea5);
  box-shadow: 0 15px 48px rgba(255,83,113,.38), inset 0 1px rgba(255,255,255,.48);
}

.spotlight.is-rolling .draw-button-icon svg {
  animation: statusBlink .45s ease-in-out infinite alternate;
}

.spotlight.is-revealed .student-name {
  background: linear-gradient(100deg, #fff 10%, #ffd6ee 37%, #fff 54%, #cbf7ff 80%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nameReveal 720ms cubic-bezier(.16,1.25,.25,1) both;
  filter: drop-shadow(0 0 26px rgba(255, 62, 165, 0.25));
}

.spotlight.is-revealed .student-number {
  animation: detailReveal 650ms 120ms ease both;
}

.paint-splash {
  position: absolute;
  z-index: 1;
  width: var(--size);
  height: calc(var(--size) * .42);
  left: var(--x);
  top: var(--y);
  opacity: 0;
  border-radius: 48% 52% 65% 35%;
  background: var(--color);
  filter: blur(var(--blur));
  pointer-events: none;
  animation: splashBurst 850ms cubic-bezier(.16,.75,.3,1) forwards;
}

.sound-card {
  display: flex;
  flex-direction: column;
}

.sound-intro {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.6;
}

.sound-pads {
  display: grid;
  gap: 9px;
}

.sound-pad {
  position: relative;
  display: grid;
  min-height: 59px;
  grid-template-columns: 45px 1fr;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.035);
  transition: 170ms ease;
}

.sound-pad::before {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  left: -30px;
  opacity: 0.12;
  border-radius: 50%;
  background: currentColor;
  filter: blur(23px);
}

.sound-pad:hover,
.sound-pad.playing {
  border-color: currentColor;
  background: rgba(255,255,255,.065);
  transform: translateX(2px);
}

.sound-pad.ready { color: var(--cyan); }
.sound-pad.tension { color: var(--amber); }
.sound-pad.cheer { color: var(--pink-soft); }

.sound-pad > span:last-child {
  position: relative;
  display: flex;
  flex-direction: column;
}

.sound-pad strong {
  color: #f2eff8;
  font-size: 0.78rem;
}

.sound-pad small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.sound-wave {
  position: relative;
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid currentColor;
  border-radius: 13px;
  background: rgba(0,0,0,.15);
}

.sound-wave i {
  width: 2px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

.sound-wave i:nth-child(2) { height: 16px; }
.sound-wave i:nth-child(3) { height: 6px; }

.sound-pad.playing .sound-wave i {
  animation: waveDance .6s ease-in-out infinite alternate;
}

.sound-pad.playing .sound-wave i:nth-child(2) { animation-delay: -.25s; }
.sound-pad.playing .sound-wave i:nth-child(3) { animation-delay: -.42s; }

.volume-control {
  display: grid;
  grid-template-columns: auto 1fr 36px;
  align-items: center;
  gap: 9px;
  margin-top: 21px;
  color: var(--muted);
  font-size: 0.6rem;
}

.volume-control > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.volume-control svg {
  width: 13px;
}

.volume-control output {
  color: #cbc7d8;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

input[type="range"] {
  height: 3px;
  accent-color: var(--pink);
  cursor: pointer;
}

.tempo-control {
  margin-top: 19px;
}

.tempo-control > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.6rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0,0,0,.16);
}

.segmented button {
  min-width: 0;
  padding: 7px 3px;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 0.58rem;
  transition: 150ms ease;
}

.segmented button.active {
  color: white;
  background: linear-gradient(120deg, rgba(255,62,165,.75), rgba(126,74,255,.75));
  box-shadow: 0 5px 15px rgba(126,74,255,.18);
}

.shortcut-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted-2);
  font-size: 0.58rem;
}

kbd {
  padding: 4px 7px;
  color: #cbc7dc;
  border: 1px solid var(--line-bright);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255,255,255,.055);
  font-family: var(--font-ui);
  font-size: 0.52rem;
}

.history-panel {
  overflow: hidden;
  margin-top: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(18, 18, 39, 0.82), rgba(10, 10, 24, 0.75));
}

.history-panel summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.history-panel summary::-webkit-details-marker { display: none; }

.history-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.history-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(49,215,255,.2);
  border-radius: 12px;
  background: rgba(49,215,255,.07);
}

.history-title {
  display: flex;
  min-width: 160px;
  flex-direction: column;
}

.history-title strong {
  font-size: 0.8rem;
}

.history-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 450;
}

.history-preview {
  display: flex;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
}

.history-preview span {
  max-width: 92px;
  overflow: hidden;
  padding: 5px 9px;
  color: #bbb7c9;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-chevron {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  transition: transform 180ms ease;
}

.history-panel[open] .summary-chevron {
  transform: rotate(180deg);
}

.history-body {
  padding: 16px 20px 20px;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.batch-tools,
.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.63rem;
}

.select-all-label input,
.history-select {
  width: 15px;
  height: 15px;
  accent-color: var(--pink);
}

.text-button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  cursor: pointer;
  color: #aaa6b9;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.03);
  font-size: 0.6rem;
  transition: 150ms ease;
}

.text-button svg {
  width: 13px;
}

.text-button:hover:not(:disabled) {
  color: white;
  border-color: var(--line-bright);
  background: rgba(255,255,255,.07);
}

.text-button.danger:hover:not(:disabled) {
  color: #ffb0bd;
  border-color: rgba(255,100,124,.3);
  background: rgba(255,100,124,.08);
}

.text-button.undo {
  color: #9fe8ff;
  border-color: rgba(49,215,255,.28);
  background: rgba(49,215,255,.08);
}

.text-button.undo:hover:not(:disabled) {
  color: white;
  border-color: rgba(49,215,255,.5);
  background: rgba(49,215,255,.16);
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 8px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.028);
  transition: 150ms ease;
}

.history-item:hover {
  border-color: rgba(255,255,255,.17);
  background: rgba(255,255,255,.05);
}

.history-student {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.history-student strong {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-student small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 0.53rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restore-one {
  width: 31px;
  height: 31px;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
  transition: 150ms ease;
}

.restore-one:hover {
  color: var(--cyan);
  background: rgba(49,215,255,.08);
}

.restore-one svg {
  width: 14px;
}

.empty-history {
  display: none;
  padding: 27px;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 15px;
}

.empty-history.visible { display: flex; }

.empty-history > span {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 9px;
  place-items: center;
  color: var(--pink-soft);
  border-radius: 12px;
  background: rgba(255,62,165,.08);
}

.empty-history strong {
  color: #d4d0df;
  font-size: 0.75rem;
}

.empty-history p {
  margin: 5px 0 0;
  font-size: 0.6rem;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 3px 0;
  color: var(--muted-2);
  font-size: 0.58rem;
}

.footer span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.modal {
  width: min(680px, calc(100vw - 28px));
  max-height: min(90vh, 820px);
  padding: 0;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 25px;
  background: transparent;
  box-shadow: 0 40px 120px rgba(0,0,0,.72);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(3,3,10,.76);
  backdrop-filter: blur(10px);
}

.modal[open] {
  animation: modalIn 280ms cubic-bezier(.2,.8,.2,1) both;
}

.modal-shell,
.confirm-shell {
  max-height: min(90vh, 820px);
  overflow: auto;
  border-radius: inherit;
  background:
    radial-gradient(circle at 90% 0%, rgba(141,92,255,.16), transparent 35%),
    linear-gradient(145deg, rgba(26,25,53,.99), rgba(11,11,27,.99));
}

.modal-shell {
  padding: clamp(20px, 3.2vw, 32px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-header h2,
.confirm-shell h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  letter-spacing: .035em;
}

.modal-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.modal-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
}

.modal-close:hover {
  color: white;
  background: rgba(255,255,255,.08);
}

.drop-zone {
  display: flex;
  min-height: 245px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  border: 1px dashed rgba(255,255,255,.24);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,62,165,.055), rgba(49,215,255,.035)),
    rgba(255,255,255,.025);
  transition: 180ms ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--pink-soft);
  background: linear-gradient(135deg, rgba(255,62,165,.105), rgba(49,215,255,.065));
  box-shadow: inset 0 0 50px rgba(141,92,255,.08);
}

.drop-icon {
  display: grid;
  width: 61px;
  height: 61px;
  margin-bottom: 13px;
  place-items: center;
  color: white;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(255,62,165,.88), rgba(112,67,255,.85));
  box-shadow: 0 14px 34px rgba(176,58,255,.22);
}

.drop-icon svg {
  width: 27px;
  height: 27px;
}

.drop-zone > strong {
  font-size: .9rem;
}

.drop-zone > p {
  margin: 6px 0 13px;
  color: var(--muted);
  font-size: .66rem;
}

.format-list {
  display: flex;
  gap: 6px;
}

.format-list span {
  padding: 4px 7px;
  color: #aaa6ba;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0,0,0,.12);
  font-size: .49rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.import-loading {
  min-height: 245px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
}

.import-loading:not([hidden]) { display: flex; }

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--pink);
  border-right-color: var(--cyan);
  border-radius: 50%;
  animation: orbitSpin .8s linear infinite;
}

.import-loading strong {
  font-size: .8rem;
}

.import-loading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .6rem;
}

.import-preview {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}

.import-preview:not([hidden]) { display: block; }

.preview-file {
  display: grid;
  grid-template-columns: 43px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.preview-file > span {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  color: var(--cyan);
  border-radius: 12px;
  background: rgba(49,215,255,.08);
}

.preview-file > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.preview-file small {
  color: var(--muted-2);
  font-size: .52rem;
}

.preview-file strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-file button {
  padding: 6px 8px;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: .56rem;
}

.preview-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  padding: 19px 12px;
}

.preview-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--line);
}

.preview-stats > div:last-child { border-right: 0; }

.preview-stats span {
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.preview-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .55rem;
}

.preview-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 15px 15px;
}

.preview-classes span {
  padding: 6px 9px;
  color: #cbc7d8;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  font-size: .56rem;
}

.import-warning,
.modal-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #aaa6ba;
  font-size: .59rem;
  line-height: 1.55;
}

.import-warning {
  margin: 0 15px 15px;
  padding: 9px 10px;
  color: #e4c486;
  border: 1px solid rgba(255,202,88,.18);
  border-radius: 10px;
  background: rgba(255,202,88,.055);
}

.import-warning:not([hidden]) { display: flex; }

.import-warning svg,
.modal-note svg {
  width: 14px;
  flex: 0 0 auto;
}

.modal-note {
  margin-top: 13px;
}

.modal-note svg { color: var(--cyan); }

/* Roster manager: review every uploaded class list and clear several at once. */
.roster-manager {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
}

.manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.manager-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: .82rem;
  letter-spacing: .03em;
}

.manager-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .56rem;
}

.manager-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.manager-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 8px;
  max-height: 268px;
  padding: 13px 15px;
  overflow: auto;
}

.manager-list[hidden],
.manager-empty[hidden] { display: none; }

.roster-row {
  display: grid;
  grid-template-columns: 19px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 8px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.028);
  transition: 150ms ease;
}

.roster-row:hover {
  border-color: var(--line-bright);
  background: rgba(255,255,255,.05);
}

.roster-row.selected {
  border-color: rgba(255,100,124,.34);
  background: rgba(255,100,124,.07);
}

.roster-check {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.roster-check input {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--danger);
}

.roster-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.roster-info strong {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: .7rem;
  white-space: nowrap;
}

.roster-tag {
  padding: 2px 5px;
  color: var(--cyan);
  border: 1px solid rgba(49,215,255,.25);
  border-radius: 5px;
  background: rgba(49,215,255,.08);
  font-size: .46rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .06em;
}

.roster-info small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: .53rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-delete {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
  transition: 150ms ease;
}

.roster-delete svg { width: 14px; }

.roster-delete:hover {
  color: var(--danger);
  background: rgba(255,100,124,.12);
}

.manager-empty {
  margin: 0;
  padding: 18px 15px;
  color: var(--muted);
  font-size: .62rem;
  text-align: center;
}

.footer-hint {
  color: var(--muted-2);
  font-size: .58rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 20px;
}

.modal-footer > div,
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  cursor: pointer;
  border-radius: 11px;
  font-size: .67rem;
  font-weight: 700;
  transition: 160ms ease;
}

.primary-button {
  border: 1px solid rgba(255,255,255,.24);
  background: linear-gradient(115deg, var(--pink), var(--violet));
  box-shadow: 0 10px 25px rgba(173,55,255,.2);
}

.primary-button.danger {
  background: linear-gradient(115deg, #ff4e6b, #d83f77);
}

.secondary-button,
.ghost-button {
  color: #bbb7c9;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
}

.ghost-button { background: transparent; }

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.confirm-modal {
  width: min(420px, calc(100vw - 28px));
}

.confirm-shell {
  padding: 31px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--amber);
  border: 1px solid rgba(255,202,88,.21);
  border-radius: 17px;
  background: rgba(255,202,88,.08);
}

.confirm-icon.danger {
  color: var(--danger);
  border-color: rgba(255,100,124,.2);
  background: rgba(255,100,124,.08);
}

.confirm-shell p {
  margin: 10px 0 23px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.65;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  max-width: 100%;
  grid-template-columns: 28px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  color: #e9e5f1;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 13px;
  background: rgba(23,22,43,.94);
  box-shadow: 0 15px 45px rgba(0,0,0,.36);
  font-size: .67rem;
  backdrop-filter: blur(18px);
  animation: toastIn 280ms cubic-bezier(.2,.8,.2,1) both;
}

.toast.leaving { animation: toastOut 230ms ease forwards; }

.toast > span:first-child {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--success);
  border-radius: 9px;
  background: rgba(95,255,176,.08);
}

.toast.error > span:first-child {
  color: var(--danger);
  background: rgba(255,100,124,.08);
}

.toast svg { width: 14px; }

.celebration-flash {
  position: fixed;
  z-index: 45;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 46%, rgba(255,255,255,.82), rgba(255,90,190,.28) 24%, transparent 58%);
  mix-blend-mode: screen;
  animation: celebrationFlash 900ms ease-out forwards;
}

/* Light theme keeps the stage theatrical without sacrificing daytime legibility. */
html[data-theme="light"] {
  color-scheme: light;
  background: #f4f0fa;
  --bg: #f7f3fb;
  --bg-deep: #eee8f6;
  --panel: rgba(255, 255, 255, .78);
  --panel-strong: rgba(255, 255, 255, .96);
  --line: rgba(51, 32, 73, .13);
  --line-bright: rgba(51, 32, 73, .23);
  --text: #21182d;
  --muted: #71677c;
  --muted-2: #8b8195;
  --shadow: 0 24px 70px rgba(74, 51, 95, .14);
}

html[data-theme="light"] body {
  color: var(--text);
  background:
    radial-gradient(circle at 48% -18%, rgba(145, 91, 255, .18), transparent 43%),
    linear-gradient(145deg, #fbf9fd 0%, #f5f0fa 56%, #f8f4fb 100%);
}

html[data-theme="light"] .grain { opacity: .018; }
html[data-theme="light"] .ambient-canvas { opacity: .42; }
html[data-theme="light"] .aurora { opacity: .08; }
html[data-theme="light"] .brand-copy strong { color: #281b37; }

html[data-theme="light"] .icon-button,
html[data-theme="light"] .action-button,
html[data-theme="light"] .source-pill,
html[data-theme="light"] .class-chip,
html[data-theme="light"] .roster-workspace,
html[data-theme="light"] .history-panel {
  color: #30243d;
  border-color: var(--line);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 35px rgba(71, 45, 90, .08);
}

html[data-theme="light"] .icon-button:hover,
html[data-theme="light"] .action-button:hover,
html[data-theme="light"] .source-pill:hover {
  background: rgba(255, 255, 255, .96);
}

html[data-theme="light"] .source-copy strong,
html[data-theme="light"] .source-class-option strong,
html[data-theme="light"] .roster-info strong,
html[data-theme="light"] .manager-head h3,
html[data-theme="light"] .card-label,
html[data-theme="light"] .history-title strong,
html[data-theme="light"] .history-student strong,
html[data-theme="light"] .empty-history strong {
  color: #31243f;
}

html[data-theme="light"] .source-menu {
  color: #2b2038;
  border-color: rgba(65, 43, 85, .15);
  background: rgba(255, 252, 255, .98);
  box-shadow: 0 24px 65px rgba(66, 42, 85, .18);
}

html[data-theme="light"] .source-class-option,
html[data-theme="light"] .source-manage-button,
html[data-theme="light"] .history-item,
html[data-theme="light"] .roster-row,
html[data-theme="light"] .text-button,
html[data-theme="light"] .history-preview span {
  color: #584c63;
  background: rgba(72, 44, 92, .035);
}

html[data-theme="light"] .source-class-option:hover,
html[data-theme="light"] .source-class-option.active,
html[data-theme="light"] .class-chip.active {
  border-color: rgba(210, 48, 142, .32);
  background: linear-gradient(110deg, rgba(255, 81, 169, .11), rgba(100, 91, 240, .09));
}

html[data-theme="light"] .class-chip.active small { color: #765d80; }

html[data-theme="light"] .spotlight {
  border-color: rgba(84, 54, 106, .15);
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(142, 79, 255, .15), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(255, 75, 163, .09), transparent 54%),
    linear-gradient(150deg, rgba(255, 253, 255, .96), rgba(244, 237, 250, .97) 58%, rgba(250, 246, 253, .96));
  box-shadow: 0 28px 75px rgba(77, 48, 100, .15);
}

html[data-theme="light"] .spotlight::after {
  box-shadow: inset 0 1px rgba(255,255,255,.9), inset 0 -50px 100px rgba(97, 61, 120, .045);
}

html[data-theme="light"] .spotlight-grid {
  opacity: .12;
  background-image:
    linear-gradient(rgba(75, 46, 98, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 46, 98, .12) 1px, transparent 1px);
}

html[data-theme="light"] .stage-status {
  color: #66596f;
  border-color: rgba(68, 43, 88, .1);
  background: rgba(255, 255, 255, .68);
}

html[data-theme="light"] .student-name {
  color: #25182f;
  text-shadow: 0 7px 30px rgba(89, 55, 111, .13), 0 0 48px rgba(141, 92, 255, .1);
}

html[data-theme="light"] .student-name.placeholder {
  color: rgba(50, 32, 63, .26);
  -webkit-text-stroke-color: rgba(64, 39, 80, .13);
}

html[data-theme="light"] .student-number { color: #71667b; }
html[data-theme="light"] .student-number strong { color: #332540; }

html[data-theme="light"] .spotlight.is-revealed .student-name {
  background: linear-gradient(100deg, #342040 10%, #c52c82 36%, #5033a0 57%, #087d9a 86%);
  background-clip: text;
  -webkit-background-clip: text;
}

html[data-theme="light"] .modal-shell,
html[data-theme="light"] .confirm-shell {
  color: #261b32;
  background:
    radial-gradient(circle at 90% 0%, rgba(141,92,255,.12), transparent 35%),
    linear-gradient(145deg, rgba(255,253,255,.99), rgba(245,239,250,.99));
}

html[data-theme="light"] .drop-zone,
html[data-theme="light"] .import-preview,
html[data-theme="light"] .roster-manager,
html[data-theme="light"] .import-loading {
  background-color: rgba(78, 45, 98, .025);
}

html[data-theme="light"] .roster-row.selected {
  border-color: rgba(226, 62, 92, .3);
  background: rgba(255, 100, 124, .09);
}

html[data-theme="light"] .text-button.undo {
  color: #0d7d9c;
  border-color: rgba(18, 148, 178, .3);
  background: rgba(49, 215, 255, .1);
}

html[data-theme="light"] .footer-hint { color: #7d7189; }

html[data-theme="light"] .toast {
  color: #31243d;
  border-color: rgba(64, 42, 81, .15);
  background: rgba(255, 252, 255, .97);
  box-shadow: 0 15px 45px rgba(70, 45, 88, .16);
}

@keyframes menuIn {
  from { opacity: 0; transform: translate(-50%, -6px) scale(.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes celebrationFlash {
  0% { opacity: 0; }
  12% { opacity: .85; }
  100% { opacity: 0; }
}

@keyframes auroraDrift {
  to { transform: translate(12vw, 8vh) scale(1.16); }
}

@keyframes orbitSpin { to { transform: rotate(360deg); } }

@keyframes orbitSpinCentered {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitPulse {
  50% { opacity: .55; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes stageShimmer {
  0%, 35% { transform: translateX(-85%); }
  65%, 100% { transform: translateX(90%); }
}

@keyframes buttonGlint {
  0%, 35% { left: -120px; }
  70%, 100% { left: 115%; }
}

@keyframes rollingBorder {
  to { box-shadow: 0 30px 90px rgba(0,0,0,.4), 0 0 35px rgba(255,62,165,.15), inset 0 0 65px rgba(141,92,255,.07); }
}

@keyframes statusBlink {
  to { opacity: .25; transform: scale(.7); }
}

@keyframes nameTension {
  from { transform: translateX(-1px) skewX(-.4deg); }
  to { transform: translateX(1px) skewX(.4deg); }
}

@keyframes nameReveal {
  0% { opacity: 0; transform: scale(.72) rotateX(15deg); filter: blur(10px); }
  55% { opacity: 1; transform: scale(1.08) rotateX(0); filter: blur(0); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes detailReveal {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splashBurst {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.15) rotate(var(--rotate)); }
  40% { opacity: .6; }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(3.3) rotate(calc(var(--rotate) + 18deg)); }
}

@keyframes waveDance {
  to { height: 20px; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px) scale(.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(18px) scale(.96); }
}

@media (max-width: 1180px) {
  .stage-grid { display: block; }
}

@media (max-width: 820px) {
  .app-shell { padding-inline: 13px; }
  .topbar { grid-template-columns: 1fr auto; }
  .source-picker { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; }
  .source-pill { max-width: none; }
  .source-menu { left: 0; width: 100%; transform: none; }
  .source-menu[hidden] { display: none; }
  .action-button span { display: none; }
  .action-button { width: 42px; padding: 0; }
  .roster-workspace { padding: 12px; }
  .roster-toolbar { align-items: stretch; }
  .roster-toolbar .source-picker { grid-column: auto; grid-row: auto; width: 100%; }
  .roster-import-button { width: auto; min-width: 104px; padding-inline: 13px; }
  .roster-import-button span { display: inline; }
  .class-lock { display: none; }
  .class-scroller { display: flex; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
  .class-chip { min-width: 96px; scroll-snap-align: start; }
  .stage-grid { display: flex; flex-direction: column; }
  .spotlight { order: -1; width: 100%; min-height: 470px; }
  .stats-card { width: 100%; }
  .stats-body { min-height: 0; }
  .stats-card.is-collapsed .stats-toggle {
    display: grid;
    min-height: 60px;
    grid-template-columns: minmax(0,1fr) auto 28px;
    flex-direction: initial;
    padding: 11px 14px;
    text-align: left;
  }
  .stats-card.is-collapsed .card-label { flex-direction: row; gap: 8px; }
  .stats-card.is-collapsed .card-label span,
  .stats-card.is-collapsed .stats-summary-count small { writing-mode: initial; letter-spacing: .04em; }
  .stats-card.is-collapsed .stats-summary-count { flex-direction: row; gap: 0; }
  .stats-card.is-collapsed .stats-toggle-arrow { transform: rotate(0); }
  .progress-orbit { width: 120px; margin: 25px auto; }
  .progress-orbit-inner strong { font-size: 2.4rem; }
  .history-toolbar { align-items: flex-start; flex-direction: column; }
  .history-actions { width: 100%; justify-content: flex-end; }
  .manager-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .manager-tools { justify-content: flex-start; }
  .history-preview span:nth-child(n+3) { display: none; }
}

@media (max-width: 520px) {
  .brand-copy strong { font-size: 1rem; }
  .brand-kicker { font-size: .52rem; }
  .brand-mark { width: 42px; height: 42px; }
  .top-actions { gap: 5px; }
  .main-content { padding-top: 8px; }
  .roster-toolbar { flex-direction: column; }
  .roster-import-button { width: 100%; }
  .spotlight { min-height: 430px; padding-inline: 16px; }
  .stage-status { top: 20px; }
  .name-stage { min-height: 215px; }
  .student-name { font-size: var(--name-size, 3.7rem); }
  .student-name.placeholder { font-size: 3rem; }
  .draw-button { width: min(300px, 90vw); }
  .draw-control > p { display: none; }
  .side-card { padding: 16px; }
  .stats-card { padding: 0; }
  .history-panel summary { padding-inline: 13px; }
  .history-preview { display: none; }
  .history-title { min-width: 0; flex: 1; }
  .history-body { padding-inline: 13px; }
  .batch-tools { width: 100%; justify-content: space-between; }
  .history-actions { justify-content: space-between; }
  .history-list { grid-template-columns: 1fr; }
  .manager-tools { width: 100%; justify-content: space-between; }
  .manager-list { grid-template-columns: 1fr; }
  .footer-hint { text-align: center; }
  .footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .modal-footer { align-items: stretch; flex-direction: column-reverse; }
  .modal-footer > div { width: 100%; }
  .modal-footer > div button { flex: 1; }
  .secondary-button { width: 100%; }
  .preview-file { grid-template-columns: 38px minmax(0,1fr); }
  .preview-file button { grid-column: 1/-1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .ambient-canvas { display: none; }
}
